From ce3d1a6203330d6a2110797dc89709605c4c9282 Mon Sep 17 00:00:00 2001 From: =?utf8?q?V=C3=ADctor=20Manuel=20J=C3=A1quez=20Leal?= Date: Wed, 11 Nov 2015 16:33:24 +0100 Subject: [PATCH] vaapidecodebin: delay the bin configuration MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit Delay the bin configuration until changing to READY state. This is because we should add the vaapipostproc element until the vaapidecode has emitted the HAVE_CONTEXT message, so de gst_bin_add() could set the context set to vaapipostproc. Signed-off-by: Víctor Manuel Jáquez Leal https://bugzilla.gnome.org/show_bug.cgi?id=757957 --- gst/vaapi/gstvaapidecodebin.c | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/gst/vaapi/gstvaapidecodebin.c b/gst/vaapi/gstvaapidecodebin.c index 4baec20..edde5c8 100644 --- a/gst/vaapi/gstvaapidecodebin.c +++ b/gst/vaapi/gstvaapidecodebin.c @@ -194,10 +194,16 @@ ensure_vpp (GstVaapiDecodeBin * vaapidecbin) gst_vaapi_display_unref (display); - if (!activate_vpp (vaapidecbin)) + return TRUE; +} + +static gboolean +gst_vaapi_decode_bin_reconfigure (GstVaapiDecodeBin* vaapidecbin) +{ + if (!ensure_vpp (vaapidecbin)) return FALSE; - return TRUE; + return activate_vpp (vaapidecbin); } static void @@ -311,8 +317,6 @@ gst_vaapi_decode_bin_handle_message (GstBin * bin, GstMessage * message) } } - activate_vpp (vaapidecbin); - bail: if (display) gst_vaapi_display_unref (display); @@ -343,7 +347,7 @@ gst_vaapi_decode_bin_change_state (GstElement * element, switch (transition) { case GST_STATE_CHANGE_NULL_TO_READY: - if (!ensure_vpp (vaapidecbin)) + if (!gst_vaapi_decode_bin_reconfigure (vaapidecbin)) return GST_STATE_CHANGE_FAILURE; break; default: -- 2.7.4