gst/rtp/: Some cleanups in the h263p (de)payloaders.
authorWim Taymans <wim.taymans@gmail.com>
Fri, 19 Aug 2005 14:51:20 +0000 (14:51 +0000)
committerWim Taymans <wim.taymans@gmail.com>
Fri, 19 Aug 2005 14:51:20 +0000 (14:51 +0000)
Original commit message from CVS:
* gst/rtp/gstrtph263pdec.c: (gst_rtph263pdec_init),
(gst_rtph263pdec_chain):
* gst/rtp/gstrtph263penc.c: (gst_rtph263penc_class_init),
(gst_rtph263penc_flush), (gst_rtph263penc_chain):
Some cleanups in the h263p (de)payloaders.

ChangeLog
gst/rtp/gstrtph263pdec.c
gst/rtp/gstrtph263pdepay.c
gst/rtp/gstrtph263penc.c
gst/rtp/gstrtph263ppay.c

index 296fc02..adce6fa 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,13 @@
 2005-08-19  Wim Taymans  <wim@fluendo.com>
 
+       * gst/rtp/gstrtph263pdec.c: (gst_rtph263pdec_init),
+       (gst_rtph263pdec_chain):
+       * gst/rtp/gstrtph263penc.c: (gst_rtph263penc_class_init),
+       (gst_rtph263penc_flush), (gst_rtph263penc_chain):
+       Some cleanups in the h263p (de)payloaders.
+
+2005-08-19  Wim Taymans  <wim@fluendo.com>
+
        * ext/amrnb/amrnbdec.c:
        * ext/amrnb/amrnbenc.c: (gst_amrnbenc_setcaps):
        * ext/amrnb/amrnbparse.c:
index 5061402..1ffc30e 100644 (file)
@@ -175,8 +175,8 @@ gst_rtph263pdec_chain (GstPad * pad, GstBuffer * buf)
     header_len = 2;
 
     M = gst_rtpbuffer_get_marker (buf);
-    P = payload[0] & 0x04 ? TRUE : FALSE;
-    V = payload[0] & 0x02 ? TRUE : FALSE;
+    P = (payload[0] & 0x04) == 0x04;
+    V = (payload[0] & 0x02) == 0x02;
     PLEN = ((payload[0] & 0x1) << 5) | (payload[1] >> 3);
 
     if (V) {
index 5061402..1ffc30e 100644 (file)
@@ -175,8 +175,8 @@ gst_rtph263pdec_chain (GstPad * pad, GstBuffer * buf)
     header_len = 2;
 
     M = gst_rtpbuffer_get_marker (buf);
-    P = payload[0] & 0x04 ? TRUE : FALSE;
-    V = payload[0] & 0x02 ? TRUE : FALSE;
+    P = (payload[0] & 0x04) == 0x04;
+    V = (payload[0] & 0x02) == 0x02;
     PLEN = ((payload[0] & 0x1) << 5) | (payload[1] >> 3);
 
     if (V) {
index 14c28c0..1cccfd2 100644 (file)
@@ -185,10 +185,8 @@ gst_rtph263penc_flush (GstRtpH263PEnc * rtph263penc)
     payload_len = header_len + towrite;
 
     outbuf = gst_rtpbuffer_new_allocate (payload_len, 0, 0);
-    gst_rtpbuffer_set_padding (outbuf, 0);
     gst_rtpbuffer_set_timestamp (outbuf,
         rtph263penc->first_ts * 90000 / GST_SECOND);
-    gst_rtpbuffer_set_payload_type (outbuf, 0);
     /* last fragment gets the marker bit set */
     gst_rtpbuffer_set_marker (outbuf, avail > towrite ? 0 : 1);
 
@@ -197,6 +195,12 @@ gst_rtph263penc_flush (GstRtpH263PEnc * rtph263penc)
     data = (guint8 *) gst_adapter_peek (rtph263penc->adapter, towrite);
     memcpy (&payload[header_len], data, towrite);
 
+    /*  0                   1
+     *  0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5
+     * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
+     * |   RR    |P|V|   PLEN    |PEBIT|
+     * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
+     */
     payload[0] = fragmented ? 0x00 : 0x04;
     payload[1] = 0;
 
index 14c28c0..1cccfd2 100644 (file)
@@ -185,10 +185,8 @@ gst_rtph263penc_flush (GstRtpH263PEnc * rtph263penc)
     payload_len = header_len + towrite;
 
     outbuf = gst_rtpbuffer_new_allocate (payload_len, 0, 0);
-    gst_rtpbuffer_set_padding (outbuf, 0);
     gst_rtpbuffer_set_timestamp (outbuf,
         rtph263penc->first_ts * 90000 / GST_SECOND);
-    gst_rtpbuffer_set_payload_type (outbuf, 0);
     /* last fragment gets the marker bit set */
     gst_rtpbuffer_set_marker (outbuf, avail > towrite ? 0 : 1);
 
@@ -197,6 +195,12 @@ gst_rtph263penc_flush (GstRtpH263PEnc * rtph263penc)
     data = (guint8 *) gst_adapter_peek (rtph263penc->adapter, towrite);
     memcpy (&payload[header_len], data, towrite);
 
+    /*  0                   1
+     *  0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5
+     * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
+     * |   RR    |P|V|   PLEN    |PEBIT|
+     * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
+     */
     payload[0] = fragmented ? 0x00 : 0x04;
     payload[1] = 0;