From d69f747d0949bc87816bb74ac33135b618296c45 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?V=C3=ADctor=20Manuel=20J=C3=A1quez=20Leal?= Date: Wed, 28 Oct 2015 12:59:02 +0100 Subject: [PATCH] plugins: don't create display at caps query MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Caps query can happen before the element has a bus. The display creation should be should occur on the context negotiation, when the bus is already configured. Then at caps query no display should be created. Instead of force the display creation, we graciously fail the allowed_caps() creation. This change only applies for vaapidecode and vaapisink. The vaapipostroc, as a basetransform descendant, seems to be not affected by this, nor the encoders. Signed-off-by: Víctor Manuel Jáquez Leal https://bugzilla.gnome.org/show_bug.cgi?id=757598 --- gst/vaapi/gstvaapidecode.c | 4 ++-- gst/vaapi/gstvaapisink.c | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/gst/vaapi/gstvaapidecode.c b/gst/vaapi/gstvaapidecode.c index 7bec7b8869..5fc2592b85 100644 --- a/gst/vaapi/gstvaapidecode.c +++ b/gst/vaapi/gstvaapidecode.c @@ -957,7 +957,7 @@ gst_vaapidecode_ensure_allowed_caps (GstVaapiDecode * decode) if (decode->allowed_caps) return TRUE; - if (!gst_vaapidecode_ensure_display (decode)) + if (!GST_VAAPI_PLUGIN_BASE_DISPLAY (decode)) goto error_no_display; profiles = @@ -1001,7 +1001,7 @@ gst_vaapidecode_ensure_allowed_caps (GstVaapiDecode * decode) /* ERRORS */ error_no_display: { - GST_ERROR ("failed to retrieve VA display"); + GST_INFO_OBJECT (decode, "no VA display shared yet"); return FALSE; } error_no_profiles: diff --git a/gst/vaapi/gstvaapisink.c b/gst/vaapi/gstvaapisink.c index 7ff8401241..fd22524227 100644 --- a/gst/vaapi/gstvaapisink.c +++ b/gst/vaapi/gstvaapisink.c @@ -1206,7 +1206,7 @@ gst_vaapisink_get_caps_impl (GstBaseSink * base_sink) if (!out_caps) return NULL; - if (gst_vaapisink_ensure_display (sink)) { + if (GST_VAAPI_PLUGIN_BASE_DISPLAY (sink)) { raw_caps = gst_vaapi_plugin_base_get_allowed_raw_caps (GST_VAAPI_PLUGIN_BASE (sink)); if (raw_caps) { out_caps = gst_caps_make_writable (out_caps);