[bTSstream-devel] ietf/rtp3551: add missing types

Arnaud de Turckheim git at videolan.org
Mon May 11 16:35:20 CEST 2015


bitstream | branch: master | Arnaud de Turckheim <quarium at gmail.com> | Thu May  7 17:06:49 2015 +0200| [17cb52b30365044b804e1ba64623e1c7bc8d9001] | committer: Christophe Massiot

ietf/rtp3551: add missing types

> http://git.videolan.org/gitweb.cgi/bitstream.git/?a=commit;h=17cb52b30365044b804e1ba64623e1c7bc8d9001
---

 ietf/rtp3551.h |   97 ++++++++++++++++++++++++++++++++++++++++++--------------
 1 file changed, 73 insertions(+), 24 deletions(-)

diff --git a/ietf/rtp3551.h b/ietf/rtp3551.h
index ed30193..1197079 100644
--- a/ietf/rtp3551.h
+++ b/ietf/rtp3551.h
@@ -42,35 +42,84 @@ extern "C"
 {
 #endif
 
-#define RTP_TYPE_GSM         3
-#define RTP_TYPE_L16        10
-#define RTP_TYPE_L16MONO    11
-#define RTP_TYPE_MPA        14
-#define RTP_TYPE_MPV        32
+#define RTP_TYPE_PCMU           0
+/* Reserved                     1 */
+/* Reserved                     2 */
+#define RTP_TYPE_GSM            3
+#define RTP_TYPE_G723           4
+#define RTP_TYPE_DVI4_8000      5
+#define RTP_TYPE_DVI4_16000     6
+#define RTP_TYPE_LPC            7
+#define RTP_TYPE_PCMA           8
+#define RTP_TYPE_G722           9
+#define RTP_TYPE_L16            10
+#define RTP_TYPE_L16MONO        11
+#define RTP_TYPE_QCELP          12
+#define RTP_TYPE_CN             13
+#define RTP_TYPE_MPA            14
+#define RTP_TYPE_G728           15
+#define RTP_TYPE_DVI4_11025     16
+#define RTP_TYPE_DVI4_22050     17
+#define RTP_TYPE_G729           18
+/* Reserved                     19 */
+/* Unassigned                   20 */
+/* Unassigned                   21 */
+/* Unassigned                   22 */
+/* Unassigned                   23 */
+/* Unassigned                   24 */
+#define RTP_TYPE_CELB           25
+#define RTP_TYPE_JPEG           26
+/* Unassigned                   27 */
+#define RTP_TYPE_NV             28
+/* Unassigned                   29 */
+/* Unassigned                   30 */
+#define RTP_TYPE_H261           31
+#define RTP_TYPE_MPV            32
+#define RTP_TYPE_MP2T           33
+#define RTP_TYPE_H263           34
+/* Unassigned                   35-71 */
+/* Reserved                     72-76 */
+/* Unassigned                   77-95 */
+/* Dynamic                      96-127 */
 
 static inline uint32_t rtp_3551_get_clock_rate(uint8_t i_type)
 {
-    /* rtp type is a 7bit positive integer, thus 0xff is invalid */
-    struct {
-        uint8_t i_type;
-        uint32_t i_rate;
-    } profiles[] = {
-        { RTP_TYPE_TS,      90000 },
-        { RTP_TYPE_MPA,     90000 },
-        { RTP_TYPE_MPV,     90000 },
-        { RTP_TYPE_L16,     44100 },
-        { RTP_TYPE_L16MONO, 44100 },
-        { RTP_TYPE_GSM,      8000 },
+    switch (i_type) {
+    case RTP_TYPE_PCMU:
+    case RTP_TYPE_GSM:
+    case RTP_TYPE_G723:
+    case RTP_TYPE_DVI4_8000:
+    case RTP_TYPE_LPC:
+    case RTP_TYPE_PCMA:
+    case RTP_TYPE_G722:
+    case RTP_TYPE_QCELP:
+    case RTP_TYPE_CN:
+    case RTP_TYPE_G728:
+    case RTP_TYPE_G729:
+        return 8000;
 
-        { 0xff,             0xffff}
-    };
+    case RTP_TYPE_DVI4_16000:
+        return 16000;
 
-    int i = 0;
-    while(profiles[i].i_type != 0xff) {
-        if (i_type == profiles[i].i_type) {
-            return profiles[i].i_rate;
-        }
-        i++;
+    case RTP_TYPE_L16:
+    case RTP_TYPE_L16MONO:
+        return 44100;
+
+    case RTP_TYPE_DVI4_11025:
+        return 11025;
+
+    case RTP_TYPE_DVI4_22050:
+        return 22050;
+
+    case RTP_TYPE_MPA:
+    case RTP_TYPE_CELB:
+    case RTP_TYPE_JPEG:
+    case RTP_TYPE_NV:
+    case RTP_TYPE_H261:
+    case RTP_TYPE_MPV:
+    case RTP_TYPE_MP2T:
+    case RTP_TYPE_H263:
+        return 90000;
     }
     return 0; /* invalid clock rate for unknown type */
 }



More information about the biTStream-devel mailing list