diff options
author | Tim-Philipp Müller <tim@centricular.com> | 2015-07-12 14:27:15 +0100 |
---|---|---|
committer | Tim-Philipp Müller <tim@centricular.com> | 2015-07-12 14:28:29 +0100 |
commit | 6717c86061f8757fc6d5c7b660a06b59194cf673 (patch) | |
tree | c7913c69364f897a51cbfcc4d7d933a10cdc7be4 /gst/rtp/gstrtpmp2tdepay.c | |
parent | fe787425bcc4be1bb9ea6a63d245731e6b431251 (diff) |
rtp: depayloaders: implement process_rtp_packet() vfunc
For more optimised RTP packet handling: means we don't
need to map the input buffer again but can just re-use
the mapping the base class has already done.
https://bugzilla.gnome.org/show_bug.cgi?id=750235
Diffstat (limited to 'gst/rtp/gstrtpmp2tdepay.c')
-rw-r--r-- | gst/rtp/gstrtpmp2tdepay.c | 14 |
1 files changed, 5 insertions, 9 deletions
diff --git a/gst/rtp/gstrtpmp2tdepay.c b/gst/rtp/gstrtpmp2tdepay.c index 345d90616..da73db651 100644 --- a/gst/rtp/gstrtpmp2tdepay.c +++ b/gst/rtp/gstrtpmp2tdepay.c @@ -74,7 +74,7 @@ G_DEFINE_TYPE (GstRtpMP2TDepay, gst_rtp_mp2t_depay, static gboolean gst_rtp_mp2t_depay_setcaps (GstRTPBaseDepayload * depayload, GstCaps * caps); static GstBuffer *gst_rtp_mp2t_depay_process (GstRTPBaseDepayload * depayload, - GstBuffer * buf); + GstRTPBuffer * rtp); static void gst_rtp_mp2t_depay_set_property (GObject * object, guint prop_id, const GValue * value, GParamSpec * pspec); @@ -92,7 +92,7 @@ gst_rtp_mp2t_depay_class_init (GstRtpMP2TDepayClass * klass) gstelement_class = (GstElementClass *) klass; gstrtpbasedepayload_class = (GstRTPBaseDepayloadClass *) klass; - gstrtpbasedepayload_class->process = gst_rtp_mp2t_depay_process; + gstrtpbasedepayload_class->process_rtp_packet = gst_rtp_mp2t_depay_process; gstrtpbasedepayload_class->set_caps = gst_rtp_mp2t_depay_setcaps; gobject_class->set_property = gst_rtp_mp2t_depay_set_property; @@ -146,17 +146,15 @@ gst_rtp_mp2t_depay_setcaps (GstRTPBaseDepayload * depayload, GstCaps * caps) } static GstBuffer * -gst_rtp_mp2t_depay_process (GstRTPBaseDepayload * depayload, GstBuffer * buf) +gst_rtp_mp2t_depay_process (GstRTPBaseDepayload * depayload, GstRTPBuffer * rtp) { GstRtpMP2TDepay *rtpmp2tdepay; GstBuffer *outbuf; gint payload_len, leftover; - GstRTPBuffer rtp = { NULL }; rtpmp2tdepay = GST_RTP_MP2T_DEPAY (depayload); - gst_rtp_buffer_map (buf, GST_MAP_READ, &rtp); - payload_len = gst_rtp_buffer_get_payload_len (&rtp); + payload_len = gst_rtp_buffer_get_payload_len (rtp); if (G_UNLIKELY (payload_len <= rtpmp2tdepay->skip_first_bytes)) goto empty_packet; @@ -179,10 +177,9 @@ gst_rtp_mp2t_depay_process (GstRTPBaseDepayload * depayload, GstBuffer * buf) } outbuf = - gst_rtp_buffer_get_payload_subbuffer (&rtp, + gst_rtp_buffer_get_payload_subbuffer (rtp, rtpmp2tdepay->skip_first_bytes, payload_len); - gst_rtp_buffer_unmap (&rtp); if (outbuf) GST_DEBUG ("gst_rtp_mp2t_depay_chain: pushing buffer of size %" G_GSIZE_FORMAT, gst_buffer_get_size (outbuf)); @@ -194,7 +191,6 @@ empty_packet: { GST_ELEMENT_WARNING (rtpmp2tdepay, STREAM, DECODE, (NULL), ("Packet was empty")); - gst_rtp_buffer_unmap (&rtp); return NULL; } } |