diff options
author | Edward Hervey <bilboed@bilboed.com> | 2009-08-03 19:02:17 +0200 |
---|---|---|
committer | Edward Hervey <bilboed@bilboed.com> | 2009-08-03 21:26:30 +0200 |
commit | 65a2871e90c49d65b0ea10f364d56e8210ac8cb7 (patch) | |
tree | 3cce31cf14214488c22491c8cbfb1e127abb2877 /gst | |
parent | 1743763c0be558e8e5e1aaa2e60b868d0aef2ed4 (diff) |
rtpsv3vdepay: Only output buffers once we're configured.
Diffstat (limited to 'gst')
-rw-r--r-- | gst/rtp/gstrtpsv3vdepay.c | 26 | ||||
-rw-r--r-- | gst/rtp/gstrtpsv3vdepay.h | 2 |
2 files changed, 19 insertions, 9 deletions
diff --git a/gst/rtp/gstrtpsv3vdepay.c b/gst/rtp/gstrtpsv3vdepay.c index eb5abf3e..ae7cf57c 100644 --- a/gst/rtp/gstrtpsv3vdepay.c +++ b/gst/rtp/gstrtpsv3vdepay.c @@ -197,6 +197,10 @@ gst_rtp_sv3v_depay_process (GstBaseRTPDepayload * depayload, GstBuffer * buf) S = (payload[0] & 0x20) == 0x20; E = (payload[0] & 0x10) == 0x10; + GST_DEBUG ("M:%d, C:%d, S:%d, E:%d", M, C, S, E); + + GST_MEMDUMP ("incoming buffer", payload, payload_len); + if (C) { GstCaps *caps; GstBuffer *codec_data; @@ -235,21 +239,25 @@ gst_rtp_sv3v_depay_process (GstBaseRTPDepayload * depayload, GstBuffer * buf) gst_caps_unref (caps); g_value_unset (&value); + rtpsv3vdepay->configured = TRUE; + return NULL; } - /* store data in adapter, stip off 2 bytes header */ - outbuf = gst_rtp_buffer_get_payload_subbuffer (buf, 2, -1); - gst_adapter_push (rtpsv3vdepay->adapter, outbuf); + if (G_LIKELY (rtpsv3vdepay->configured)) { + /* store data in adapter, stip off 2 bytes header */ + outbuf = gst_rtp_buffer_get_payload_subbuffer (buf, 2, -1); + gst_adapter_push (rtpsv3vdepay->adapter, outbuf); - if (M) { - /* frame is completed: push contents of adapter */ - guint avail; + if (M) { + /* frame is completed: push contents of adapter */ + guint avail; - avail = gst_adapter_available (rtpsv3vdepay->adapter); - outbuf = gst_adapter_take_buffer (rtpsv3vdepay->adapter, avail); + avail = gst_adapter_available (rtpsv3vdepay->adapter); + outbuf = gst_adapter_take_buffer (rtpsv3vdepay->adapter, avail); - return outbuf; + return outbuf; + } } } return NULL; diff --git a/gst/rtp/gstrtpsv3vdepay.h b/gst/rtp/gstrtpsv3vdepay.h index a5d54861..cbe5d130 100644 --- a/gst/rtp/gstrtpsv3vdepay.h +++ b/gst/rtp/gstrtpsv3vdepay.h @@ -46,6 +46,8 @@ struct _GstRtpSV3VDepay GstAdapter *adapter; + gboolean configured; + guint16 nextseq; guint width; guint height; |