From 6f298f6182614cfaf9f3d043207ebe8a6141ffaf Mon Sep 17 00:00:00 2001 From: Olivier Crete Date: Wed, 15 Apr 2015 15:26:12 -0400 Subject: [PATCH] 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 --- gst/vaapi/gstvaapipostproc.c | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/gst/vaapi/gstvaapipostproc.c b/gst/vaapi/gstvaapipostproc.c index e1ea5ac..2366338 100644 --- a/gst/vaapi/gstvaapipostproc.c +++ b/gst/vaapi/gstvaapipostproc.c @@ -224,6 +224,9 @@ gst_vaapipostproc_ensure_filter (GstVaapiPostproc * postproc) if (!gst_vaapipostproc_ensure_display (postproc)) return FALSE; + gst_caps_replace (&postproc->allowed_srcpad_caps, NULL); + gst_caps_replace (&postproc->allowed_sinkpad_caps, NULL); + postproc->filter = gst_vaapi_filter_new (GST_VAAPI_PLUGIN_BASE_DISPLAY (postproc)); if (!postproc->filter) @@ -297,7 +300,7 @@ gst_vaapipostproc_start (GstBaseTransform * trans) ds_reset (&postproc->deinterlace_state); if (!gst_vaapi_plugin_base_open (GST_VAAPI_PLUGIN_BASE (postproc))) return FALSE; - if (!gst_vaapipostproc_ensure_display (postproc)) + if (!gst_vaapipostproc_ensure_filter (postproc)) return FALSE; return TRUE; } @@ -936,10 +939,8 @@ expand_allowed_srcpad_caps (GstVaapiPostproc * postproc, GstCaps * caps) { GValue value = G_VALUE_INIT, v_format = G_VALUE_INIT; guint i, num_structures; - gboolean had_filter; - had_filter = postproc->filter != NULL; - if (!had_filter && !gst_vaapipostproc_ensure_filter (postproc)) + if (postproc->filter == NULL) goto cleanup; if (!gst_vaapipostproc_ensure_filter_caps (postproc)) goto cleanup; @@ -967,8 +968,6 @@ expand_allowed_srcpad_caps (GstVaapiPostproc * postproc, GstCaps * caps) g_value_unset (&value); cleanup: - if (!had_filter) - gst_vaapipostproc_destroy_filter (postproc); return caps; } -- 2.7.4