From b8744f5b9acff3b57e0fa6d8654fb15a1bd7c441 Mon Sep 17 00:00:00 2001 From: Gwenole Beauchesne Date: Thu, 15 Jan 2015 16:23:24 +0100 Subject: [PATCH] vaapidecode: commit updated srcpad caps to base plugin. Make sure that the GstVaapiPluginBase instance receives the new src pad caps whenever they get updated from within the GstVaapiDecoder decode routines. This also ensures that downstream elements receive correctly sized SW decoded buffers if needed. https://bugs.tizen.org/jira/browse/TC-114 --- gst/vaapi/gstvaapidecode.c | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/gst/vaapi/gstvaapidecode.c b/gst/vaapi/gstvaapidecode.c index d39e84ea6e..970c35ea40 100644 --- a/gst/vaapi/gstvaapidecode.c +++ b/gst/vaapi/gstvaapidecode.c @@ -115,11 +115,16 @@ gst_vaapi_decoder_state_changed(GstVaapiDecoder *decoder, { GstVaapiDecode * const decode = GST_VAAPIDECODE(user_data); GstVideoDecoder * const vdec = GST_VIDEO_DECODER(decode); + GstVaapiPluginBase * const plugin = GST_VAAPI_PLUGIN_BASE(vdec); g_assert(decode->decoder == decoder); - gst_vaapidecode_update_src_caps(decode, codec_state); - gst_video_decoder_negotiate(vdec); + if (gst_vaapidecode_update_src_caps(decode, codec_state)) { + if (!gst_video_decoder_negotiate(vdec)) + return; + if (!gst_vaapi_plugin_base_set_caps(plugin, NULL, decode->srcpad_caps)) + return; + } } static inline gboolean