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:
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) {
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) {
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);
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;
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);
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;