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., 59 Temple Place - Suite 330,
21 * Boston, MA 02111-1307, USA.
29 #include <gst/control/control.h>
31 #include "gst/gst-i18n-app.h"
37 print_caps (const GstCaps * caps, const gchar * pfx)
42 s = gst_caps_to_string (caps);
44 tmp = g_strdup_printf ("\n %s", pfx);
45 v = g_strsplit (s, ", ", -1);
47 s = g_strjoinv (tmp, v);
51 tmp = g_strdup_printf ("\n%s", pfx);
52 v = g_strsplit (s, "; ", -1);
54 s = g_strjoinv (tmp, v);
58 g_print ("%s%s\n", pfx, s);
63 print_formats (const GstFormat * formats)
65 while (formats && *formats) {
66 const GstFormatDefinition *definition;
68 definition = gst_format_get_details (*formats);
70 g_print ("\t\t(%d):\t%s (%s)\n", *formats,
71 definition->nick, definition->description);
73 g_print ("\t\t(%d):\tUnknown format\n", *formats);
80 print_query_types (const GstQueryType * types)
82 while (types && *types) {
83 const GstQueryTypeDefinition *definition;
85 definition = gst_query_type_get_details (*types);
87 g_print ("\t\t(%d):\t%s (%s)\n", *types,
88 definition->nick, definition->description);
90 g_print ("\t\t(%d):\tUnknown query format\n", *types);
97 print_event_masks (const GstEventMask * masks)
99 #ifndef GST_DISABLE_ENUMTYPES
103 GFlagsClass *flags_class = NULL;
105 event_type = gst_event_type_get_type ();
106 klass = (GEnumClass *) g_type_class_ref (event_type);
108 while (masks && masks->type) {
110 gint flags = 0, index = 0;
112 switch (masks->type) {
114 flags = masks->flags;
115 event_flags = gst_seek_type_get_type ();
116 flags_class = (GFlagsClass *) g_type_class_ref (event_flags);
122 value = g_enum_get_value (klass, masks->type);
123 g_print ("\t\t%s ", value->value_nick);
129 value = g_flags_get_first_value (flags_class, 1 << index);
132 g_print ("| %s ", value->value_nick);
147 output_hierarchy (GType type, gint level, gint * maxlevel)
152 parent = g_type_parent (type);
154 *maxlevel = *maxlevel + 1;
158 output_hierarchy (parent, level, maxlevel);
160 for (i = 1; i < *maxlevel - level; i++)
162 if (*maxlevel - level)
165 g_print ("%s\n", g_type_name (type));
172 print_element_properties (GstElement * element)
174 GParamSpec **property_specs;
175 gint num_properties, i;
177 const char *string_val;
179 property_specs = g_object_class_list_properties
180 (G_OBJECT_GET_CLASS (element), &num_properties);
181 g_print ("\nElement Properties:\n");
183 for (i = 0; i < num_properties; i++) {
184 GValue value = { 0, };
185 GParamSpec *param = property_specs[i];
189 g_value_init (&value, param->value_type);
190 if (param->flags & G_PARAM_READABLE) {
191 g_object_get_property (G_OBJECT (element), param->name, &value);
195 g_print (" %-20s: %s\n", g_param_spec_get_name (param),
196 g_param_spec_get_blurb (param));
198 switch (G_VALUE_TYPE (&value)) {
200 string_val = g_value_get_string (&value);
201 g_print ("%-23.23s String. ", "");
203 if (string_val == NULL)
204 g_print ("(Default \"\")");
206 g_print ("(Default \"%s\")", g_value_get_string (&value));
210 g_print ("%-23.23s Boolean. ", "");
212 g_print ("(Default %s)",
213 (g_value_get_boolean (&value) ? "true" : "false"));
217 GParamSpecULong *pulong = G_PARAM_SPEC_ULONG (param);
219 g_print ("%-23.23s Unsigned Long. ", "");
221 g_print ("Range: %lu - %lu (Default %lu)",
222 pulong->minimum, pulong->maximum, g_value_get_ulong (&value));
227 GParamSpecLong *plong = G_PARAM_SPEC_LONG (param);
229 g_print ("%-23.23s Long. ", "");
231 g_print ("Range: %ld - %ld (Default %ld)",
232 plong->minimum, plong->maximum, g_value_get_long (&value));
237 GParamSpecUInt *puint = G_PARAM_SPEC_UINT (param);
239 g_print ("%-23.23s Unsigned Integer. ", "");
241 g_print ("Range: %u - %u (Default %u)",
242 puint->minimum, puint->maximum, g_value_get_uint (&value));
247 GParamSpecInt *pint = G_PARAM_SPEC_INT (param);
249 g_print ("%-23.23s Integer. ", "");
251 g_print ("Range: %d - %d (Default %d)",
252 pint->minimum, pint->maximum, g_value_get_int (&value));
257 GParamSpecUInt64 *puint64 = G_PARAM_SPEC_UINT64 (param);
259 g_print ("%-23.23s Unsigned Integer64. ", "");
261 g_print ("Range: %" G_GUINT64_FORMAT " - %"
262 G_GUINT64_FORMAT " (Default %" G_GUINT64_FORMAT ")",
263 puint64->minimum, puint64->maximum, g_value_get_uint64 (&value));
268 GParamSpecInt64 *pint64 = G_PARAM_SPEC_INT64 (param);
270 g_print ("%-23.23s Integer64. ", "");
272 g_print ("Range: %" G_GINT64_FORMAT " - %" G_GINT64_FORMAT
273 " (Default %" G_GINT64_FORMAT ")", pint64->minimum,
274 pint64->maximum, g_value_get_int64 (&value));
279 GParamSpecFloat *pfloat = G_PARAM_SPEC_FLOAT (param);
281 g_print ("%-23.23s Float. Default: %-8.8s %15.7g\n", "", "",
282 g_value_get_float (&value));
283 g_print ("%-23.23s Range: %15.7g - %15.7g", "",
284 pfloat->minimum, pfloat->maximum);
289 GParamSpecDouble *pdouble = G_PARAM_SPEC_DOUBLE (param);
291 g_print ("%-23.23s Double. Default: %-8.8s %15.7g\n", "", "",
292 g_value_get_double (&value));
293 g_print ("%-23.23s Range: %15.7g - %15.7g", "",
294 pdouble->minimum, pdouble->maximum);
298 if (param->value_type == GST_TYPE_URI) {
299 g_print ("%-23.23s URI", "");
301 if (param->value_type == GST_TYPE_CAPS) {
302 const GstCaps *caps = gst_value_get_caps (&value);
305 g_print ("%-23.23s Caps (NULL)", "");
307 print_caps (caps, " ");
309 } else if (G_IS_PARAM_SPEC_ENUM (param)) {
314 values = G_ENUM_CLASS (g_type_class_ref (param->value_type))->values;
315 enum_value = g_value_get_enum (&value);
317 while (values[j].value_name) {
318 if (values[j].value == enum_value)
323 g_print ("%-23.23s Enum \"%s\" (default %d, \"%s\")", "",
324 g_type_name (G_VALUE_TYPE (&value)),
325 enum_value, values[j].value_nick);
328 while (values[j].value_name) {
329 g_print ("\n%-23.23s (%d): \t%s", "",
330 values[j].value, values[j].value_nick);
333 /* g_type_class_unref (ec); */
334 } else if (G_IS_PARAM_SPEC_FLAGS (param)) {
338 GString *flags = NULL;
340 values = G_FLAGS_CLASS (g_type_class_ref (param->value_type))->values;
341 flags_value = g_value_get_flags (&value);
343 while (values[j].value_name) {
344 if (values[j].value & flags_value) {
346 g_string_append_printf (flags, " | %s", values[j].value_nick);
348 flags = g_string_new (values[j].value_nick);
354 g_print ("%-23.23s Flags \"%s\" (default %d, \"%s\")", "",
355 g_type_name (G_VALUE_TYPE (&value)),
356 flags_value, (flags ? flags->str : "(none)"));
359 while (values[j].value_name) {
360 g_print ("\n%-23.23s (%d): \t%s", "",
361 values[j].value, values[j].value_nick);
366 g_string_free (flags, TRUE);
367 } else if (G_IS_PARAM_SPEC_OBJECT (param)) {
368 g_print ("%-23.23s Object of type \"%s\"", "",
369 g_type_name (param->value_type));
371 g_print ("%-23.23s Unknown type %ld \"%s\"", "", param->value_type,
372 g_type_name (param->value_type));
377 g_print (" Write only\n");
381 if (num_properties == 0)
386 get_rank_name (gint rank)
391 case GST_RANK_MARGINAL:
393 case GST_RANK_SECONDARY:
395 case GST_RANK_PRIMARY:
403 print_element_info (GstElementFactory * factory)
406 GstObjectClass *gstobject_class;
407 GstElementClass *gstelement_class;
410 GstPadTemplate *padtemplate;
416 element = gst_element_factory_create (factory, "element");
418 g_print ("couldn't construct element for some reason\n");
422 gstobject_class = GST_OBJECT_CLASS (G_OBJECT_GET_CLASS (element));
423 gstelement_class = GST_ELEMENT_CLASS (G_OBJECT_GET_CLASS (element));
425 g_print ("Factory Details:\n");
426 g_print (" Long name:\t%s\n", factory->details.longname);
427 g_print (" Class:\t%s\n", factory->details.klass);
428 g_print (" Description:\t%s\n", factory->details.description);
429 g_print (" Author(s):\t%s\n", factory->details.author);
430 g_print (" Rank:\t\t%s\n",
431 get_rank_name (GST_PLUGIN_FEATURE (factory)->rank));
434 output_hierarchy (G_OBJECT_TYPE (element), 0, &maxlevel);
436 g_print ("Pad Templates:\n");
437 if (factory->numpadtemplates) {
440 pads = factory->padtemplates;
442 padtemplate = (GstPadTemplate *) (pads->data);
443 pads = g_list_next (pads);
445 if (padtemplate->direction == GST_PAD_SRC)
446 g_print (" SRC template: '%s'\n", padtemplate->name_template);
447 else if (padtemplate->direction == GST_PAD_SINK)
448 g_print (" SINK template: '%s'\n", padtemplate->name_template);
450 g_print (" UNKNOWN!!! template: '%s'\n", padtemplate->name_template);
452 if (padtemplate->presence == GST_PAD_ALWAYS)
453 g_print (" Availability: Always\n");
454 else if (padtemplate->presence == GST_PAD_SOMETIMES)
455 g_print (" Availability: Sometimes\n");
456 else if (padtemplate->presence == GST_PAD_REQUEST) {
457 g_print (" Availability: On request\n");
458 g_print (" Has request_new_pad() function: %s\n",
459 GST_DEBUG_FUNCPTR_NAME (gstelement_class->request_new_pad));
461 g_print (" Availability: UNKNOWN!!!\n");
463 if (padtemplate->caps) {
464 g_print (" Capabilities:\n");
465 print_caps (padtemplate->caps, " ");
475 g_print ("\nElement Flags:\n");
476 if (GST_FLAG_IS_SET (element, GST_ELEMENT_COMPLEX)) {
477 g_print (" GST_ELEMENT_COMPLEX\n");
480 if (GST_FLAG_IS_SET (element, GST_ELEMENT_DECOUPLED)) {
481 g_print (" GST_ELEMENT_DECOUPLED\n");
484 if (GST_FLAG_IS_SET (element, GST_ELEMENT_THREAD_SUGGESTED)) {
485 g_print (" GST_ELEMENT_THREADSUGGESTED\n");
488 if (GST_FLAG_IS_SET (element, GST_ELEMENT_EVENT_AWARE)) {
489 g_print (" GST_ELEMENT_EVENT_AWARE\n");
493 g_print (" no flags set\n");
495 if (GST_IS_BIN (element)) {
496 g_print ("\nBin Flags:\n");
497 if (GST_FLAG_IS_SET (element, GST_BIN_FLAG_MANAGER)) {
498 g_print (" GST_BIN_FLAG_MANAGER\n");
501 if (GST_FLAG_IS_SET (element, GST_BIN_SELF_SCHEDULABLE)) {
502 g_print (" GST_BIN_SELF_SCHEDULABLE\n");
505 if (GST_FLAG_IS_SET (element, GST_BIN_FLAG_PREFER_COTHREADS)) {
506 g_print (" GST_BIN_FLAG_PREFER_COTHREADS\n");
510 g_print (" no flags set\n");
515 g_print ("\nElement Implementation:\n");
517 if (element->loopfunc)
518 g_print (" loopfunc()-based element: %s\n",
519 GST_DEBUG_FUNCPTR_NAME (element->loopfunc));
521 g_print (" No loopfunc(), must be chain-based or not configured yet\n");
523 g_print (" Has change_state() function: %s\n",
524 GST_DEBUG_FUNCPTR_NAME (gstelement_class->change_state));
525 #ifndef GST_DISABLE_LOADSAVE
526 g_print (" Has custom save_thyself() function: %s\n",
527 GST_DEBUG_FUNCPTR_NAME (gstobject_class->save_thyself));
528 g_print (" Has custom restore_thyself() function: %s\n",
529 GST_DEBUG_FUNCPTR_NAME (gstobject_class->restore_thyself));
534 g_print ("\nClocking Interaction:\n");
535 if (gst_element_requires_clock (element)) {
536 g_print (" element requires a clock\n");
539 if (gst_element_provides_clock (element)) {
542 clock = gst_element_get_clock (element);
544 g_print (" element provides a clock: %s\n", GST_OBJECT_NAME (clock));
546 g_print (" element is supposed to provide a clock but returned NULL\n");
552 #ifndef GST_DISABLE_INDEX
553 g_print ("\nIndexing capabilities:\n");
554 if (gst_element_is_indexable (element)) {
555 g_print (" element can do indexing\n");
561 g_print ("\nPads:\n");
562 if (element->numpads) {
565 pads = gst_element_get_pad_list (element);
567 pad = GST_PAD (pads->data);
568 pads = g_list_next (pads);
569 realpad = GST_PAD_REALIZE (pad);
571 if (gst_pad_get_direction (pad) == GST_PAD_SRC)
572 g_print (" SRC: '%s'", gst_pad_get_name (pad));
573 else if (gst_pad_get_direction (pad) == GST_PAD_SINK)
574 g_print (" SINK: '%s'", gst_pad_get_name (pad));
576 g_print (" UNKNOWN!!!: '%s'\n", gst_pad_get_name (pad));
578 if (GST_IS_GHOST_PAD (pad))
579 g_print (", ghost of real pad %s:%s\n", GST_DEBUG_PAD_NAME (realpad));
583 g_print (" Implementation:\n");
584 if (realpad->chainfunc)
585 g_print (" Has chainfunc(): %s\n",
586 GST_DEBUG_FUNCPTR_NAME (realpad->chainfunc));
587 if (realpad->getfunc)
588 g_print (" Has getfunc(): %s\n",
589 GST_DEBUG_FUNCPTR_NAME (realpad->getfunc));
590 if (realpad->formatsfunc != gst_pad_get_formats_default) {
591 g_print (" Supports seeking/conversion/query formats:\n");
592 print_formats (gst_pad_get_formats (GST_PAD (realpad)));
594 if (realpad->convertfunc != gst_pad_convert_default)
595 g_print (" Has custom convertfunc(): %s\n",
596 GST_DEBUG_FUNCPTR_NAME (realpad->convertfunc));
597 if (realpad->eventfunc != gst_pad_event_default)
598 g_print (" Has custom eventfunc(): %s\n",
599 GST_DEBUG_FUNCPTR_NAME (realpad->eventfunc));
600 if (realpad->eventmaskfunc != gst_pad_get_event_masks_default) {
601 g_print (" Provides event masks:\n");
602 print_event_masks (gst_pad_get_event_masks (GST_PAD (realpad)));
604 if (realpad->queryfunc != gst_pad_query_default)
605 g_print (" Has custom queryfunc(): %s\n",
606 GST_DEBUG_FUNCPTR_NAME (realpad->queryfunc));
607 if (realpad->querytypefunc != gst_pad_get_query_types_default) {
608 g_print (" Provides query types:\n");
609 print_query_types (gst_pad_get_query_types (GST_PAD (realpad)));
612 if (realpad->intlinkfunc != gst_pad_get_internal_links_default)
613 g_print (" Has custom intconnfunc(): %s\n",
614 GST_DEBUG_FUNCPTR_NAME (realpad->intlinkfunc));
616 if (realpad->bufferallocfunc)
617 g_print (" Has bufferallocfunc(): %s\n",
618 GST_DEBUG_FUNCPTR_NAME (realpad->bufferallocfunc));
620 if (pad->padtemplate)
621 g_print (" Pad Template: '%s'\n", pad->padtemplate->name_template);
624 g_print (" Capabilities:\n");
625 print_caps (realpad->caps, " ");
631 print_element_properties (element);
633 /* Dynamic Parameters block */
635 GstDParamManager *dpman;
639 g_print ("\nDynamic Parameters:\n");
640 if ((dpman = gst_dpman_get_manager (element))) {
641 specs = gst_dpman_list_dparam_specs (dpman);
642 for (x = 0; specs[x] != NULL; x++) {
643 g_print (" %-20.20s: ", g_param_spec_get_name (specs[x]));
645 switch (G_PARAM_SPEC_VALUE_TYPE (specs[x])) {
647 g_print ("64 Bit Integer (Default %" G_GINT64_FORMAT ", Range %"
648 G_GINT64_FORMAT " -> %" G_GINT64_FORMAT ")",
649 ((GParamSpecInt64 *) specs[x])->default_value,
650 ((GParamSpecInt64 *) specs[x])->minimum,
651 ((GParamSpecInt64 *) specs[x])->maximum);
654 g_print ("Integer (Default %d, Range %d -> %d)",
655 ((GParamSpecInt *) specs[x])->default_value,
656 ((GParamSpecInt *) specs[x])->minimum,
657 ((GParamSpecInt *) specs[x])->maximum);
660 g_print ("Float. Default: %-8.8s %15.7g\n", "",
661 ((GParamSpecFloat *) specs[x])->default_value);
662 g_print ("%-23.23s Range: %15.7g - %15.7g", "",
663 ((GParamSpecFloat *) specs[x])->minimum,
664 ((GParamSpecFloat *) specs[x])->maximum);
667 g_print ("Double. Default: %-8.8s %15.7g\n", "",
668 ((GParamSpecDouble *) specs[x])->default_value);
669 g_print ("%-23.23s Range: %15.7g - %15.7g", "",
670 ((GParamSpecDouble *) specs[x])->minimum,
671 ((GParamSpecDouble *) specs[x])->maximum);
674 g_print ("unknown %ld", G_PARAM_SPEC_VALUE_TYPE (specs[x]));
684 /* Signals/Actions Block */
692 for (k = 0; k < 2; k++) {
696 g_print ("\nElement Signals:\n");
698 g_print ("\nElement Actions:\n");
700 for (type = G_OBJECT_TYPE (element); type; type = g_type_parent (type)) {
701 signals = g_signal_list_ids (type, &nsignals);
703 for (i = 0; i < nsignals; i++) {
706 const GType *param_types;
709 query = g_new0 (GSignalQuery, 1);
710 g_signal_query (signals[i], query);
712 if ((k == 0 && !(query->signal_flags & G_SIGNAL_ACTION)) ||
713 (k == 1 && (query->signal_flags & G_SIGNAL_ACTION))) {
714 n_params = query->n_params;
715 return_type = query->return_type;
716 param_types = query->param_types;
718 g_print (" \"%s\" :\t %s user_function (%s* object",
719 query->signal_name, g_type_name (return_type),
722 for (j = 0; j < n_params; j++) {
723 g_print (",\n \t\t\t\t%s arg%d", g_type_name (param_types[j]),
727 g_print (",\n \t\t\t\tgpointer user_data);\n");
742 /* for compound elements */
743 if (GST_IS_BIN (element)) {
744 g_print ("\nChildren:\n");
745 children = (GList *) gst_bin_get_list (GST_BIN (element));
750 child = GST_ELEMENT (children->data);
751 children = g_list_next (children);
753 g_print (" %s\n", GST_ELEMENT_NAME (child));
762 print_element_list (void)
766 plugins = gst_registry_pool_plugin_list ();
771 plugin = (GstPlugin *) (plugins->data);
772 plugins = g_list_next (plugins);
774 features = gst_plugin_get_feature_list (plugin);
776 GstPluginFeature *feature;
778 feature = GST_PLUGIN_FEATURE (features->data);
780 if (GST_IS_ELEMENT_FACTORY (feature)) {
781 GstElementFactory *factory;
783 factory = GST_ELEMENT_FACTORY (feature);
784 g_print ("%s: %s: %s\n", plugin->desc.name,
785 GST_PLUGIN_FEATURE_NAME (factory), factory->details.longname);
787 #ifndef GST_DISABLE_INDEX
788 else if (GST_IS_INDEX_FACTORY (feature)) {
789 GstIndexFactory *factory;
791 factory = GST_INDEX_FACTORY (feature);
792 g_print ("%s: %s: %s\n", plugin->desc.name,
793 GST_PLUGIN_FEATURE_NAME (factory), factory->longdesc);
796 else if (GST_IS_TYPE_FIND_FACTORY (feature)) {
797 GstTypeFindFactory *factory;
799 factory = GST_TYPE_FIND_FACTORY (feature);
800 g_print ("%s: %s: ", plugin->desc.name,
801 gst_plugin_feature_get_name (feature));
802 if (factory->extensions) {
805 while (factory->extensions[i]) {
806 g_print ("%s%s", i > 0 ? ", " : "", factory->extensions[i]);
811 g_print ("no extensions\n");
813 } else if (GST_IS_SCHEDULER_FACTORY (feature)) {
814 GstSchedulerFactory *factory;
816 factory = GST_SCHEDULER_FACTORY (feature);
817 g_print ("%s: %s: %s\n", plugin->desc.name,
818 GST_PLUGIN_FEATURE_NAME (factory), factory->longdesc);
820 g_print ("%s: %s (%s)\n", plugin->desc.name,
821 GST_PLUGIN_FEATURE_NAME (feature),
822 g_type_name (G_OBJECT_TYPE (feature)));
825 features = g_list_next (features);
831 print_plugin_info (GstPlugin * plugin)
834 gint num_features = 0;
835 gint num_elements = 0;
837 gint num_schedulers = 0;
838 gint num_indexes = 0;
841 g_print ("Plugin Details:\n");
842 g_print (" Name:\t\t%s\n", plugin->desc.name);
843 g_print (" Description:\t%s\n", plugin->desc.description);
844 g_print (" Filename:\t%s\n", plugin->filename);
845 g_print (" Version:\t%s\n", plugin->desc.version);
846 g_print (" License:\t%s\n", plugin->desc.license);
847 g_print (" Package:\t%s\n", plugin->desc.package);
848 g_print (" Origin URL:\t%s\n", plugin->desc.origin);
851 features = gst_plugin_get_feature_list (plugin);
854 GstPluginFeature *feature;
856 feature = GST_PLUGIN_FEATURE (features->data);
858 if (GST_IS_ELEMENT_FACTORY (feature)) {
859 GstElementFactory *factory;
861 factory = GST_ELEMENT_FACTORY (feature);
862 g_print (" %s: %s\n", GST_OBJECT_NAME (factory),
863 factory->details.longname);
866 #ifndef GST_DISABLE_INDEX
867 else if (GST_IS_INDEX_FACTORY (feature)) {
868 GstIndexFactory *factory;
870 factory = GST_INDEX_FACTORY (feature);
871 g_print (" %s: %s\n", GST_OBJECT_NAME (factory), factory->longdesc);
875 else if (GST_IS_TYPE_FIND_FACTORY (feature)) {
876 GstTypeFindFactory *factory;
878 factory = GST_TYPE_FIND_FACTORY (feature);
879 if (factory->extensions) {
882 g_print ("%s type: ", plugin->desc.name);
883 while (factory->extensions[i]) {
884 g_print ("%s%s", i > 0 ? ", " : "", factory->extensions[i]);
888 g_print ("%s type: N/A\n", plugin->desc.name);
891 } else if (GST_IS_SCHEDULER_FACTORY (feature)) {
892 GstSchedulerFactory *factory;
894 factory = GST_SCHEDULER_FACTORY (feature);
895 g_print (" %s: %s\n", GST_OBJECT_NAME (factory), factory->longdesc);
898 g_print (" %s (%s)\n", gst_object_get_name (GST_OBJECT (feature)),
899 g_type_name (G_OBJECT_TYPE (feature)));
903 features = g_list_next (features);
905 g_print ("\n %d features:\n", num_features);
906 if (num_elements > 0)
907 g_print (" +-- %d elements\n", num_elements);
909 g_print (" +-- %d types\n", num_types);
910 if (num_schedulers > 0)
911 g_print (" +-- %d schedulers\n", num_schedulers);
913 g_print (" +-- %d indexes\n", num_indexes);
915 g_print (" +-- %d other objects\n", num_other);
921 main (int argc, char *argv[])
923 GstElementFactory *factory;
926 struct poptOption options[] = {
927 {"gst-inspect-plugin", 'p', POPT_ARG_STRING | POPT_ARGFLAG_STRIP, NULL, 0,
928 N_("Show plugin details"), NULL},
929 {"gst-inspect-scheduler", 's', POPT_ARG_STRING | POPT_ARGFLAG_STRIP, NULL,
931 N_("Show scheduler details"), NULL},
935 bindtextdomain (GETTEXT_PACKAGE, LOCALEDIR);
936 bind_textdomain_codeset (GETTEXT_PACKAGE, "UTF-8");
937 textdomain (GETTEXT_PACKAGE);
939 gst_init_with_popt_table (&argc, &argv, options);
940 gst_control_init (&argc, &argv);
942 /* if no arguments, print out list of elements */
944 print_element_list ();
946 /* else we try to get a factory */
948 /* first check for help */
949 if (strstr (argv[1], "-help")) {
950 g_print ("Usage: %s\t\t\tList all registered elements\n", argv[0]);
951 g_print (" %s element-name\tShow element details\n", argv[0]);
952 g_print (" %s plugin-name[.so]\tShow information about plugin\n",
957 /* only search for a factory if there's not a '.so' */
958 if (!strstr (argv[1], ".so")) {
959 factory = gst_element_factory_find (argv[1]);
961 /* if there's a factory, print out the info */
963 return print_element_info (factory);
965 GstPluginFeature *feature;
967 /* FIXME implement other pretty print function for these */
968 feature = gst_registry_pool_find_feature (argv[1],
969 GST_TYPE_SCHEDULER_FACTORY);
971 g_print ("%s: a scheduler\n", argv[1]);
974 #ifndef GST_DISABLE_INDEX
975 feature = gst_registry_pool_find_feature (argv[1],
976 GST_TYPE_INDEX_FACTORY);
978 g_print ("%s: an index\n", argv[1]);
982 feature = gst_registry_pool_find_feature (argv[1],
983 GST_TYPE_TYPE_FIND_FACTORY);
985 g_print ("%s: a typefind function\n", argv[1]);
988 #ifndef GST_DISABLE_URI
989 feature = gst_registry_pool_find_feature (argv[1],
990 GST_TYPE_URI_HANDLER);
992 g_print ("%s: an uri handler\n", argv[1]);
999 so = strstr (argv[1], ".so");
1003 /* otherwise assume it's a plugin */
1004 plugin = gst_registry_pool_find_plugin (argv[1]);
1006 /* if there is such a plugin, print out info */
1009 print_plugin_info (plugin);
1012 g_print ("no such element or plugin '%s'\n", argv[1]);