From 0323c816adcfbce4b6b6b893451cb6fd5145f086 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Rafa=C5=82=20Dzi=C4=99giel?= Date: Wed, 1 Sep 2021 17:41:31 +0200 Subject: [PATCH] api: Use GstElementFactoryListType to detect decoders Using simply GST_IS_VIDEO_DECODER is not enough as some special cases like vaapidecodebin are not using decoder base class --- lib/gst/clapper/gstclapper.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/lib/gst/clapper/gstclapper.c b/lib/gst/clapper/gstclapper.c index b5edf4e7..d20f0a5b 100644 --- a/lib/gst/clapper/gstclapper.c +++ b/lib/gst/clapper/gstclapper.c @@ -36,9 +36,7 @@ #include #include #include -#include #include -#include #include #include @@ -3037,9 +3035,11 @@ element_setup_cb (GstElement * playbin, GstElement * element, GstClapper * self) if (plugin_name) { GST_INFO_OBJECT (self, "Plugin setup: %s", plugin_name); - if (GST_IS_VIDEO_DECODER (element)) + if (gst_element_factory_list_is_type (factory, + GST_ELEMENT_FACTORY_TYPE_DECODER | GST_ELEMENT_FACTORY_TYPE_MEDIA_VIDEO)) emit_decoder_changed (self, plugin_name, TRUE); - else if (GST_IS_AUDIO_DECODER (element)) + else if (gst_element_factory_list_is_type (factory, + GST_ELEMENT_FACTORY_TYPE_DECODER | GST_ELEMENT_FACTORY_TYPE_MEDIA_AUDIO)) emit_decoder_changed (self, plugin_name, FALSE); /* TODO: Set plugin props */