2 * Copyright (C) 1999,2000 Erik Walthinsen <omega@cse.ogi.edu>
3 * 2000 Wim Taymans <wtay@chello.be>
4 * 2004 Thomas Vander Stichele <thomas@apestaart.org>
6 * gst-inspect.c: tool to inspect the GStreamer registry
8 * This library is free software; you can redistribute it and/or
9 * modify it under the terms of the GNU Library General Public
10 * License as published by the Free Software Foundation; either
11 * version 2 of the License, or (at your option) any later version.
13 * This library is distributed in the hope that it will be useful,
14 * but WITHOUT ANY WARRANTY; without even the implied warranty of
15 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
16 * Library General Public License for more details.
18 * You should have received a copy of the GNU Library General Public
19 * License along with this library; if not, write to the
20 * Free Software Foundation, Inc., 51 Franklin St, Fifth Floor,
21 * Boston, MA 02110-1301, USA.
28 /* FIXME 2.0: suppress warnings for deprecated API such as GValueArray
29 * with newer GLib versions (>= 2.31.0) */
30 #define GLIB_DISABLE_DEPRECATION_WARNINGS
33 #include <gst/gst_private.h> /* for internal Factories */
37 #include <glib/gprintf.h>
39 static char *_name = NULL;
41 static int print_element_info (GstPluginFeature * feature,
42 gboolean print_names);
43 static int print_typefind_info (GstPluginFeature * feature,
44 gboolean print_names);
45 static int print_tracer_info (GstPluginFeature * feature, gboolean print_names);
51 n_print (const char *format, ...)
56 g_print ("%s", _name);
58 va_start (args, format);
59 g_vprintf (format, args);
64 print_field (GQuark field, const GValue * value, gpointer pfx)
66 gchar *str = gst_value_serialize (value);
68 n_print ("%s %15s: %s\n", (gchar *) pfx, g_quark_to_string (field), str);
74 print_caps (const GstCaps * caps, const gchar * pfx)
78 g_return_if_fail (caps != NULL);
80 if (gst_caps_is_any (caps)) {
81 n_print ("%sANY\n", pfx);
84 if (gst_caps_is_empty (caps)) {
85 n_print ("%sEMPTY\n", pfx);
89 for (i = 0; i < gst_caps_get_size (caps); i++) {
90 GstStructure *structure = gst_caps_get_structure (caps, i);
91 GstCapsFeatures *features = gst_caps_get_features (caps, i);
93 if (features && (gst_caps_features_is_any (features) ||
94 !gst_caps_features_is_equal (features,
95 GST_CAPS_FEATURES_MEMORY_SYSTEM_MEMORY))) {
96 gchar *features_string = gst_caps_features_to_string (features);
98 n_print ("%s%s(%s)\n", pfx, gst_structure_get_name (structure),
100 g_free (features_string);
102 n_print ("%s%s\n", pfx, gst_structure_get_name (structure));
104 gst_structure_foreach (structure, print_field, (gpointer) pfx);
109 get_rank_name (char *s, gint rank)
111 static const int ranks[4] = {
112 GST_RANK_NONE, GST_RANK_MARGINAL, GST_RANK_SECONDARY, GST_RANK_PRIMARY
114 static const char *rank_names[4] = { "none", "marginal", "secondary",
121 for (i = 0; i < 4; i++) {
122 if (rank == ranks[i])
123 return rank_names[i];
124 if (abs (rank - ranks[i]) < abs (rank - ranks[best_i])) {
129 sprintf (s, "%s %c %d", rank_names[best_i],
130 (rank - ranks[best_i] > 0) ? '+' : '-', abs (ranks[best_i] - rank));
136 print_factory_details_info (GstElementFactory * factory)
142 rank = gst_plugin_feature_get_rank (GST_PLUGIN_FEATURE (factory));
143 n_print ("Factory Details:\n");
144 n_print (" %-25s%s (%d)\n", "Rank", get_rank_name (s, rank), rank);
146 keys = gst_element_factory_get_metadata_keys (factory);
148 for (k = keys; *k != NULL; ++k) {
152 val = gst_element_factory_get_metadata (factory, key);
153 key[0] = g_ascii_toupper (key[0]);
154 n_print (" %-25s%s\n", key, val);
162 print_hierarchy (GType type, gint level, gint * maxlevel)
167 parent = g_type_parent (type);
169 *maxlevel = *maxlevel + 1;
173 print_hierarchy (parent, level, maxlevel);
176 g_print ("%s", _name);
178 for (i = 1; i < *maxlevel - level; i++)
180 if (*maxlevel - level)
183 g_print ("%s\n", g_type_name (type));
190 print_interfaces (GType type)
193 GType *iface, *ifaces = g_type_interfaces (type, &n_ifaces);
198 g_print ("%s", _name);
199 g_print (_("Implemented Interfaces:\n"));
203 g_print ("%s", _name);
204 g_print (" %s\n", g_type_name (*iface));
208 g_print ("%s", _name);
216 flags_to_string (GFlagsValue * vals, guint flags)
221 /* first look for an exact match and count the number of values */
222 for (i = 0; vals[i].value_name != NULL; ++i) {
223 if (vals[i].value == flags)
224 return g_strdup (vals[i].value_nick);
227 s = g_string_new (NULL);
229 /* we assume the values are sorted from lowest to highest value */
233 if (vals[i].value != 0 && (flags_left & vals[i].value) == vals[i].value) {
235 g_string_append_c (s, '+');
236 g_string_append (s, vals[i].value_nick);
237 flags_left -= vals[i].value;
244 g_string_assign (s, "(none)");
246 return g_string_free (s, FALSE);
249 #define KNOWN_PARAM_FLAGS \
250 (G_PARAM_CONSTRUCT | G_PARAM_CONSTRUCT_ONLY | \
251 G_PARAM_LAX_VALIDATION | G_PARAM_STATIC_STRINGS | \
252 G_PARAM_READABLE | G_PARAM_WRITABLE | G_PARAM_DEPRECATED | \
253 GST_PARAM_CONTROLLABLE | GST_PARAM_MUTABLE_PLAYING | \
254 GST_PARAM_MUTABLE_PAUSED | GST_PARAM_MUTABLE_READY)
257 print_element_properties_info (GstElement * element)
259 GParamSpec **property_specs;
260 guint num_properties, i;
264 property_specs = g_object_class_list_properties
265 (G_OBJECT_GET_CLASS (element), &num_properties);
267 n_print ("Element Properties:\n");
269 for (i = 0; i < num_properties; i++) {
270 GValue value = { 0, };
271 GParamSpec *param = property_specs[i];
275 g_value_init (&value, param->value_type);
277 n_print (" %-20s: %s\n", g_param_spec_get_name (param),
278 g_param_spec_get_blurb (param));
281 n_print ("%-23.23s flags: ", "");
282 if (param->flags & G_PARAM_READABLE) {
283 g_object_get_property (G_OBJECT (element), param->name, &value);
285 g_print ("%s%s", (first_flag) ? "" : ", ", _("readable"));
288 /* if we can't read the property value, assume it's set to the default
289 * (which might not be entirely true for sub-classes, but that's an
290 * unlikely corner-case anyway) */
291 g_param_value_set_default (param, &value);
293 if (param->flags & G_PARAM_WRITABLE) {
294 g_print ("%s%s", (first_flag) ? "" : ", ", _("writable"));
297 if (param->flags & G_PARAM_DEPRECATED) {
298 g_print ("%s%s", (first_flag) ? "" : ", ", _("deprecated"));
301 if (param->flags & GST_PARAM_CONTROLLABLE) {
302 g_print (", %s", _("controllable"));
305 if (param->flags & GST_PARAM_MUTABLE_PLAYING) {
306 g_print (", %s", _("changeable in NULL, READY, PAUSED or PLAYING state"));
307 } else if (param->flags & GST_PARAM_MUTABLE_PAUSED) {
308 g_print (", %s", _("changeable only in NULL, READY or PAUSED state"));
309 } else if (param->flags & GST_PARAM_MUTABLE_READY) {
310 g_print (", %s", _("changeable only in NULL or READY state"));
312 if (param->flags & ~KNOWN_PARAM_FLAGS) {
313 g_print ("%s0x%0x", (first_flag) ? "" : ", ",
314 param->flags & ~KNOWN_PARAM_FLAGS);
318 switch (G_VALUE_TYPE (&value)) {
321 const char *string_val = g_value_get_string (&value);
323 n_print ("%-23.23s String. ", "");
325 if (string_val == NULL)
326 g_print ("Default: null");
328 g_print ("Default: \"%s\"", string_val);
333 gboolean bool_val = g_value_get_boolean (&value);
335 n_print ("%-23.23s Boolean. ", "");
337 g_print ("Default: %s", bool_val ? "true" : "false");
342 GParamSpecULong *pulong = G_PARAM_SPEC_ULONG (param);
344 n_print ("%-23.23s Unsigned Long. ", "");
345 g_print ("Range: %lu - %lu Default: %lu ",
346 pulong->minimum, pulong->maximum, g_value_get_ulong (&value));
348 GST_ERROR ("%s: property '%s' of type ulong: consider changing to "
349 "uint/uint64", GST_OBJECT_NAME (element),
350 g_param_spec_get_name (param));
355 GParamSpecLong *plong = G_PARAM_SPEC_LONG (param);
357 n_print ("%-23.23s Long. ", "");
358 g_print ("Range: %ld - %ld Default: %ld ",
359 plong->minimum, plong->maximum, g_value_get_long (&value));
361 GST_ERROR ("%s: property '%s' of type long: consider changing to "
362 "int/int64", GST_OBJECT_NAME (element),
363 g_param_spec_get_name (param));
368 GParamSpecUInt *puint = G_PARAM_SPEC_UINT (param);
370 n_print ("%-23.23s Unsigned Integer. ", "");
371 g_print ("Range: %u - %u Default: %u ",
372 puint->minimum, puint->maximum, g_value_get_uint (&value));
377 GParamSpecInt *pint = G_PARAM_SPEC_INT (param);
379 n_print ("%-23.23s Integer. ", "");
380 g_print ("Range: %d - %d Default: %d ",
381 pint->minimum, pint->maximum, g_value_get_int (&value));
386 GParamSpecUInt64 *puint64 = G_PARAM_SPEC_UINT64 (param);
388 n_print ("%-23.23s Unsigned Integer64. ", "");
389 g_print ("Range: %" G_GUINT64_FORMAT " - %" G_GUINT64_FORMAT
390 " Default: %" G_GUINT64_FORMAT " ",
391 puint64->minimum, puint64->maximum, g_value_get_uint64 (&value));
396 GParamSpecInt64 *pint64 = G_PARAM_SPEC_INT64 (param);
398 n_print ("%-23.23s Integer64. ", "");
399 g_print ("Range: %" G_GINT64_FORMAT " - %" G_GINT64_FORMAT
400 " Default: %" G_GINT64_FORMAT " ",
401 pint64->minimum, pint64->maximum, g_value_get_int64 (&value));
406 GParamSpecFloat *pfloat = G_PARAM_SPEC_FLOAT (param);
408 n_print ("%-23.23s Float. ", "");
409 g_print ("Range: %15.7g - %15.7g Default: %15.7g ",
410 pfloat->minimum, pfloat->maximum, g_value_get_float (&value));
415 GParamSpecDouble *pdouble = G_PARAM_SPEC_DOUBLE (param);
417 n_print ("%-23.23s Double. ", "");
418 g_print ("Range: %15.7g - %15.7g Default: %15.7g ",
419 pdouble->minimum, pdouble->maximum, g_value_get_double (&value));
424 GST_ERROR ("%s: property '%s' of type char: consider changing to "
425 "int/string", GST_OBJECT_NAME (element),
426 g_param_spec_get_name (param));
429 if (param->value_type == GST_TYPE_CAPS) {
430 const GstCaps *caps = gst_value_get_caps (&value);
433 n_print ("%-23.23s Caps (NULL)", "");
435 print_caps (caps, " ");
437 } else if (G_IS_PARAM_SPEC_ENUM (param)) {
441 const gchar *value_nick = "";
443 values = G_ENUM_CLASS (g_type_class_ref (param->value_type))->values;
444 enum_value = g_value_get_enum (&value);
446 while (values[j].value_name) {
447 if (values[j].value == enum_value)
448 value_nick = values[j].value_nick;
452 n_print ("%-23.23s Enum \"%s\" Default: %d, \"%s\"", "",
453 g_type_name (G_VALUE_TYPE (&value)), enum_value, value_nick);
456 while (values[j].value_name) {
459 g_print ("%s", _name);
460 g_print ("%-23.23s (%d): %-16s - %s", "",
461 values[j].value, values[j].value_nick, values[j].value_name);
464 /* g_type_class_unref (ec); */
465 } else if (G_IS_PARAM_SPEC_FLAGS (param)) {
466 GParamSpecFlags *pflags = G_PARAM_SPEC_FLAGS (param);
470 vals = pflags->flags_class->values;
472 cur = flags_to_string (vals, g_value_get_flags (&value));
474 n_print ("%-23.23s Flags \"%s\" Default: 0x%08x, \"%s\"", "",
475 g_type_name (G_VALUE_TYPE (&value)),
476 g_value_get_flags (&value), cur);
478 while (vals[0].value_name) {
481 g_print ("%s", _name);
482 g_print ("%-23.23s (0x%08x): %-16s - %s", "",
483 vals[0].value, vals[0].value_nick, vals[0].value_name);
488 } else if (G_IS_PARAM_SPEC_OBJECT (param)) {
489 n_print ("%-23.23s Object of type \"%s\"", "",
490 g_type_name (param->value_type));
491 } else if (G_IS_PARAM_SPEC_BOXED (param)) {
492 n_print ("%-23.23s Boxed pointer of type \"%s\"", "",
493 g_type_name (param->value_type));
494 if (param->value_type == GST_TYPE_STRUCTURE) {
495 const GstStructure *s = gst_value_get_structure (&value);
497 gst_structure_foreach (s, print_field,
500 } else if (G_IS_PARAM_SPEC_POINTER (param)) {
501 if (param->value_type != G_TYPE_POINTER) {
502 n_print ("%-23.23s Pointer of type \"%s\".", "",
503 g_type_name (param->value_type));
505 n_print ("%-23.23s Pointer.", "");
507 } else if (param->value_type == G_TYPE_VALUE_ARRAY) {
508 GParamSpecValueArray *pvarray = G_PARAM_SPEC_VALUE_ARRAY (param);
510 if (pvarray->element_spec) {
511 n_print ("%-23.23s Array of GValues of type \"%s\"", "",
512 g_type_name (pvarray->element_spec->value_type));
514 n_print ("%-23.23s Array of GValues", "");
516 } else if (GST_IS_PARAM_SPEC_FRACTION (param)) {
517 GstParamSpecFraction *pfraction = GST_PARAM_SPEC_FRACTION (param);
519 n_print ("%-23.23s Fraction. ", "");
521 g_print ("Range: %d/%d - %d/%d Default: %d/%d ",
522 pfraction->min_num, pfraction->min_den,
523 pfraction->max_num, pfraction->max_den,
524 gst_value_get_fraction_numerator (&value),
525 gst_value_get_fraction_denominator (&value));
526 } else if (param->value_type == GST_TYPE_ARRAY) {
527 GstParamSpecArray *parray = GST_PARAM_SPEC_ARRAY_LIST (param);
529 if (parray->element_spec) {
530 n_print ("%-23.23s GstValueArray of GValues of type \"%s\"", "",
531 g_type_name (parray->element_spec->value_type));
533 n_print ("%-23.23s GstValueArray of GValues", "");
536 n_print ("%-23.23s Unknown type %ld \"%s\"", "",
537 (glong) param->value_type, g_type_name (param->value_type));
542 g_print (" Write only\n");
546 g_value_reset (&value);
548 if (num_properties == 0)
551 g_free (property_specs);
555 print_pad_templates_info (GstElement * element, GstElementFactory * factory)
558 GstStaticPadTemplate *padtemplate;
560 n_print ("Pad Templates:\n");
561 if (gst_element_factory_get_num_pad_templates (factory) == 0) {
566 pads = gst_element_factory_get_static_pad_templates (factory);
568 padtemplate = (GstStaticPadTemplate *) (pads->data);
569 pads = g_list_next (pads);
571 if (padtemplate->direction == GST_PAD_SRC)
572 n_print (" SRC template: '%s'\n", padtemplate->name_template);
573 else if (padtemplate->direction == GST_PAD_SINK)
574 n_print (" SINK template: '%s'\n", padtemplate->name_template);
576 n_print (" UNKNOWN!!! template: '%s'\n", padtemplate->name_template);
578 if (padtemplate->presence == GST_PAD_ALWAYS)
579 n_print (" Availability: Always\n");
580 else if (padtemplate->presence == GST_PAD_SOMETIMES)
581 n_print (" Availability: Sometimes\n");
582 else if (padtemplate->presence == GST_PAD_REQUEST) {
583 n_print (" Availability: On request\n");
585 n_print (" Availability: UNKNOWN!!!\n");
587 if (padtemplate->static_caps.string) {
588 GstCaps *caps = gst_static_caps_get (&padtemplate->static_caps);
590 n_print (" Capabilities:\n");
591 print_caps (caps, " ");
592 gst_caps_unref (caps);
600 print_element_flag_info (GstElement * element)
602 gboolean have_flags = FALSE;
605 n_print ("Element Flags:\n");
608 n_print (" no flags set\n");
610 if (GST_IS_BIN (element)) {
612 n_print ("Bin Flags:\n");
614 n_print (" no flags set\n");
619 print_implementation_info (GstElement * element)
621 GstElementClass *gstelement_class;
623 gstelement_class = GST_ELEMENT_CLASS (G_OBJECT_GET_CLASS (element));
626 n_print ("Element Implementation:\n");
628 n_print (" Has change_state() function: %s\n",
629 GST_DEBUG_FUNCPTR_NAME (gstelement_class->change_state));
633 print_clocking_info (GstElement * element)
635 gboolean requires_clock, provides_clock;
638 GST_OBJECT_FLAG_IS_SET (element, GST_ELEMENT_FLAG_REQUIRE_CLOCK);
640 GST_OBJECT_FLAG_IS_SET (element, GST_ELEMENT_FLAG_PROVIDE_CLOCK);
642 if (!requires_clock && !provides_clock) {
644 n_print ("Element has no clocking capabilities.\n");
649 n_print ("Clocking Interaction:\n");
650 if (requires_clock) {
651 n_print (" element requires a clock\n");
654 if (provides_clock) {
657 clock = gst_element_get_clock (element);
659 n_print (" element provides a clock: %s\n", GST_OBJECT_NAME (clock));
660 gst_object_unref (clock);
662 n_print (" element is supposed to provide a clock but returned NULL\n");
667 print_uri_handler_info (GstElement * element)
669 if (GST_IS_URI_HANDLER (element)) {
670 const gchar *const *uri_protocols;
671 const gchar *uri_type;
673 if (gst_uri_handler_get_uri_type (GST_URI_HANDLER (element)) == GST_URI_SRC)
675 else if (gst_uri_handler_get_uri_type (GST_URI_HANDLER (element)) ==
679 uri_type = "unknown";
681 uri_protocols = gst_uri_handler_get_protocols (GST_URI_HANDLER (element));
684 n_print ("URI handling capabilities:\n");
685 n_print (" Element can act as %s.\n", uri_type);
687 if (uri_protocols && *uri_protocols) {
688 n_print (" Supported URI protocols:\n");
689 for (; *uri_protocols != NULL; uri_protocols++)
690 n_print (" %s\n", *uri_protocols);
692 n_print (" No supported URI protocols\n");
695 n_print ("Element has no URI handling capabilities.\n");
700 print_pad_info (GstElement * element)
708 if (!element->numpads) {
713 pads = element->pads;
718 pad = GST_PAD (pads->data);
719 pads = g_list_next (pads);
721 name = gst_pad_get_name (pad);
722 if (gst_pad_get_direction (pad) == GST_PAD_SRC)
723 n_print (" SRC: '%s'\n", name);
724 else if (gst_pad_get_direction (pad) == GST_PAD_SINK)
725 n_print (" SINK: '%s'\n", name);
727 n_print (" UNKNOWN!!!: '%s'\n", name);
731 if (pad->padtemplate)
732 n_print (" Pad Template: '%s'\n", pad->padtemplate->name_template);
734 caps = gst_pad_get_current_caps (pad);
736 n_print (" Capabilities:\n");
737 print_caps (caps, " ");
738 gst_caps_unref (caps);
744 has_sometimes_template (GstElement * element)
746 GstElementClass *klass = GST_ELEMENT_GET_CLASS (element);
749 for (l = klass->padtemplates; l != NULL; l = l->next) {
750 if (GST_PAD_TEMPLATE (l->data)->presence == GST_PAD_SOMETIMES)
758 gtype_needs_ptr_marker (GType type)
760 if (type == G_TYPE_POINTER)
763 if (G_TYPE_FUNDAMENTAL (type) == G_TYPE_POINTER || G_TYPE_IS_BOXED (type)
764 || G_TYPE_IS_OBJECT (type))
771 print_signal_info (GstElement * element)
773 /* Signals/Actions Block */
777 GSignalQuery *query = NULL;
779 GSList *found_signals, *l;
781 for (k = 0; k < 2; k++) {
782 found_signals = NULL;
784 /* For elements that have sometimes pads, also list a few useful GstElement
785 * signals. Put these first, so element-specific ones come later. */
786 if (k == 0 && has_sometimes_template (element)) {
787 query = g_new0 (GSignalQuery, 1);
788 g_signal_query (g_signal_lookup ("pad-added", GST_TYPE_ELEMENT), query);
789 found_signals = g_slist_append (found_signals, query);
790 query = g_new0 (GSignalQuery, 1);
791 g_signal_query (g_signal_lookup ("pad-removed", GST_TYPE_ELEMENT), query);
792 found_signals = g_slist_append (found_signals, query);
793 query = g_new0 (GSignalQuery, 1);
794 g_signal_query (g_signal_lookup ("no-more-pads", GST_TYPE_ELEMENT),
796 found_signals = g_slist_append (found_signals, query);
799 for (type = G_OBJECT_TYPE (element); type; type = g_type_parent (type)) {
800 if (type == GST_TYPE_ELEMENT || type == GST_TYPE_OBJECT)
803 if (type == GST_TYPE_BIN && G_OBJECT_TYPE (element) != GST_TYPE_BIN)
806 signals = g_signal_list_ids (type, &nsignals);
807 for (i = 0; i < nsignals; i++) {
808 query = g_new0 (GSignalQuery, 1);
809 g_signal_query (signals[i], query);
811 if ((k == 0 && !(query->signal_flags & G_SIGNAL_ACTION)) ||
812 (k == 1 && (query->signal_flags & G_SIGNAL_ACTION)))
813 found_signals = g_slist_append (found_signals, query);
824 n_print ("Element Signals:\n");
826 n_print ("Element Actions:\n");
831 for (l = found_signals; l; l = l->next) {
836 query = (GSignalQuery *) l->data;
837 indent_len = strlen (query->signal_name) +
838 strlen (g_type_name (query->return_type)) + 24;
840 if (gtype_needs_ptr_marker (query->return_type)) {
847 indent = g_new0 (gchar, indent_len + 1);
848 memset (indent, ' ', indent_len);
850 n_print (" \"%s\" : %s %suser_function (%s* object",
851 query->signal_name, g_type_name (query->return_type), pmark,
854 for (j = 0; j < query->n_params; j++) {
855 const gchar *type_name, *asterisk;
857 type_name = g_type_name (query->param_types[j]);
858 asterisk = gtype_needs_ptr_marker (query->param_types[j]) ? "*" : "";
861 n_print ("%s%s%s arg%d", indent, type_name, asterisk, j);
866 n_print ("%sgpointer user_data);\n", indent);
874 g_slist_foreach (found_signals, (GFunc) g_free, NULL);
875 g_slist_free (found_signals);
881 print_children_info (GstElement * element)
885 if (!GST_IS_BIN (element))
888 children = (GList *) GST_BIN (element)->children;
891 n_print ("Children:\n");
895 n_print (" %s\n", GST_ELEMENT_NAME (GST_ELEMENT (children->data)));
896 children = g_list_next (children);
901 print_preset_list (GstElement * element)
903 gchar **presets, **preset;
905 if (!GST_IS_PRESET (element))
908 presets = gst_preset_get_preset_names (GST_PRESET (element));
909 if (presets && *presets) {
911 n_print ("Presets:\n");
912 for (preset = presets; *preset; preset++) {
913 n_print (" \"%s\"\n", *preset);
915 g_strfreev (presets);
920 print_blacklist (void)
922 GList *plugins, *cur;
925 g_print ("%s\n", _("Blacklisted files:"));
927 plugins = gst_registry_get_plugin_list (gst_registry_get ());
928 for (cur = plugins; cur != NULL; cur = g_list_next (cur)) {
929 GstPlugin *plugin = (GstPlugin *) (cur->data);
930 if (GST_OBJECT_FLAG_IS_SET (plugin, GST_PLUGIN_FLAG_BLACKLISTED)) {
931 g_print (" %s\n", gst_plugin_get_name (plugin));
937 g_print (_("Total count: "));
938 g_print (ngettext ("%d blacklisted file", "%d blacklisted files", count),
941 gst_plugin_list_free (plugins);
945 print_typefind_extensions (const gchar * const *extensions)
949 while (extensions[i]) {
950 g_print ("%s%s", i > 0 ? ", " : "", extensions[i]);
956 print_element_list (gboolean print_all, gchar * ftypes)
958 int plugincount = 0, featurecount = 0, blacklistcount = 0;
959 GList *plugins, *orig_plugins;
960 gchar **types = NULL;
965 types = g_strsplit (ftypes, "/", -1);
966 for (i = 0; types[i]; i++)
967 *types[i] = g_ascii_toupper (*types[i]);
971 orig_plugins = plugins = gst_registry_get_plugin_list (gst_registry_get ());
973 GList *features, *orig_features;
976 plugin = (GstPlugin *) (plugins->data);
977 plugins = g_list_next (plugins);
980 if (GST_OBJECT_FLAG_IS_SET (plugin, GST_PLUGIN_FLAG_BLACKLISTED)) {
985 orig_features = features =
986 gst_registry_get_feature_list_by_plugin (gst_registry_get (),
987 gst_plugin_get_name (plugin));
989 GstPluginFeature *feature;
991 if (G_UNLIKELY (features->data == NULL))
993 feature = GST_PLUGIN_FEATURE (features->data);
996 if (GST_IS_ELEMENT_FACTORY (feature)) {
998 GstElementFactory *factory;
1000 factory = GST_ELEMENT_FACTORY (feature);
1003 gboolean all_found = TRUE;
1006 gst_element_factory_get_metadata (factory,
1007 GST_ELEMENT_METADATA_KLASS);
1008 for (i = 0; types[i]; i++) {
1009 if (!strstr (klass, types[i])) {
1019 print_element_info (feature, TRUE);
1021 g_print ("%s: %s: %s\n", gst_plugin_get_name (plugin),
1022 GST_OBJECT_NAME (factory),
1023 gst_element_factory_get_metadata (factory,
1024 GST_ELEMENT_METADATA_LONGNAME));
1025 } else if (GST_IS_TYPE_FIND_FACTORY (feature)) {
1026 GstTypeFindFactory *factory;
1027 const gchar *const *extensions;
1031 factory = GST_TYPE_FIND_FACTORY (feature);
1033 g_print ("%s: %s: ", gst_plugin_get_name (plugin),
1034 gst_plugin_feature_get_name (feature));
1036 extensions = gst_type_find_factory_get_extensions (factory);
1037 if (extensions != NULL) {
1039 print_typefind_extensions (extensions);
1044 g_print ("no extensions\n");
1050 n_print ("%s: %s (%s)\n", gst_plugin_get_name (plugin),
1051 GST_OBJECT_NAME (feature), g_type_name (G_OBJECT_TYPE (feature)));
1055 features = g_list_next (features);
1058 gst_plugin_feature_list_free (orig_features);
1061 gst_plugin_list_free (orig_plugins);
1065 g_print (_("Total count: "));
1066 g_print (ngettext ("%d plugin", "%d plugins", plugincount), plugincount);
1067 if (blacklistcount) {
1069 g_print (ngettext ("%d blacklist entry", "%d blacklist entries",
1070 blacklistcount), blacklistcount);
1071 g_print (" not shown)");
1074 g_print (ngettext ("%d feature", "%d features", featurecount), featurecount);
1079 print_all_uri_handlers (void)
1081 GList *plugins, *p, *features, *f;
1083 plugins = gst_registry_get_plugin_list (gst_registry_get ());
1085 for (p = plugins; p; p = p->next) {
1086 GstPlugin *plugin = (GstPlugin *) (p->data);
1089 gst_registry_get_feature_list_by_plugin (gst_registry_get (),
1090 gst_plugin_get_name (plugin));
1092 for (f = features; f; f = f->next) {
1093 GstPluginFeature *feature = GST_PLUGIN_FEATURE (f->data);
1095 if (GST_IS_ELEMENT_FACTORY (feature)) {
1096 GstElementFactory *factory;
1097 GstElement *element;
1099 factory = GST_ELEMENT_FACTORY (gst_plugin_feature_load (feature));
1101 g_print ("element plugin %s couldn't be loaded\n",
1102 gst_plugin_get_name (plugin));
1106 element = gst_element_factory_create (factory, NULL);
1108 g_print ("couldn't construct element for %s for some reason\n",
1109 GST_OBJECT_NAME (factory));
1110 gst_object_unref (factory);
1114 if (GST_IS_URI_HANDLER (element)) {
1115 const gchar *const *uri_protocols;
1119 switch (gst_uri_handler_get_uri_type (GST_URI_HANDLER (element))) {
1132 gst_uri_handler_get_protocols (GST_URI_HANDLER (element));
1133 joined = g_strjoinv (", ", (gchar **) uri_protocols);
1135 g_print ("%s (%s, rank %u): %s\n",
1136 gst_plugin_feature_get_name (GST_PLUGIN_FEATURE (factory)), dir,
1137 gst_plugin_feature_get_rank (GST_PLUGIN_FEATURE (factory)),
1143 gst_object_unref (element);
1144 gst_object_unref (factory);
1148 gst_plugin_feature_list_free (features);
1151 gst_plugin_list_free (plugins);
1155 print_plugin_info (GstPlugin * plugin)
1157 const gchar *release_date = gst_plugin_get_release_date_string (plugin);
1158 const gchar *filename = gst_plugin_get_filename (plugin);
1160 n_print ("Plugin Details:\n");
1161 n_print (" %-25s%s\n", "Name", gst_plugin_get_name (plugin));
1162 n_print (" %-25s%s\n", "Description", gst_plugin_get_description (plugin));
1163 n_print (" %-25s%s\n", "Filename", (filename != NULL) ? filename : "(null)");
1164 n_print (" %-25s%s\n", "Version", gst_plugin_get_version (plugin));
1165 n_print (" %-25s%s\n", "License", gst_plugin_get_license (plugin));
1166 n_print (" %-25s%s\n", "Source module", gst_plugin_get_source (plugin));
1168 if (release_date != NULL) {
1169 const gchar *tz = "(UTC)";
1172 /* may be: YYYY-MM-DD or YYYY-MM-DDTHH:MMZ */
1173 /* YYYY-MM-DDTHH:MMZ => YYYY-MM-DD HH:MM (UTC) */
1174 str = g_strdup (release_date);
1175 sep = strstr (str, "T");
1178 sep = strstr (sep + 1, "Z");
1184 n_print (" %-25s%s%s\n", "Source release date", str, tz);
1187 n_print (" %-25s%s\n", "Binary package", gst_plugin_get_package (plugin));
1188 n_print (" %-25s%s\n", "Origin URL", gst_plugin_get_origin (plugin));
1193 print_plugin_features (GstPlugin * plugin)
1195 GList *features, *origlist;
1196 gint num_features = 0;
1197 gint num_elements = 0;
1198 gint num_tracers = 0;
1199 gint num_typefinders = 0;
1200 gint num_devproviders = 0;
1203 origlist = features =
1204 gst_registry_get_feature_list_by_plugin (gst_registry_get (),
1205 gst_plugin_get_name (plugin));
1208 GstPluginFeature *feature;
1210 feature = GST_PLUGIN_FEATURE (features->data);
1212 if (GST_IS_ELEMENT_FACTORY (feature)) {
1213 GstElementFactory *factory;
1215 factory = GST_ELEMENT_FACTORY (feature);
1216 n_print (" %s: %s\n", GST_OBJECT_NAME (factory),
1217 gst_element_factory_get_metadata (factory,
1218 GST_ELEMENT_METADATA_LONGNAME));
1220 } else if (GST_IS_TYPE_FIND_FACTORY (feature)) {
1221 GstTypeFindFactory *factory;
1222 const gchar *const *extensions;
1224 factory = GST_TYPE_FIND_FACTORY (feature);
1225 extensions = gst_type_find_factory_get_extensions (factory);
1229 g_print (" %s: %s: ", gst_plugin_get_name (plugin),
1230 gst_plugin_feature_get_name (feature));
1231 while (extensions[i]) {
1232 g_print ("%s%s", i > 0 ? ", " : "", extensions[i]);
1237 g_print (" %s: %s: no extensions\n", gst_plugin_get_name (plugin),
1238 gst_plugin_feature_get_name (feature));
1241 } else if (GST_IS_DEVICE_PROVIDER_FACTORY (feature)) {
1242 GstDeviceProviderFactory *factory;
1244 factory = GST_DEVICE_PROVIDER_FACTORY (feature);
1245 n_print (" %s: %s\n", GST_OBJECT_NAME (factory),
1246 gst_device_provider_factory_get_metadata (factory,
1247 GST_ELEMENT_METADATA_LONGNAME));
1249 } else if (GST_IS_TRACER_FACTORY (feature)) {
1250 n_print (" %s (%s)\n", gst_object_get_name (GST_OBJECT (feature)),
1251 g_type_name (G_OBJECT_TYPE (feature)));
1253 } else if (feature) {
1254 n_print (" %s (%s)\n", gst_object_get_name (GST_OBJECT (feature)),
1255 g_type_name (G_OBJECT_TYPE (feature)));
1259 features = g_list_next (features);
1262 gst_plugin_feature_list_free (origlist);
1265 n_print (" %d features:\n", num_features);
1266 if (num_elements > 0)
1267 n_print (" +-- %d elements\n", num_elements);
1268 if (num_typefinders > 0)
1269 n_print (" +-- %d typefinders\n", num_typefinders);
1270 if (num_devproviders > 0)
1271 n_print (" +-- %d device providers\n", num_devproviders);
1272 if (num_tracers > 0)
1273 n_print (" +-- %d tracers\n", num_tracers);
1275 n_print (" +-- %d other objects\n", num_other);
1281 print_feature_info (const gchar * feature_name, gboolean print_all)
1283 GstPluginFeature *feature;
1284 GstRegistry *registry = gst_registry_get ();
1287 if ((feature = gst_registry_find_feature (registry, feature_name,
1288 GST_TYPE_ELEMENT_FACTORY))) {
1289 ret = print_element_info (feature, print_all);
1292 if ((feature = gst_registry_find_feature (registry, feature_name,
1293 GST_TYPE_TYPE_FIND_FACTORY))) {
1294 ret = print_typefind_info (feature, print_all);
1297 if ((feature = gst_registry_find_feature (registry, feature_name,
1298 GST_TYPE_TRACER_FACTORY))) {
1299 ret = print_tracer_info (feature, print_all);
1303 /* TODO: handle DEVICE_PROVIDER_FACTORY */
1308 gst_object_unref (feature);
1313 print_element_info (GstPluginFeature * feature, gboolean print_names)
1315 GstElementFactory *factory;
1316 GstElement *element;
1320 factory = GST_ELEMENT_FACTORY (gst_plugin_feature_load (feature));
1322 g_print ("element plugin couldn't be loaded\n");
1326 element = gst_element_factory_create (factory, NULL);
1328 gst_object_unref (factory);
1329 g_print ("couldn't construct element for some reason\n");
1334 _name = g_strdup_printf ("%s: ", GST_OBJECT_NAME (factory));
1338 print_factory_details_info (factory);
1340 plugin = gst_plugin_feature_get_plugin (GST_PLUGIN_FEATURE (factory));
1342 print_plugin_info (plugin);
1343 gst_object_unref (plugin);
1346 print_hierarchy (G_OBJECT_TYPE (element), 0, &maxlevel);
1347 print_interfaces (G_OBJECT_TYPE (element));
1349 print_pad_templates_info (element, factory);
1350 print_element_flag_info (element);
1351 print_implementation_info (element);
1352 print_clocking_info (element);
1353 print_uri_handler_info (element);
1354 print_pad_info (element);
1355 print_element_properties_info (element);
1356 print_signal_info (element);
1357 print_children_info (element);
1358 print_preset_list (element);
1360 gst_object_unref (element);
1361 gst_object_unref (factory);
1367 print_typefind_info (GstPluginFeature * feature, gboolean print_names)
1369 GstTypeFindFactory *factory;
1374 const gchar *const *extensions;
1376 factory = GST_TYPE_FIND_FACTORY (gst_plugin_feature_load (feature));
1378 g_print ("typefind plugin couldn't be loaded\n");
1383 _name = g_strdup_printf ("%s: ", GST_OBJECT_NAME (factory));
1387 n_print ("Factory Details:\n");
1388 rank = gst_plugin_feature_get_rank (feature);
1389 n_print (" %-25s%s (%d)\n", "Rank", get_rank_name (s, rank), rank);
1390 n_print (" %-25s%s\n", "Name", GST_OBJECT_NAME (factory));
1391 caps = gst_type_find_factory_get_caps (factory);
1393 gchar *caps_str = gst_caps_to_string (factory->caps);
1395 n_print (" %-25s%s\n", "Caps", caps_str);
1398 extensions = gst_type_find_factory_get_extensions (factory);
1400 n_print (" %-25s", "Extensions");
1401 print_typefind_extensions (extensions);
1406 plugin = gst_plugin_feature_get_plugin (GST_PLUGIN_FEATURE (factory));
1408 print_plugin_info (plugin);
1409 gst_object_unref (plugin);
1412 gst_object_unref (factory);
1418 print_tracer_info (GstPluginFeature * feature, gboolean print_names)
1420 GstTracerFactory *factory;
1425 factory = GST_TRACER_FACTORY (gst_plugin_feature_load (feature));
1427 g_print ("tracer plugin couldn't be loaded\n");
1431 tracer = (GstTracer *) g_object_new (factory->type, NULL);
1433 gst_object_unref (factory);
1434 g_print ("couldn't construct tracer for some reason\n");
1439 _name = g_strdup_printf ("%s: ", GST_OBJECT_NAME (factory));
1443 n_print ("Factory Details:\n");
1444 n_print (" %-25s%s\n", "Name", GST_OBJECT_NAME (factory));
1447 plugin = gst_plugin_feature_get_plugin (GST_PLUGIN_FEATURE (factory));
1449 print_plugin_info (plugin);
1450 gst_object_unref (plugin);
1453 print_hierarchy (G_OBJECT_TYPE (tracer), 0, &maxlevel);
1454 print_interfaces (G_OBJECT_TYPE (tracer));
1456 /* TODO: list what hooks it registers
1457 * - the data is available in gsttracerutils, we need to iterate the
1458 * _priv_tracers hashtable for each probe and then check the list of hooks
1459 * for each probe whether hook->tracer == tracer :/
1462 /* TODO: list what records it emits
1463 * - in class_init tracers can create GstTracerRecord instances
1464 * - those only get logged right now and there is no association with the
1465 * tracer that created them
1466 * - we'd need to add them to GstTracerFactory
1467 * gst_tracer_class_add_record (klass, record);
1468 * - needs work in gstregistrychunks.
1471 gst_object_unref (tracer);
1472 gst_object_unref (factory);
1478 print_plugin_automatic_install_info_codecs (GstElementFactory * factory)
1480 GstPadDirection direction;
1481 const gchar *type_name;
1483 const GList *static_templates, *l;
1484 GstCaps *caps = NULL;
1488 gst_element_factory_get_metadata (factory, GST_ELEMENT_METADATA_KLASS);
1489 g_return_if_fail (klass != NULL);
1491 if (strstr (klass, "Demuxer") ||
1492 strstr (klass, "Decoder") ||
1493 strstr (klass, "Depay") || strstr (klass, "Parser")) {
1494 type_name = "decoder";
1495 direction = GST_PAD_SINK;
1496 } else if (strstr (klass, "Muxer") ||
1497 strstr (klass, "Encoder") || strstr (klass, "Pay")) {
1498 type_name = "encoder";
1499 direction = GST_PAD_SRC;
1504 /* decoder/demuxer sink pads should always be static and there should only
1505 * be one, the same applies to encoders/muxers and source pads */
1506 static_templates = gst_element_factory_get_static_pad_templates (factory);
1507 for (l = static_templates; l != NULL; l = l->next) {
1508 GstStaticPadTemplate *tmpl = NULL;
1510 tmpl = (GstStaticPadTemplate *) l->data;
1511 if (tmpl->direction == direction) {
1512 caps = gst_static_pad_template_get_caps (tmpl);
1518 g_printerr ("Couldn't find static pad template for %s '%s'\n",
1519 type_name, GST_OBJECT_NAME (factory));
1523 caps = gst_caps_make_writable (caps);
1524 num = gst_caps_get_size (caps);
1525 for (i = 0; i < num; ++i) {
1529 s = gst_caps_get_structure (caps, i);
1530 /* remove fields that are almost always just MIN-MAX of some sort
1531 * in order to make the caps look less messy */
1532 gst_structure_remove_field (s, "pixel-aspect-ratio");
1533 gst_structure_remove_field (s, "framerate");
1534 gst_structure_remove_field (s, "channels");
1535 gst_structure_remove_field (s, "width");
1536 gst_structure_remove_field (s, "height");
1537 gst_structure_remove_field (s, "rate");
1538 gst_structure_remove_field (s, "depth");
1539 gst_structure_remove_field (s, "clock-rate");
1540 s_str = gst_structure_to_string (s);
1541 g_print ("%s-%s\n", type_name, s_str);
1544 gst_caps_unref (caps);
1548 print_plugin_automatic_install_info_protocols (GstElementFactory * factory)
1550 const gchar *const *protocols;
1552 protocols = gst_element_factory_get_uri_protocols (factory);
1553 if (protocols != NULL && *protocols != NULL) {
1554 switch (gst_element_factory_get_uri_type (factory)) {
1556 while (*protocols != NULL) {
1557 g_print ("urisink-%s\n", *protocols);
1562 while (*protocols != NULL) {
1563 g_print ("urisource-%s\n", *protocols);
1574 print_plugin_automatic_install_info (GstPlugin * plugin)
1576 GList *features, *l;
1578 /* not interested in typefind factories, only element factories */
1579 features = gst_registry_get_feature_list (gst_registry_get (),
1580 GST_TYPE_ELEMENT_FACTORY);
1582 for (l = features; l != NULL; l = l->next) {
1583 GstPluginFeature *feature;
1584 GstPlugin *feature_plugin;
1586 feature = GST_PLUGIN_FEATURE (l->data);
1588 /* only interested in the ones that are in the plugin we just loaded */
1589 feature_plugin = gst_plugin_feature_get_plugin (feature);
1590 if (feature_plugin == plugin) {
1591 GstElementFactory *factory;
1593 g_print ("element-%s\n", gst_plugin_feature_get_name (feature));
1595 factory = GST_ELEMENT_FACTORY (feature);
1596 print_plugin_automatic_install_info_protocols (factory);
1597 print_plugin_automatic_install_info_codecs (factory);
1600 gst_object_unref (feature_plugin);
1603 g_list_foreach (features, (GFunc) gst_object_unref, NULL);
1604 g_list_free (features);
1608 print_all_plugin_automatic_install_info (void)
1610 GList *plugins, *orig_plugins;
1612 orig_plugins = plugins = gst_registry_get_plugin_list (gst_registry_get ());
1616 plugin = (GstPlugin *) (plugins->data);
1617 plugins = g_list_next (plugins);
1619 print_plugin_automatic_install_info (plugin);
1621 gst_plugin_list_free (orig_plugins);
1625 main (int argc, char *argv[])
1627 gboolean print_all = FALSE;
1628 gboolean do_print_blacklist = FALSE;
1629 gboolean plugin_name = FALSE;
1630 gboolean print_aii = FALSE;
1631 gboolean uri_handlers = FALSE;
1632 gboolean check_exists = FALSE;
1633 gchar *min_version = NULL;
1634 guint minver_maj = GST_VERSION_MAJOR;
1635 guint minver_min = GST_VERSION_MINOR;
1636 guint minver_micro = 0;
1637 gchar *types = NULL;
1638 #ifndef GST_DISABLE_OPTION_PARSING
1639 GOptionEntry options[] = {
1640 {"print-all", 'a', 0, G_OPTION_ARG_NONE, &print_all,
1641 N_("Print all elements"), NULL},
1642 {"print-blacklist", 'b', 0, G_OPTION_ARG_NONE, &do_print_blacklist,
1643 N_("Print list of blacklisted files"), NULL},
1644 {"print-plugin-auto-install-info", '\0', 0, G_OPTION_ARG_NONE, &print_aii,
1645 N_("Print a machine-parsable list of features the specified plugin "
1646 "or all plugins provide.\n "
1647 "Useful in connection with external automatic plugin "
1648 "installation mechanisms"), NULL},
1649 {"plugin", '\0', 0, G_OPTION_ARG_NONE, &plugin_name,
1650 N_("List the plugin contents"), NULL},
1651 {"types", 't', 0, G_OPTION_ARG_STRING, &types,
1652 N_("A slashes ('/') separated list of types of elements (also known "
1653 "as klass) to list. (unordered)"), NULL},
1654 {"exists", '\0', 0, G_OPTION_ARG_NONE, &check_exists,
1655 N_("Check if the specified element or plugin exists"), NULL},
1656 {"atleast-version", '\0', 0, G_OPTION_ARG_STRING, &min_version,
1658 ("When checking if an element or plugin exists, also check that its "
1659 "version is at least the version specified"), NULL},
1660 {"uri-handlers", 'u', 0, G_OPTION_ARG_NONE, &uri_handlers,
1662 ("Print supported URI schemes, with the elements that implement them"),
1664 GST_TOOLS_GOPTION_VERSION,
1667 GOptionContext *ctx;
1671 setlocale (LC_ALL, "");
1674 bindtextdomain (GETTEXT_PACKAGE, LOCALEDIR);
1675 bind_textdomain_codeset (GETTEXT_PACKAGE, "UTF-8");
1676 textdomain (GETTEXT_PACKAGE);
1679 /* avoid glib warnings when inspecting deprecated properties */
1680 g_setenv ("G_ENABLE_DIAGNOSTIC", "0", FALSE);
1682 g_set_prgname ("gst-inspect-" GST_API_VERSION);
1684 #ifndef GST_DISABLE_OPTION_PARSING
1685 ctx = g_option_context_new ("[ELEMENT-NAME | PLUGIN-NAME]");
1686 g_option_context_add_main_entries (ctx, options, GETTEXT_PACKAGE);
1687 g_option_context_add_group (ctx, gst_init_get_option_group ());
1688 if (!g_option_context_parse (ctx, &argc, &argv, &err)) {
1689 g_printerr ("Error initializing: %s\n", err->message);
1690 g_clear_error (&err);
1691 g_option_context_free (ctx);
1694 g_option_context_free (ctx);
1696 gst_init (&argc, &argv);
1699 gst_tools_print_version ();
1701 if (print_all && argc > 1) {
1702 g_printerr ("-a requires no extra arguments\n");
1706 if (uri_handlers && argc > 1) {
1707 g_printerr ("-u requires no extra arguments\n");
1711 /* --atleast-version implies --exists */
1712 if (min_version != NULL) {
1713 if (sscanf (min_version, "%u.%u.%u", &minver_maj, &minver_min,
1714 &minver_micro) < 2) {
1715 g_printerr ("Can't parse version '%s' passed to --atleast-version\n",
1719 check_exists = TRUE;
1726 g_printerr ("--exists requires an extra command line argument\n");
1730 GstPluginFeature *feature;
1732 feature = gst_registry_lookup_feature (gst_registry_get (), argv[1]);
1733 if (feature != NULL && gst_plugin_feature_check_version (feature,
1734 minver_maj, minver_min, minver_micro)) {
1741 gst_object_unref (feature);
1743 /* FIXME: support checking for plugins too */
1744 g_printerr ("Checking for plugins is not supported yet\n");
1751 /* if no arguments, print out list of elements */
1753 print_all_uri_handlers ();
1754 } else if (argc == 1 || print_all) {
1755 if (do_print_blacklist)
1759 print_all_plugin_automatic_install_info ();
1761 print_element_list (print_all, types);
1764 /* else we try to get a factory */
1765 const char *arg = argv[argc - 1];
1769 retval = print_feature_info (arg, print_all);
1772 /* otherwise check if it's a plugin */
1774 GstPlugin *plugin = gst_registry_find_plugin (gst_registry_get (), arg);
1776 /* if there is such a plugin, print out info */
1779 print_plugin_automatic_install_info (plugin);
1781 print_plugin_info (plugin);
1782 print_plugin_features (plugin);
1785 GError *error = NULL;
1787 if (g_file_test (arg, G_FILE_TEST_EXISTS)) {
1788 plugin = gst_plugin_load_file (arg, &error);
1792 print_plugin_automatic_install_info (plugin);
1794 print_plugin_info (plugin);
1795 print_plugin_features (plugin);
1798 g_printerr (_("Could not load plugin file: %s\n"), error->message);
1799 g_clear_error (&error);
1803 g_printerr (_("No such element or plugin '%s'\n"), arg);