From af0c2fab0dec98699c43437c91a1fb44c3a691f4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?V=C3=ADctor=20Manuel=20J=C3=A1quez=20Leal?= Date: Thu, 27 Oct 2016 17:13:48 +0200 Subject: [PATCH] vaapidecodebin: resurrect disable-vpp property https://bugzilla.gnome.org/show_bug.cgi?id=773589 --- gst/vaapi/gstvaapidecodebin.c | 32 +++++++++++++++----------------- 1 file changed, 15 insertions(+), 17 deletions(-) diff --git a/gst/vaapi/gstvaapidecodebin.c b/gst/vaapi/gstvaapidecodebin.c index 026ebf024f..dfafc8e676 100644 --- a/gst/vaapi/gstvaapidecodebin.c +++ b/gst/vaapi/gstvaapidecodebin.c @@ -168,19 +168,9 @@ gst_vaapi_decode_bin_set_property (GObject * object, vaapidecbin->deinterlace_method, NULL); break; case PROP_DISABLE_VPP: - { - gboolean disable_vpp; - - disable_vpp = g_value_get_boolean (value); - if (!disable_vpp && !vaapidecbin->has_vpp) - GST_WARNING_OBJECT (vaapidecbin, - "Cannot enable VPP since the VA driver does not support it"); - else - vaapidecbin->disable_vpp = disable_vpp; - /* @TODO: Add run-time disabling support */ + vaapidecbin->disable_vpp = g_value_get_boolean (value); break; - } default: G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec); break; @@ -277,6 +267,12 @@ gst_vaapi_decode_bin_configure (GstVaapiDecodeBin * vaapidecbin) vaapidecbin->decoder = g_object_new (g_type_from_name ("GstVaapiDecode"), NULL); + if (vaapidecbin->disable_vpp) { + gst_bin_add (GST_BIN (vaapidecbin), vaapidecbin->decoder); + pad = gst_element_get_static_pad (vaapidecbin->decoder, "src"); + goto bail; + } + /* create the queue */ vaapidecbin->queue = gst_element_factory_make ("queue", "vaapi-queue"); if (!vaapidecbin->queue) { @@ -303,17 +299,19 @@ gst_vaapi_decode_bin_configure (GstVaapiDecodeBin * vaapidecbin) vaapidecbin->postproc, NULL)) goto error_link_pad; - /* create ghost pad sink */ - pad = gst_element_get_static_pad (GST_ELEMENT (vaapidecbin->decoder), "sink"); - ghostpad = gst_ghost_pad_new_from_template ("sink", pad, + /* create ghost pad src */ + pad = gst_element_get_static_pad (GST_ELEMENT (vaapidecbin->postproc), "src"); + +bail: + ghostpad = gst_ghost_pad_new_from_template ("src", pad, GST_PAD_PAD_TEMPLATE (pad)); gst_object_unref (pad); if (!gst_element_add_pad (GST_ELEMENT (vaapidecbin), ghostpad)) goto error_adding_pad; - /* create ghost pad src */ - pad = gst_element_get_static_pad (GST_ELEMENT (vaapidecbin->postproc), "src"); - ghostpad = gst_ghost_pad_new_from_template ("src", pad, + /* create ghost pad sink */ + pad = gst_element_get_static_pad (GST_ELEMENT (vaapidecbin->decoder), "sink"); + ghostpad = gst_ghost_pad_new_from_template ("sink", pad, GST_PAD_PAD_TEMPLATE (pad)); gst_object_unref (pad); if (!gst_element_add_pad (GST_ELEMENT (vaapidecbin), ghostpad))