mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2025-04-26 06:54:49 +00:00
gst-inspect: reduce casting back and forth
Refactor the print_element_info() to take a GstPluginFeature. Reduces the need to cast to and from GstElementFactory.
This commit is contained in:
parent
2354c5b152
commit
ef660a21d6
1 changed files with 6 additions and 8 deletions
|
@ -37,7 +37,7 @@
|
||||||
|
|
||||||
static char *_name = NULL;
|
static char *_name = NULL;
|
||||||
|
|
||||||
static int print_element_info (GstElementFactory * factory,
|
static int print_element_info (GstPluginFeature * feature,
|
||||||
gboolean print_names);
|
gboolean print_names);
|
||||||
|
|
||||||
/* *INDENT-OFF* */
|
/* *INDENT-OFF* */
|
||||||
|
@ -1002,7 +1002,7 @@ print_element_list (gboolean print_all, gchar * ftypes)
|
||||||
goto next;
|
goto next;
|
||||||
}
|
}
|
||||||
if (print_all)
|
if (print_all)
|
||||||
print_element_info (factory, TRUE);
|
print_element_info (feature, TRUE);
|
||||||
else
|
else
|
||||||
g_print ("%s: %s: %s\n", gst_plugin_get_name (plugin),
|
g_print ("%s: %s: %s\n", gst_plugin_get_name (plugin),
|
||||||
GST_OBJECT_NAME (factory),
|
GST_OBJECT_NAME (factory),
|
||||||
|
@ -1277,7 +1277,7 @@ print_feature_info (const gchar * feature_name, gboolean print_all)
|
||||||
feature = gst_registry_find_feature (registry, feature_name,
|
feature = gst_registry_find_feature (registry, feature_name,
|
||||||
GST_TYPE_ELEMENT_FACTORY);
|
GST_TYPE_ELEMENT_FACTORY);
|
||||||
if (feature) {
|
if (feature) {
|
||||||
int ret = print_element_info (GST_ELEMENT_FACTORY (feature), print_all);
|
int ret = print_element_info (feature, print_all);
|
||||||
gst_object_unref (feature);
|
gst_object_unref (feature);
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
@ -1301,16 +1301,14 @@ print_feature_info (const gchar * feature_name, gboolean print_all)
|
||||||
}
|
}
|
||||||
|
|
||||||
static int
|
static int
|
||||||
print_element_info (GstElementFactory * factory, gboolean print_names)
|
print_element_info (GstPluginFeature * feature, gboolean print_names)
|
||||||
{
|
{
|
||||||
|
GstElementFactory *factory;
|
||||||
GstElement *element;
|
GstElement *element;
|
||||||
GstPlugin *plugin;
|
GstPlugin *plugin;
|
||||||
gint maxlevel = 0;
|
gint maxlevel = 0;
|
||||||
|
|
||||||
factory =
|
factory = GST_ELEMENT_FACTORY (gst_plugin_feature_load (feature));
|
||||||
GST_ELEMENT_FACTORY (gst_plugin_feature_load (GST_PLUGIN_FEATURE
|
|
||||||
(factory)));
|
|
||||||
|
|
||||||
if (!factory) {
|
if (!factory) {
|
||||||
g_print ("element plugin couldn't be loaded\n");
|
g_print ("element plugin couldn't be loaded\n");
|
||||||
return -1;
|
return -1;
|
||||||
|
|
Loading…
Reference in a new issue