mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2025-02-17 11:45:25 +00:00
gst/rtp/: Some cleanups in the h263p (de)payloaders.
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.
This commit is contained in:
parent
d00cee4a22
commit
3cb47855e6
5 changed files with 24 additions and 8 deletions
|
@ -1,3 +1,11 @@
|
|||
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:
|
||||
|
|
|
@ -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) {
|
||||
|
|
|
@ -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) {
|
||||
|
|
|
@ -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;
|
||||
|
||||
|
|
|
@ -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;
|
||||
|
||||
|
|
Loading…
Reference in a new issue