vaapipostproc: Don't create filter on caps query

The problem with this is that creating the filter causes the display to
be selected, and the caps query happens while linking the element. So,
if the downstream or upstream element is using a specific display
object, it won't be propagated correctly to the postproc as it already
has a display at this point.

https://bugzilla.gnome.org/show_bug.cgi?id=747945
This commit is contained in:
Olivier Crete 2015-04-15 15:26:12 -04:00 committed by Víctor Manuel Jáquez Leal
parent 0adb36b658
commit 6f298f6182

View file

@ -224,6 +224,9 @@ gst_vaapipostproc_ensure_filter (GstVaapiPostproc * postproc)
if (!gst_vaapipostproc_ensure_display (postproc)) if (!gst_vaapipostproc_ensure_display (postproc))
return FALSE; return FALSE;
gst_caps_replace (&postproc->allowed_srcpad_caps, NULL);
gst_caps_replace (&postproc->allowed_sinkpad_caps, NULL);
postproc->filter = postproc->filter =
gst_vaapi_filter_new (GST_VAAPI_PLUGIN_BASE_DISPLAY (postproc)); gst_vaapi_filter_new (GST_VAAPI_PLUGIN_BASE_DISPLAY (postproc));
if (!postproc->filter) if (!postproc->filter)
@ -297,7 +300,7 @@ gst_vaapipostproc_start (GstBaseTransform * trans)
ds_reset (&postproc->deinterlace_state); ds_reset (&postproc->deinterlace_state);
if (!gst_vaapi_plugin_base_open (GST_VAAPI_PLUGIN_BASE (postproc))) if (!gst_vaapi_plugin_base_open (GST_VAAPI_PLUGIN_BASE (postproc)))
return FALSE; return FALSE;
if (!gst_vaapipostproc_ensure_display (postproc)) if (!gst_vaapipostproc_ensure_filter (postproc))
return FALSE; return FALSE;
return TRUE; return TRUE;
} }
@ -936,10 +939,8 @@ expand_allowed_srcpad_caps (GstVaapiPostproc * postproc, GstCaps * caps)
{ {
GValue value = G_VALUE_INIT, v_format = G_VALUE_INIT; GValue value = G_VALUE_INIT, v_format = G_VALUE_INIT;
guint i, num_structures; guint i, num_structures;
gboolean had_filter;
had_filter = postproc->filter != NULL; if (postproc->filter == NULL)
if (!had_filter && !gst_vaapipostproc_ensure_filter (postproc))
goto cleanup; goto cleanup;
if (!gst_vaapipostproc_ensure_filter_caps (postproc)) if (!gst_vaapipostproc_ensure_filter_caps (postproc))
goto cleanup; goto cleanup;
@ -967,8 +968,6 @@ expand_allowed_srcpad_caps (GstVaapiPostproc * postproc, GstCaps * caps)
g_value_unset (&value); g_value_unset (&value);
cleanup: cleanup:
if (!had_filter)
gst_vaapipostproc_destroy_filter (postproc);
return caps; return caps;
} }