From: Vincent Penquerc'h Date: Tue, 17 Jul 2012 11:11:28 +0000 (+0000) Subject: Revert "ducatividdec: perform QoS after feeding the data to the hardware decoder" X-Git-Tag: glsdk-6_00_00_07~95 X-Git-Url: https://git.ti.com/gitweb?p=glsdk%2Fgst-plugin-ducati.git;a=commitdiff_plain;h=c875278e6e30a585b74966f329031b28978a089b Revert "ducatividdec: perform QoS after feeding the data to the hardware decoder" This reverts commit 5fa560d82caf91230fbc04b3768952727e1bd022. It turns out that drop_frame does not in fact drop those frames that are necessary for decoding future frames. --- diff --git a/src/gstducatividdec.c b/src/gstducatividdec.c index 04d23c8..afb3674 100644 --- a/src/gstducatividdec.c +++ b/src/gstducatividdec.c @@ -24,8 +24,6 @@ #include "gstducatividdec.h" #include "gstducatibufferpriv.h" -static gboolean gst_ducati_viddec_do_qos (GstDucatiVidDec * self, GstBuffer * buf); - GST_BOILERPLATE (GstDucatiVidDec, gst_ducati_viddec, GstElement, GST_TYPE_ELEMENT); @@ -301,8 +299,6 @@ codec_process (GstDucatiVidDec * self, gboolean send, gboolean flush, gint i; GstDucatiVidDecClass *klass = GST_DUCATIVIDDEC_GET_CLASS (self); GstFlowReturn ret = GST_FLOW_OK; - gboolean decode; - if (flow_ret) /* never leave flow_ret uninitialized */ *flow_ret = GST_FLOW_OK; @@ -467,13 +463,6 @@ codec_process (GstDucatiVidDec * self, gboolean send, gboolean flush, gst_buffer_set_caps (outbuf, GST_PAD_CAPS (self->srcpad)); } - decode = gst_ducati_viddec_do_qos (self, outbuf); - if (!decode) { - GST_DEBUG_OBJECT (self, "Output buffer too late, dropping"); - gst_buffer_unref (outbuf); - continue; - } - if (self->crop) gst_buffer_set_video_crop (outbuf, self->crop); @@ -888,6 +877,15 @@ gst_ducati_viddec_do_qos (GstDucatiVidDec * self, GstBuffer * buf) GstDucatiVidDecClass *klass = GST_DUCATIVIDDEC_GET_CLASS (self); gint64 diff; + if (self->wait_keyframe) { + if (GST_BUFFER_FLAG_IS_SET (buf, GST_BUFFER_FLAG_DELTA_UNIT)) { + GST_INFO_OBJECT (self, "skipping until the next keyframe"); + return FALSE; + } + + self->wait_keyframe = FALSE; + } + timestamp = GST_BUFFER_TIMESTAMP (buf); if (self->segment.format != GST_FORMAT_TIME || self->qos_earliest_time == GST_CLOCK_TIME_NONE) @@ -942,6 +940,7 @@ gst_ducati_viddec_chain (GstPad * pad, GstBuffer * buf) Int32 err; GstBuffer *outbuf = NULL; GstCaps *outcaps = NULL; + gboolean decode; if (G_UNLIKELY (!self->engine)) { GST_ERROR_OBJECT (self, "no engine"); @@ -952,14 +951,10 @@ gst_ducati_viddec_chain (GstPad * pad, GstBuffer * buf) GST_DEBUG_OBJECT (self, "chain: %" GST_TIME_FORMAT " (%d bytes, flags %d)", GST_TIME_ARGS (ts), GST_BUFFER_SIZE (buf), GST_BUFFER_FLAGS (buf)); - if (self->wait_keyframe) { - if (GST_BUFFER_FLAG_IS_SET (buf, GST_BUFFER_FLAG_DELTA_UNIT)) { - GST_INFO_OBJECT (self, "skipping until the next keyframe"); - gst_buffer_unref (buf); - return GST_FLOW_OK; - } - - self->wait_keyframe = FALSE; + decode = gst_ducati_viddec_do_qos (self, buf); + if (!decode) { + gst_buffer_unref (buf); + return GST_FLOW_OK; } if (!self->need_out_buf)