mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2024-11-27 20:21:24 +00:00
gst/rtp/: Use more efficient adapter and rtpbuffer methods when possible.
Original commit message from CVS: * gst/rtp/gstrtpL16depay.c: (gst_rtp_L16_depay_process): * gst/rtp/gstrtpgsmdepay.c: (gst_rtp_gsm_depay_process): * gst/rtp/gstrtpilbcdepay.c: (gst_rtp_ilbc_depay_process): * gst/rtp/gstrtpmp2tdepay.c: (gst_rtp_mp2t_depay_process): * gst/rtp/gstrtpmp4gdepay.c: (gst_rtp_mp4g_depay_process): * gst/rtp/gstrtpmp4gpay.c: (gst_rtp_mp4g_pay_flush): * gst/rtp/gstrtpmp4vdepay.c: (gst_rtp_mp4v_depay_setcaps), (gst_rtp_mp4v_depay_process): * gst/rtp/gstrtpmp4vpay.c: (gst_rtp_mp4v_pay_flush): * gst/rtp/gstrtpmpadepay.c: (gst_rtp_mpa_depay_process): * gst/rtp/gstrtpmpapay.c: (gst_rtp_mpa_pay_flush): * gst/rtp/gstrtpmpvdepay.c: (gst_rtp_mpv_depay_process): * gst/rtp/gstrtppcmadepay.c: (gst_rtp_pcma_depay_process): * gst/rtp/gstrtppcmudepay.c: (gst_rtp_pcmu_depay_process): * gst/rtp/gstrtpsv3vdepay.c: (gst_rtp_sv3v_depay_process): Use more efficient adapter and rtpbuffer methods when possible.
This commit is contained in:
parent
d26cbc8c66
commit
da3e23d375
15 changed files with 43 additions and 75 deletions
19
ChangeLog
19
ChangeLog
|
@ -1,3 +1,22 @@
|
||||||
|
2007-03-29 Wim Taymans <wim@fluendo.com>
|
||||||
|
|
||||||
|
* gst/rtp/gstrtpL16depay.c: (gst_rtp_L16_depay_process):
|
||||||
|
* gst/rtp/gstrtpgsmdepay.c: (gst_rtp_gsm_depay_process):
|
||||||
|
* gst/rtp/gstrtpilbcdepay.c: (gst_rtp_ilbc_depay_process):
|
||||||
|
* gst/rtp/gstrtpmp2tdepay.c: (gst_rtp_mp2t_depay_process):
|
||||||
|
* gst/rtp/gstrtpmp4gdepay.c: (gst_rtp_mp4g_depay_process):
|
||||||
|
* gst/rtp/gstrtpmp4gpay.c: (gst_rtp_mp4g_pay_flush):
|
||||||
|
* gst/rtp/gstrtpmp4vdepay.c: (gst_rtp_mp4v_depay_setcaps),
|
||||||
|
(gst_rtp_mp4v_depay_process):
|
||||||
|
* gst/rtp/gstrtpmp4vpay.c: (gst_rtp_mp4v_pay_flush):
|
||||||
|
* gst/rtp/gstrtpmpadepay.c: (gst_rtp_mpa_depay_process):
|
||||||
|
* gst/rtp/gstrtpmpapay.c: (gst_rtp_mpa_pay_flush):
|
||||||
|
* gst/rtp/gstrtpmpvdepay.c: (gst_rtp_mpv_depay_process):
|
||||||
|
* gst/rtp/gstrtppcmadepay.c: (gst_rtp_pcma_depay_process):
|
||||||
|
* gst/rtp/gstrtppcmudepay.c: (gst_rtp_pcmu_depay_process):
|
||||||
|
* gst/rtp/gstrtpsv3vdepay.c: (gst_rtp_sv3v_depay_process):
|
||||||
|
Use more efficient adapter and rtpbuffer methods when possible.
|
||||||
|
|
||||||
2007-03-29 Sebastian Dröge <slomo@circular-chaos.org>
|
2007-03-29 Sebastian Dröge <slomo@circular-chaos.org>
|
||||||
|
|
||||||
* gst/wavenc/gstwavenc.c: (gst_wavenc_create_header_buf),
|
* gst/wavenc/gstwavenc.c: (gst_wavenc_create_header_buf),
|
||||||
|
|
|
@ -220,10 +220,8 @@ gst_rtp_L16_depay_process (GstBaseRTPDepayload * depayload, GstBuffer * buf)
|
||||||
|
|
||||||
{
|
{
|
||||||
gint payload_len;
|
gint payload_len;
|
||||||
guint8 *payload;
|
|
||||||
|
|
||||||
payload_len = gst_rtp_buffer_get_payload_len (buf);
|
payload_len = gst_rtp_buffer_get_payload_len (buf);
|
||||||
payload = gst_rtp_buffer_get_payload (buf);
|
|
||||||
|
|
||||||
if (payload_len <= 0)
|
if (payload_len <= 0)
|
||||||
goto empty_packet;
|
goto empty_packet;
|
||||||
|
|
|
@ -123,19 +123,14 @@ static GstBuffer *
|
||||||
gst_rtp_gsm_depay_process (GstBaseRTPDepayload * _depayload, GstBuffer * buf)
|
gst_rtp_gsm_depay_process (GstBaseRTPDepayload * _depayload, GstBuffer * buf)
|
||||||
{
|
{
|
||||||
GstBuffer *outbuf = NULL;
|
GstBuffer *outbuf = NULL;
|
||||||
gint payload_len;
|
|
||||||
guint8 *payload;
|
|
||||||
|
|
||||||
GST_DEBUG ("process : got %d bytes, mark %d ts %u seqn %d",
|
GST_DEBUG ("process : got %d bytes, mark %d ts %u seqn %d",
|
||||||
GST_BUFFER_SIZE (buf),
|
GST_BUFFER_SIZE (buf),
|
||||||
gst_rtp_buffer_get_marker (buf),
|
gst_rtp_buffer_get_marker (buf),
|
||||||
gst_rtp_buffer_get_timestamp (buf), gst_rtp_buffer_get_seq (buf));
|
gst_rtp_buffer_get_timestamp (buf), gst_rtp_buffer_get_seq (buf));
|
||||||
|
|
||||||
payload_len = gst_rtp_buffer_get_payload_len (buf);
|
outbuf = gst_rtp_buffer_get_payload_buffer (buf);
|
||||||
payload = gst_rtp_buffer_get_payload (buf);
|
|
||||||
|
|
||||||
outbuf = gst_buffer_new_and_alloc (payload_len);
|
|
||||||
memcpy (GST_BUFFER_DATA (outbuf), payload, payload_len);
|
|
||||||
return outbuf;
|
return outbuf;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -169,18 +169,13 @@ static GstBuffer *
|
||||||
gst_rtp_ilbc_depay_process (GstBaseRTPDepayload * depayload, GstBuffer * buf)
|
gst_rtp_ilbc_depay_process (GstBaseRTPDepayload * depayload, GstBuffer * buf)
|
||||||
{
|
{
|
||||||
GstBuffer *outbuf = NULL;
|
GstBuffer *outbuf = NULL;
|
||||||
gint payload_len;
|
|
||||||
gint header_len;
|
|
||||||
|
|
||||||
GST_DEBUG ("process : got %d bytes, mark %d ts %u seqn %d",
|
GST_DEBUG ("process : got %d bytes, mark %d ts %u seqn %d",
|
||||||
GST_BUFFER_SIZE (buf),
|
GST_BUFFER_SIZE (buf),
|
||||||
gst_rtp_buffer_get_marker (buf),
|
gst_rtp_buffer_get_marker (buf),
|
||||||
gst_rtp_buffer_get_timestamp (buf), gst_rtp_buffer_get_seq (buf));
|
gst_rtp_buffer_get_timestamp (buf), gst_rtp_buffer_get_seq (buf));
|
||||||
|
|
||||||
payload_len = gst_rtp_buffer_get_payload_len (buf);
|
outbuf = gst_rtp_buffer_get_payload_buffer (buf);
|
||||||
header_len = gst_rtp_buffer_calc_header_len (0);
|
|
||||||
|
|
||||||
outbuf = gst_buffer_create_sub (buf, header_len, payload_len);
|
|
||||||
|
|
||||||
return outbuf;
|
return outbuf;
|
||||||
}
|
}
|
||||||
|
|
|
@ -173,7 +173,6 @@ gst_rtp_mp2t_depay_process (GstBaseRTPDepayload * depayload, GstBuffer * buf)
|
||||||
GstRtpMP2TDepay *rtpmp2tdepay;
|
GstRtpMP2TDepay *rtpmp2tdepay;
|
||||||
GstBuffer *outbuf;
|
GstBuffer *outbuf;
|
||||||
gint payload_len;
|
gint payload_len;
|
||||||
guint32 timestamp;
|
|
||||||
|
|
||||||
rtpmp2tdepay = GST_RTP_MP2T_DEPAY (depayload);
|
rtpmp2tdepay = GST_RTP_MP2T_DEPAY (depayload);
|
||||||
|
|
||||||
|
@ -185,15 +184,10 @@ gst_rtp_mp2t_depay_process (GstBaseRTPDepayload * depayload, GstBuffer * buf)
|
||||||
if (G_UNLIKELY (payload_len <= rtpmp2tdepay->skip_first_bytes))
|
if (G_UNLIKELY (payload_len <= rtpmp2tdepay->skip_first_bytes))
|
||||||
goto empty_packet;
|
goto empty_packet;
|
||||||
|
|
||||||
timestamp = gst_rtp_buffer_get_timestamp (buf);
|
|
||||||
|
|
||||||
outbuf =
|
outbuf =
|
||||||
gst_rtp_buffer_get_payload_subbuffer (buf, rtpmp2tdepay->skip_first_bytes,
|
gst_rtp_buffer_get_payload_subbuffer (buf, rtpmp2tdepay->skip_first_bytes,
|
||||||
-1);
|
-1);
|
||||||
|
|
||||||
gst_buffer_set_caps (outbuf, GST_PAD_CAPS (depayload->srcpad));
|
gst_buffer_set_caps (outbuf, GST_PAD_CAPS (depayload->srcpad));
|
||||||
GST_BUFFER_TIMESTAMP (outbuf) =
|
|
||||||
gst_util_uint64_scale_int (timestamp, GST_SECOND, depayload->clock_rate);
|
|
||||||
|
|
||||||
GST_DEBUG ("gst_rtp_mp2t_depay_chain: pushing buffer of size %d",
|
GST_DEBUG ("gst_rtp_mp2t_depay_chain: pushing buffer of size %d",
|
||||||
GST_BUFFER_SIZE (outbuf));
|
GST_BUFFER_SIZE (outbuf));
|
||||||
|
|
|
@ -276,7 +276,7 @@ gst_rtp_mp4g_depay_process (GstBaseRTPDepayload * depayload, GstBuffer * buf)
|
||||||
goto bad_packet;
|
goto bad_packet;
|
||||||
|
|
||||||
{
|
{
|
||||||
gint payload_len;
|
gint payload_len, payload_header;
|
||||||
guint8 *payload;
|
guint8 *payload;
|
||||||
guint32 timestamp;
|
guint32 timestamp;
|
||||||
guint AU_headers_len;
|
guint AU_headers_len;
|
||||||
|
@ -284,6 +284,7 @@ gst_rtp_mp4g_depay_process (GstBaseRTPDepayload * depayload, GstBuffer * buf)
|
||||||
|
|
||||||
payload_len = gst_rtp_buffer_get_payload_len (buf);
|
payload_len = gst_rtp_buffer_get_payload_len (buf);
|
||||||
payload = gst_rtp_buffer_get_payload (buf);
|
payload = gst_rtp_buffer_get_payload (buf);
|
||||||
|
payload_header = 0;
|
||||||
|
|
||||||
if (rtpmp4gdepay->sizelength > 0) {
|
if (rtpmp4gdepay->sizelength > 0) {
|
||||||
/* +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+- .. -+-+-+-+-+-+-+-+-+-+
|
/* +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+- .. -+-+-+-+-+-+-+-+-+-+
|
||||||
|
@ -298,6 +299,7 @@ gst_rtp_mp4g_depay_process (GstBaseRTPDepayload * depayload, GstBuffer * buf)
|
||||||
|
|
||||||
/* skip header */
|
/* skip header */
|
||||||
payload += 2;
|
payload += 2;
|
||||||
|
payload_header += 2;
|
||||||
payload_len -= 2;
|
payload_len -= 2;
|
||||||
|
|
||||||
/* FIXME, use bits */
|
/* FIXME, use bits */
|
||||||
|
@ -309,14 +311,15 @@ gst_rtp_mp4g_depay_process (GstBaseRTPDepayload * depayload, GstBuffer * buf)
|
||||||
|
|
||||||
/* skip special headers */
|
/* skip special headers */
|
||||||
payload += (AU_headers_len + 7) / 8;
|
payload += (AU_headers_len + 7) / 8;
|
||||||
|
payload_header += (AU_headers_len + 7) / 8;
|
||||||
payload_len = AU_size;
|
payload_len = AU_size;
|
||||||
}
|
}
|
||||||
|
|
||||||
timestamp = gst_rtp_buffer_get_timestamp (buf);
|
timestamp = gst_rtp_buffer_get_timestamp (buf);
|
||||||
|
|
||||||
outbuf = gst_buffer_new_and_alloc (payload_len);
|
/* strip header from payload and push in the adapter */
|
||||||
memcpy (GST_BUFFER_DATA (outbuf), payload, payload_len);
|
outbuf =
|
||||||
|
gst_rtp_buffer_get_payload_subbuffer (buf, payload_header, payload_len);
|
||||||
gst_adapter_push (rtpmp4gdepay->adapter, outbuf);
|
gst_adapter_push (rtpmp4gdepay->adapter, outbuf);
|
||||||
|
|
||||||
/* if this was the last packet of the VOP, create and push a buffer */
|
/* if this was the last packet of the VOP, create and push a buffer */
|
||||||
|
@ -325,11 +328,7 @@ gst_rtp_mp4g_depay_process (GstBaseRTPDepayload * depayload, GstBuffer * buf)
|
||||||
|
|
||||||
avail = gst_adapter_available (rtpmp4gdepay->adapter);
|
avail = gst_adapter_available (rtpmp4gdepay->adapter);
|
||||||
|
|
||||||
outbuf = gst_buffer_new ();
|
outbuf = gst_adapter_take_buffer (rtpmp4gdepay->adapter, avail);
|
||||||
GST_BUFFER_SIZE (outbuf) = avail;
|
|
||||||
GST_BUFFER_MALLOCDATA (outbuf) =
|
|
||||||
gst_adapter_take (rtpmp4gdepay->adapter, avail);
|
|
||||||
GST_BUFFER_DATA (outbuf) = GST_BUFFER_MALLOCDATA (outbuf);
|
|
||||||
gst_buffer_set_caps (outbuf, GST_PAD_CAPS (depayload->srcpad));
|
gst_buffer_set_caps (outbuf, GST_PAD_CAPS (depayload->srcpad));
|
||||||
GST_BUFFER_TIMESTAMP (outbuf) = gst_util_uint64_scale_int
|
GST_BUFFER_TIMESTAMP (outbuf) = gst_util_uint64_scale_int
|
||||||
(timestamp, GST_SECOND, depayload->clock_rate);
|
(timestamp, GST_SECOND, depayload->clock_rate);
|
||||||
|
|
|
@ -453,7 +453,6 @@ gst_rtp_mp4g_pay_flush (GstRtpMP4GPay * rtpmp4gpay)
|
||||||
while (avail > 0) {
|
while (avail > 0) {
|
||||||
guint towrite;
|
guint towrite;
|
||||||
guint8 *payload;
|
guint8 *payload;
|
||||||
guint8 *data;
|
|
||||||
guint payload_len;
|
guint payload_len;
|
||||||
guint packet_len;
|
guint packet_len;
|
||||||
|
|
||||||
|
@ -511,9 +510,8 @@ gst_rtp_mp4g_pay_flush (GstRtpMP4GPay * rtpmp4gpay)
|
||||||
payload[2] = (total & 0x1fe0) >> 5;
|
payload[2] = (total & 0x1fe0) >> 5;
|
||||||
payload[3] = (total & 0x1f) << 3; /* we use 13 bits for the size, 3 bits index */
|
payload[3] = (total & 0x1f) << 3; /* we use 13 bits for the size, 3 bits index */
|
||||||
|
|
||||||
data = (guint8 *) gst_adapter_peek (rtpmp4gpay->adapter, payload_len);
|
/* copy stuff from adapter to payload */
|
||||||
memcpy (&payload[4], data, payload_len);
|
gst_adapter_copy (rtpmp4gpay->adapter, &payload[4], 0, payload_len);
|
||||||
|
|
||||||
gst_adapter_flush (rtpmp4gpay->adapter, payload_len);
|
gst_adapter_flush (rtpmp4gpay->adapter, payload_len);
|
||||||
|
|
||||||
/* marker only if the packet is complete */
|
/* marker only if the packet is complete */
|
||||||
|
|
|
@ -207,7 +207,6 @@ gst_rtp_mp4v_depay_process (GstBaseRTPDepayload * depayload, GstBuffer * buf)
|
||||||
gst_adapter_clear (rtpmp4vdepay->adapter);
|
gst_adapter_clear (rtpmp4vdepay->adapter);
|
||||||
|
|
||||||
outbuf = gst_rtp_buffer_get_payload_buffer (buf);
|
outbuf = gst_rtp_buffer_get_payload_buffer (buf);
|
||||||
|
|
||||||
gst_adapter_push (rtpmp4vdepay->adapter, outbuf);
|
gst_adapter_push (rtpmp4vdepay->adapter, outbuf);
|
||||||
|
|
||||||
/* if this was the last packet of the VOP, create and push a buffer */
|
/* if this was the last packet of the VOP, create and push a buffer */
|
||||||
|
@ -217,7 +216,6 @@ gst_rtp_mp4v_depay_process (GstBaseRTPDepayload * depayload, GstBuffer * buf)
|
||||||
avail = gst_adapter_available (rtpmp4vdepay->adapter);
|
avail = gst_adapter_available (rtpmp4vdepay->adapter);
|
||||||
|
|
||||||
outbuf = gst_adapter_take_buffer (rtpmp4vdepay->adapter, avail);
|
outbuf = gst_adapter_take_buffer (rtpmp4vdepay->adapter, avail);
|
||||||
|
|
||||||
gst_buffer_set_caps (outbuf, GST_PAD_CAPS (depayload->srcpad));
|
gst_buffer_set_caps (outbuf, GST_PAD_CAPS (depayload->srcpad));
|
||||||
|
|
||||||
GST_DEBUG ("gst_rtp_mp4v_depay_chain: pushing buffer of size %d",
|
GST_DEBUG ("gst_rtp_mp4v_depay_chain: pushing buffer of size %d",
|
||||||
|
|
|
@ -262,7 +262,6 @@ gst_rtp_mp4v_pay_flush (GstRtpMP4VPay * rtpmp4vpay)
|
||||||
while (avail > 0) {
|
while (avail > 0) {
|
||||||
guint towrite;
|
guint towrite;
|
||||||
guint8 *payload;
|
guint8 *payload;
|
||||||
guint8 *data;
|
|
||||||
guint payload_len;
|
guint payload_len;
|
||||||
guint packet_len;
|
guint packet_len;
|
||||||
|
|
||||||
|
@ -280,9 +279,8 @@ gst_rtp_mp4v_pay_flush (GstRtpMP4VPay * rtpmp4vpay)
|
||||||
|
|
||||||
/* copy payload */
|
/* copy payload */
|
||||||
payload = gst_rtp_buffer_get_payload (outbuf);
|
payload = gst_rtp_buffer_get_payload (outbuf);
|
||||||
data = (guint8 *) gst_adapter_peek (rtpmp4vpay->adapter, payload_len);
|
|
||||||
memcpy (payload, data, payload_len);
|
|
||||||
|
|
||||||
|
gst_adapter_copy (rtpmp4vpay->adapter, payload, 0, payload_len);
|
||||||
gst_adapter_flush (rtpmp4vpay->adapter, payload_len);
|
gst_adapter_flush (rtpmp4vpay->adapter, payload_len);
|
||||||
|
|
||||||
avail -= payload_len;
|
avail -= payload_len;
|
||||||
|
|
|
@ -161,7 +161,6 @@ gst_rtp_mpa_depay_process (GstBaseRTPDepayload * depayload, GstBuffer * buf)
|
||||||
gint payload_len;
|
gint payload_len;
|
||||||
guint8 *payload;
|
guint8 *payload;
|
||||||
guint16 frag_offset;
|
guint16 frag_offset;
|
||||||
guint32 timestamp;
|
|
||||||
|
|
||||||
payload_len = gst_rtp_buffer_get_payload_len (buf);
|
payload_len = gst_rtp_buffer_get_payload_len (buf);
|
||||||
payload = gst_rtp_buffer_get_payload (buf);
|
payload = gst_rtp_buffer_get_payload (buf);
|
||||||
|
@ -179,16 +178,8 @@ gst_rtp_mpa_depay_process (GstBaseRTPDepayload * depayload, GstBuffer * buf)
|
||||||
*/
|
*/
|
||||||
frag_offset = (payload[2] << 8) | payload[3];
|
frag_offset = (payload[2] << 8) | payload[3];
|
||||||
|
|
||||||
payload_len -= 4;
|
/* subbuffer skipping the 4 header bytes */
|
||||||
payload += 4;
|
outbuf = gst_rtp_buffer_get_payload_subbuffer (buf, 4, -1);
|
||||||
|
|
||||||
timestamp = gst_rtp_buffer_get_timestamp (buf);
|
|
||||||
|
|
||||||
outbuf = gst_buffer_new_and_alloc (payload_len);
|
|
||||||
|
|
||||||
//GST_BUFFER_TIMESTAMP (outbuf) = timestamp * GST_SECOND / 90000;
|
|
||||||
|
|
||||||
memcpy (GST_BUFFER_DATA (outbuf), payload, payload_len);
|
|
||||||
|
|
||||||
GST_DEBUG_OBJECT (rtpmpadepay,
|
GST_DEBUG_OBJECT (rtpmpadepay,
|
||||||
"gst_rtp_mpa_depay_chain: pushing buffer of size %d",
|
"gst_rtp_mpa_depay_chain: pushing buffer of size %d",
|
||||||
|
|
|
@ -174,7 +174,6 @@ gst_rtp_mpa_pay_flush (GstRtpMPAPay * rtpmpapay)
|
||||||
while (avail > 0) {
|
while (avail > 0) {
|
||||||
guint towrite;
|
guint towrite;
|
||||||
guint8 *payload;
|
guint8 *payload;
|
||||||
guint8 *data;
|
|
||||||
guint payload_len;
|
guint payload_len;
|
||||||
guint packet_len;
|
guint packet_len;
|
||||||
|
|
||||||
|
@ -207,8 +206,7 @@ gst_rtp_mpa_pay_flush (GstRtpMPAPay * rtpmpapay)
|
||||||
payload[2] = frag_offset >> 8;
|
payload[2] = frag_offset >> 8;
|
||||||
payload[3] = frag_offset & 0xff;
|
payload[3] = frag_offset & 0xff;
|
||||||
|
|
||||||
data = (guint8 *) gst_adapter_peek (rtpmpapay->adapter, payload_len);
|
gst_adapter_copy (rtpmpapay->adapter, &payload[4], 0, payload_len);
|
||||||
memcpy (&payload[4], data, payload_len);
|
|
||||||
gst_adapter_flush (rtpmpapay->adapter, payload_len);
|
gst_adapter_flush (rtpmpapay->adapter, payload_len);
|
||||||
|
|
||||||
avail -= payload_len;
|
avail -= payload_len;
|
||||||
|
|
|
@ -158,13 +158,13 @@ gst_rtp_mpv_depay_process (GstBaseRTPDepayload * depayload, GstBuffer * buf)
|
||||||
goto bad_packet;
|
goto bad_packet;
|
||||||
|
|
||||||
{
|
{
|
||||||
gint payload_len;
|
gint payload_len, payload_header;
|
||||||
guint8 *payload;
|
guint8 *payload;
|
||||||
guint8 T;
|
guint8 T;
|
||||||
guint32 timestamp;
|
|
||||||
|
|
||||||
payload_len = gst_rtp_buffer_get_payload_len (buf);
|
payload_len = gst_rtp_buffer_get_payload_len (buf);
|
||||||
payload = gst_rtp_buffer_get_payload (buf);
|
payload = gst_rtp_buffer_get_payload (buf);
|
||||||
|
payload_header = 0;
|
||||||
|
|
||||||
if (payload_len <= 4)
|
if (payload_len <= 4)
|
||||||
goto empty_packet;
|
goto empty_packet;
|
||||||
|
@ -181,6 +181,7 @@ gst_rtp_mpv_depay_process (GstBaseRTPDepayload * depayload, GstBuffer * buf)
|
||||||
T = (payload[0] & 0x04);
|
T = (payload[0] & 0x04);
|
||||||
|
|
||||||
payload_len -= 4;
|
payload_len -= 4;
|
||||||
|
payload_header += 4;
|
||||||
payload += 4;
|
payload += 4;
|
||||||
|
|
||||||
if (T) {
|
if (T) {
|
||||||
|
@ -197,13 +198,11 @@ gst_rtp_mpv_depay_process (GstBaseRTPDepayload * depayload, GstBuffer * buf)
|
||||||
goto empty_packet;
|
goto empty_packet;
|
||||||
|
|
||||||
payload_len -= 4;
|
payload_len -= 4;
|
||||||
|
payload_header += 4;
|
||||||
payload += 4;
|
payload += 4;
|
||||||
}
|
}
|
||||||
|
|
||||||
timestamp = gst_rtp_buffer_get_timestamp (buf);
|
outbuf = gst_rtp_buffer_get_payload_subbuffer (buf, payload_header, -1);
|
||||||
|
|
||||||
outbuf = gst_buffer_new_and_alloc (payload_len);
|
|
||||||
memcpy (GST_BUFFER_DATA (outbuf), payload, payload_len);
|
|
||||||
|
|
||||||
GST_DEBUG_OBJECT (rtpmpvdepay,
|
GST_DEBUG_OBJECT (rtpmpvdepay,
|
||||||
"gst_rtp_mpv_depay_chain: pushing buffer of size %d",
|
"gst_rtp_mpv_depay_chain: pushing buffer of size %d",
|
||||||
|
|
|
@ -136,8 +136,6 @@ gst_rtp_pcma_depay_process (GstBaseRTPDepayload * depayload, GstBuffer * buf)
|
||||||
{
|
{
|
||||||
GstCaps *srccaps;
|
GstCaps *srccaps;
|
||||||
GstBuffer *outbuf = NULL;
|
GstBuffer *outbuf = NULL;
|
||||||
gint payload_len;
|
|
||||||
guint8 *payload;
|
|
||||||
|
|
||||||
GST_DEBUG ("process : got %d bytes, mark %d ts %u seqn %d",
|
GST_DEBUG ("process : got %d bytes, mark %d ts %u seqn %d",
|
||||||
GST_BUFFER_SIZE (buf),
|
GST_BUFFER_SIZE (buf),
|
||||||
|
@ -153,11 +151,8 @@ gst_rtp_pcma_depay_process (GstBaseRTPDepayload * depayload, GstBuffer * buf)
|
||||||
gst_caps_unref (srccaps);
|
gst_caps_unref (srccaps);
|
||||||
}
|
}
|
||||||
|
|
||||||
payload_len = gst_rtp_buffer_get_payload_len (buf);
|
outbuf = gst_rtp_buffer_get_payload_buffer (buf);
|
||||||
payload = gst_rtp_buffer_get_payload (buf);
|
|
||||||
|
|
||||||
outbuf = gst_buffer_new_and_alloc (payload_len);
|
|
||||||
memcpy (GST_BUFFER_DATA (outbuf), payload, payload_len);
|
|
||||||
return outbuf;
|
return outbuf;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -136,8 +136,6 @@ gst_rtp_pcmu_depay_process (GstBaseRTPDepayload * depayload, GstBuffer * buf)
|
||||||
{
|
{
|
||||||
GstCaps *srccaps;
|
GstCaps *srccaps;
|
||||||
GstBuffer *outbuf = NULL;
|
GstBuffer *outbuf = NULL;
|
||||||
gint payload_len;
|
|
||||||
guint8 *payload;
|
|
||||||
|
|
||||||
GST_DEBUG ("process : got %d bytes, mark %d ts %u seqn %d",
|
GST_DEBUG ("process : got %d bytes, mark %d ts %u seqn %d",
|
||||||
GST_BUFFER_SIZE (buf),
|
GST_BUFFER_SIZE (buf),
|
||||||
|
@ -153,11 +151,8 @@ gst_rtp_pcmu_depay_process (GstBaseRTPDepayload * depayload, GstBuffer * buf)
|
||||||
gst_caps_unref (srccaps);
|
gst_caps_unref (srccaps);
|
||||||
}
|
}
|
||||||
|
|
||||||
payload_len = gst_rtp_buffer_get_payload_len (buf);
|
outbuf = gst_rtp_buffer_get_payload_buffer (buf);
|
||||||
payload = gst_rtp_buffer_get_payload (buf);
|
|
||||||
|
|
||||||
outbuf = gst_buffer_new_and_alloc (payload_len);
|
|
||||||
memcpy (GST_BUFFER_DATA (outbuf), payload, payload_len);
|
|
||||||
return outbuf;
|
return outbuf;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -252,14 +252,10 @@ gst_rtp_sv3v_depay_process (GstBaseRTPDepayload * depayload, GstBuffer * buf)
|
||||||
if (M) {
|
if (M) {
|
||||||
/* frame is completed: push contents of adapter */
|
/* frame is completed: push contents of adapter */
|
||||||
guint avail;
|
guint avail;
|
||||||
guint8 *data;
|
|
||||||
guint32 timestamp;
|
guint32 timestamp;
|
||||||
|
|
||||||
avail = gst_adapter_available (rtpsv3vdepay->adapter);
|
avail = gst_adapter_available (rtpsv3vdepay->adapter);
|
||||||
data = gst_adapter_take (rtpsv3vdepay->adapter, avail);
|
outbuf = gst_adapter_take_buffer (rtpsv3vdepay->adapter, avail);
|
||||||
|
|
||||||
/* create buffer with data */
|
|
||||||
outbuf = gst_rtp_buffer_new_take_data (data, avail);
|
|
||||||
|
|
||||||
/* timestamp for complete buffer is that of last buffer as well */
|
/* timestamp for complete buffer is that of last buffer as well */
|
||||||
timestamp = gst_rtp_buffer_get_timestamp (buf);
|
timestamp = gst_rtp_buffer_get_timestamp (buf);
|
||||||
|
|
Loading…
Reference in a new issue