From 1f4698448a7c5bf1e5c93a55ec2eaf358af9c850 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Rafa=C5=82=20Dzi=C4=99giel?= Date: Tue, 1 Jun 2021 21:57:14 +0200 Subject: [PATCH] Detect used GStreamer plugin names Allows seeing what plugins are used with GST_DEBUG=Clapper:4. This is also needed for yet to come functionality of setting elements props. --- lib/gst/clapper/gstclapper.c | 16 ++++++++++++++-- 1 file changed, 14 insertions(+), 2 deletions(-) diff --git a/lib/gst/clapper/gstclapper.c b/lib/gst/clapper/gstclapper.c index 2992aba0..924eac53 100644 --- a/lib/gst/clapper/gstclapper.c +++ b/lib/gst/clapper/gstclapper.c @@ -2930,9 +2930,21 @@ mute_notify_cb (G_GNUC_UNUSED GObject * obj, G_GNUC_UNUSED GParamSpec * pspec, static void element_setup_cb (GstElement * playbin, GstElement * element, GstClapper * self) { - GParamSpec *prop = g_object_class_find_property (G_OBJECT_GET_CLASS (element), - "user-agent"); + GstElementFactory *factory; + GParamSpec *prop; + factory = gst_element_get_factory (element); + if (factory) { + gchar *plugin_name = gst_object_get_name (GST_OBJECT_CAST (factory)); + if (plugin_name) { + GST_INFO_OBJECT (self, "Plugin setup: %s", plugin_name); + + /* TODO: Set plugin props */ + } + g_free (plugin_name); + } + + prop = g_object_class_find_property (G_OBJECT_GET_CLASS (element), "user-agent"); if (prop && prop->value_type == G_TYPE_STRING) { const gchar *user_agent = "Mozilla/5.0 (X11; Linux x86_64; rv:86.0) Gecko/20100101 Firefox/86.0";