From c60312c78f9b8e7e28b84968d7ee7f95aa199a8f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?V=C3=ADctor=20Manuel=20J=C3=A1quez=20Leal?= Date: Tue, 12 Jul 2016 20:29:12 +0200 Subject: [PATCH] vaapi: register vaapipostproc only if supported Query the GstVaapiDisplay to know if the driver supports video postprocessing. If does, then register vaapipostproc and vaapidecodebin elements. This patch will simplify the design of vaapidecodebin. https://bugzilla.gnome.org/show_bug.cgi?id=724352 --- gst/vaapi/gstvaapi.c | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/gst/vaapi/gstvaapi.c b/gst/vaapi/gstvaapi.c index 8ec40468a4..079c048530 100644 --- a/gst/vaapi/gstvaapi.c +++ b/gst/vaapi/gstvaapi.c @@ -93,8 +93,14 @@ plugin_init (GstPlugin * plugin) gst_vaapidecode_register (plugin); - gst_element_register (plugin, "vaapipostproc", - GST_RANK_PRIMARY, GST_TYPE_VAAPIPOSTPROC); + if (gst_vaapi_display_has_video_processing (display)) { + gst_element_register (plugin, "vaapipostproc", + GST_RANK_PRIMARY, GST_TYPE_VAAPIPOSTPROC); + + gst_element_register (plugin, "vaapidecodebin", + GST_RANK_PRIMARY + 2, GST_TYPE_VAAPI_DECODE_BIN); + } + gst_element_register (plugin, "vaapisink", GST_RANK_PRIMARY, GST_TYPE_VAAPISINK); #if USE_ENCODERS @@ -120,9 +126,6 @@ plugin_init (GstPlugin * plugin) #endif #endif - gst_element_register (plugin, "vaapidecodebin", - GST_RANK_PRIMARY + 2, GST_TYPE_VAAPI_DECODE_BIN); - gst_vaapi_display_unref (display); return TRUE;