vaapidecodebin: delay the bin configuration

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 <victorx.jaquez@intel.com>

https://bugzilla.gnome.org/show_bug.cgi?id=757957
This commit is contained in:
Víctor Manuel Jáquez Leal 2015-11-11 16:33:24 +01:00
parent 8ee23ffd96
commit ce3d1a6203

View file

@ -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: