From: Vincent Penquerc'h Date: Mon, 15 Oct 2012 11:53:36 +0000 (+0100) Subject: ducatimpeg2dec: add frame reordering X-Git-Tag: glsdk-6_00_00_07~56 X-Git-Url: https://git.ti.com/gitweb?p=glsdk%2Fgst-plugin-ducati.git;a=commitdiff_plain;h=2676123cf454855f3fa60be887bb8fc00300ef7e;ds=sidebyside ducatimpeg2dec: add frame reordering --- diff --git a/src/gstducatimpeg2dec.c b/src/gstducatimpeg2dec.c index f8ae4d6..faf367a 100644 --- a/src/gstducatimpeg2dec.c +++ b/src/gstducatimpeg2dec.c @@ -75,7 +75,7 @@ gst_ducati_mpeg2dec_allocate_params (GstDucatiVidDec * self, gint params_sz, sizeof (IVIDDEC3_OutArgs)); if (ret) - self->params->displayDelay = IVIDDEC3_DISPLAY_DELAY_1; + self->params->displayDelay = IVIDDEC3_DECODE_ORDER; return ret; } @@ -109,6 +109,36 @@ gst_ducati_mpeg2dec_push_input (GstDucatiVidDec * vdec, GstBuffer * buf) return NULL; } +static gboolean +gst_ducati_mpeg2dec_set_sink_caps (GstDucatiVidDec * self, GstCaps * caps) +{ + GstStructure *structure; + const gchar *profile; + + GST_DEBUG_OBJECT (self, "set_sink_caps: %" GST_PTR_FORMAT, caps); + + if (!GST_CALL_PARENT_WITH_DEFAULT (GST_DUCATIVIDDEC_CLASS, set_sink_caps, + (self, caps), TRUE)) + return FALSE; + + /* Simple profile does not have B frames */ + structure = gst_caps_get_structure (caps, 0); + profile = gst_structure_get_string (structure, "profile"); + if (!profile || strcmp (profile, "simple")) { + /* TODO: can a better bound be found from stream headers ? */ + self->backlog_maxframes = MAX_BACKLOG_FRAMES; + } + + return TRUE; +} + +static GstFlowReturn +gst_ducati_mpeg2dec_push_output (GstDucatiVidDec * self, GstBuffer * buf) +{ + GST_BUFFER_OFFSET_END (buf) = GST_BUFFER_TIMESTAMP (buf); + return parent_class->push_output (self, buf); +} + /* GObject vmethod implementations */ static void @@ -135,8 +165,9 @@ gst_ducati_mpeg2dec_class_init (GstDucatiMpeg2DecClass * klass) GST_DEBUG_FUNCPTR (gst_ducati_mpeg2dec_update_buffer_size); bclass->allocate_params = GST_DEBUG_FUNCPTR (gst_ducati_mpeg2dec_allocate_params); - bclass->push_input = - GST_DEBUG_FUNCPTR (gst_ducati_mpeg2dec_push_input); + bclass->push_input = GST_DEBUG_FUNCPTR (gst_ducati_mpeg2dec_push_input); + bclass->set_sink_caps = GST_DEBUG_FUNCPTR (gst_ducati_mpeg2dec_set_sink_caps); + bclass->push_output = GST_DEBUG_FUNCPTR (gst_ducati_mpeg2dec_push_output); } static void