6 #include <gst/control/control.h>
10 print_prop (GstPropsEntry *prop, gboolean showname, const gchar *pfx)
15 g_print("%s%-20.20s: ", pfx, gst_props_entry_get_name (prop));
19 type = gst_props_entry_get_props_type (prop);
22 case GST_PROPS_INT_TYPE:
25 gst_props_entry_get_int (prop, &val);
26 g_print("Integer: %d\n", val);
29 case GST_PROPS_INT_RANGE_TYPE:
32 gst_props_entry_get_int_range (prop, &min, &max);
33 g_print("Integer range: %d - %d\n", min, max);
36 case GST_PROPS_FLOAT_TYPE:
39 gst_props_entry_get_float (prop, &val);
40 g_print("Float: %g\n", val);
43 case GST_PROPS_FLOAT_RANGE_TYPE:
46 gst_props_entry_get_float_range (prop, &min, &max);
47 g_print("Float range: %g - %g\n", min, max);
50 case GST_PROPS_BOOLEAN_TYPE:
53 gst_props_entry_get_boolean (prop, &val);
54 g_print("Boolean: %s\n", val ? "TRUE" : "FALSE");
57 case GST_PROPS_STRING_TYPE:
60 gst_props_entry_get_string (prop, &val);
61 g_print("String: \"%s\"\n", val);
64 case GST_PROPS_FOURCC_TYPE:
67 gst_props_entry_get_fourcc_int (prop, &val);
68 g_print("FourCC: '%c%c%c%c'\n",
70 (gchar)((val >> 8) & 0xff),
71 (gchar)((val >> 16) & 0xff),
72 (gchar)((val >> 24) & 0xff));
75 case GST_PROPS_LIST_TYPE:
80 gst_props_entry_get_list (prop, &list);
82 longprefix = g_strdup_printf ("%s ", pfx);
84 GstPropsEntry *listentry;
86 listentry = (GstPropsEntry*) (list->data);
87 print_prop (listentry, FALSE, longprefix);
89 list = g_list_next (list);
95 g_print("unknown props %d\n", type);
100 print_props (GstProps *properties, const gchar *pfx)
105 props = properties->properties;
107 prop = (GstPropsEntry*)(props->data);
108 props = g_list_next(props);
110 print_prop(prop,TRUE,pfx);
115 print_caps (GstCaps *caps, const gchar *pfx)
118 g_print ("%s'%s': (%sfixed)\n", pfx, caps->name, (GST_CAPS_IS_FIXED (caps) ? "" : "NOT "));
119 g_print ("%s MIME type: '%s':\n", pfx, gst_caps_get_mime (caps));
121 if (caps->properties) {
122 gchar *prefix = g_strdup_printf ("%s ", pfx);
124 print_props(caps->properties, prefix);
134 print_formats (const GstFormat *formats)
136 while (formats && *formats) {
137 const GstFormatDefinition *definition;
139 definition = gst_format_get_details (*formats);
141 g_print ("\t\t(%d):\t%s (%s)\n", *formats,
142 definition->nick, definition->description);
144 g_print ("\t\t(%d):\tUnknown format\n", *formats);
151 print_query_types (const GstQueryType *types)
153 while (types && *types) {
154 const GstQueryTypeDefinition *definition;
156 definition = gst_query_type_get_details (*types);
158 g_print ("\t\t(%d):\t%s (%s)\n", *types,
159 definition->nick, definition->description);
161 g_print ("\t\t(%d):\tUnknown query format\n", *types);
168 print_event_masks (const GstEventMask *masks)
170 #ifndef GST_DISABLE_ENUMTYPES
174 GFlagsClass *flags_class = NULL;
176 event_type = gst_event_type_get_type();
177 klass = (GEnumClass *) g_type_class_ref (event_type);
179 while (masks && masks->type) {
181 gint flags = 0, index = 0;
183 switch (masks->type) {
185 flags = masks->flags;
186 event_flags = gst_seek_type_get_type ();
187 flags_class = (GFlagsClass *) g_type_class_ref (event_flags);
193 value = g_enum_get_value (klass, masks->type);
194 g_print ("\t\t%s ", value->value_nick);
200 value = g_flags_get_first_value (flags_class, 1 << index);
203 g_print ("| %s ", value->value_nick);
218 output_hierarchy (GType type, gint level, gint *maxlevel)
223 parent = g_type_parent (type);
225 *maxlevel = *maxlevel + 1;
229 output_hierarchy (parent, level, maxlevel);
231 for (i=1; i<*maxlevel-level; i++)
236 g_print ("%s\n", g_type_name (type));
243 print_element_properties (GstElement *element)
245 GParamSpec **property_specs;
246 gint num_properties,i;
248 const char *string_val;
250 property_specs = g_object_class_list_properties
251 (G_OBJECT_GET_CLASS (element), &num_properties);
252 g_print("\nElement Properties:\n");
254 for (i = 0; i < num_properties; i++) {
255 GValue value = { 0, };
256 GParamSpec *param = property_specs[i];
259 g_value_init (&value, param->value_type);
260 if (param->flags & G_PARAM_READABLE) {
261 g_object_get_property (G_OBJECT (element), param->name, &value);
265 g_print(" %-20s: %s\n", g_param_spec_get_name (param),
266 g_param_spec_get_blurb (param));
268 switch (G_VALUE_TYPE (&value)) {
270 string_val = g_value_get_string (&value);
271 g_print ("%-23.23s String. ", "");
273 if (string_val == NULL)
274 g_print ("(Default \"\")");
276 g_print ("(Default \"%s\")", g_value_get_string (&value));
280 g_print ("%-23.23s Boolean. ", "");
281 if (readable) g_print ("(Default %s)", (g_value_get_boolean (&value) ? "true" : "false"));
285 GParamSpecULong *pulong = G_PARAM_SPEC_ULONG (param);
286 g_print("%-23.23s Unsigned Long. ", "");
287 if (readable) g_print("Range: %lu - %lu (Default %lu)",
288 pulong->minimum, pulong->maximum, g_value_get_ulong (&value));
293 GParamSpecLong *plong = G_PARAM_SPEC_LONG (param);
294 g_print("%-23.23s Long. ", "");
295 if (readable) g_print("Range: %ld - %ld (Default %ld)",
296 plong->minimum, plong->maximum, g_value_get_long (&value));
301 GParamSpecUInt *puint = G_PARAM_SPEC_UINT (param);
302 g_print("%-23.23s Unsigned Integer. ", "");
303 if (readable) g_print("Range: %u - %u (Default %u)",
304 puint->minimum, puint->maximum, g_value_get_uint (&value));
309 GParamSpecInt *pint = G_PARAM_SPEC_INT (param);
310 g_print("%-23.23s Integer. ", "");
311 if (readable) g_print("Range: %d - %d (Default %d)",
312 pint->minimum, pint->maximum, g_value_get_int (&value));
317 GParamSpecUInt64 *puint64 = G_PARAM_SPEC_UINT64 (param);
318 g_print("%-23.23s Unsigned Integer64. ", "");
319 if (readable) g_print("Range: %" G_GUINT64_FORMAT " - %"
320 G_GUINT64_FORMAT " (Default %" G_GUINT64_FORMAT ")",
321 puint64->minimum, puint64->maximum,
322 g_value_get_uint64 (&value));
327 GParamSpecInt64 *pint64 = G_PARAM_SPEC_INT64 (param);
328 g_print("%-23.23s Integer64. ", "");
329 if (readable) g_print("Range: %" G_GINT64_FORMAT " - %" G_GINT64_FORMAT " (Default %" G_GINT64_FORMAT ")", pint64->minimum,
330 pint64->maximum, g_value_get_int64 (&value));
335 GParamSpecFloat *pfloat = G_PARAM_SPEC_FLOAT (param);
336 g_print("%-23.23s Float. Default: %-8.8s %15.7g\n", "", "",
337 g_value_get_float (&value));
338 g_print("%-23.23s Range: %15.7g - %15.7g", "",
339 pfloat->minimum, pfloat->maximum);
344 GParamSpecDouble *pdouble = G_PARAM_SPEC_DOUBLE (param);
345 g_print("%-23.23s Double. Default: %-8.8s %15.7g\n", "", "",
346 g_value_get_double (&value));
347 g_print("%-23.23s Range: %15.7g - %15.7g", "",
348 pdouble->minimum, pdouble->maximum);
352 if (param->value_type == GST_TYPE_URI) {
353 g_print("%-23.23s URI", "");
355 if (param->value_type == GST_TYPE_CAPS) {
356 GstCaps *caps = g_value_peek_pointer (&value);
359 g_print("%-23.23s Caps (NULL)", "");
361 print_caps (caps, " ");
364 else if (G_IS_PARAM_SPEC_ENUM (param)) {
369 values = G_ENUM_CLASS (g_type_class_ref (param->value_type))->values;
370 enum_value = g_value_get_enum (&value);
372 while (values[j].value_name) {
373 if (values[j].value == enum_value)
378 g_print ("%-23.23s Enum \"%s\" (default %d, \"%s\")", "",
379 g_type_name (G_VALUE_TYPE (&value)),
380 enum_value, values[j].value_nick);
383 while (values[j].value_name) {
384 g_print("\n%-23.23s (%d): \t%s", "",
385 values[j].value, values[j].value_nick);
388 /* g_type_class_unref (ec); */
390 else if (G_IS_PARAM_SPEC_FLAGS (param)) {
394 GString *flags = NULL;
396 values = G_FLAGS_CLASS (g_type_class_ref (param->value_type))->values;
397 flags_value = g_value_get_flags (&value);
399 while (values[j].value_name) {
400 if (values[j].value & flags_value) {
402 g_string_append_printf (flags, " | %s", values[j].value_nick);
405 flags = g_string_new (values[j].value_nick);
411 g_print("%-23.23s Flags \"%s\" (default %d, \"%s\")", "",
412 g_type_name (G_VALUE_TYPE (&value)),
413 flags_value, (flags ? flags->str : "(none)"));
416 while (values[j].value_name) {
417 g_print("\n%-23.23s (%d): \t%s", "",
418 values[j].value, values[j].value_nick);
423 g_string_free (flags, TRUE);
425 else if (G_IS_PARAM_SPEC_OBJECT (param)) {
426 g_print("%-23.23s Object of type \"%s\"", "",
427 g_type_name(param->value_type));
430 g_print ("%-23.23s Unknown type %ld \"%s\"", "", param->value_type,
431 g_type_name(param->value_type));
436 g_print (" Write only\n");
440 if (num_properties == 0)
445 get_rank_name (gint rank)
450 case GST_RANK_MARGINAL:
452 case GST_RANK_SECONDARY:
454 case GST_RANK_PRIMARY:
462 print_element_info (GstElementFactory *factory)
465 GstObjectClass *gstobject_class;
466 GstElementClass *gstelement_class;
470 GstPadTemplate *padtemplate;
476 element = gst_element_factory_create (factory, "element");
478 g_print ("couldn't construct element for some reason\n");
482 gstobject_class = GST_OBJECT_CLASS (G_OBJECT_GET_CLASS (element));
483 gstelement_class = GST_ELEMENT_CLASS (G_OBJECT_GET_CLASS (element));
485 g_print ("Factory Details:\n");
486 g_print (" Long name:\t%s\n", factory->details.longname);
487 g_print (" Class:\t%s\n", factory->details.klass);
488 g_print (" Description:\t%s\n", factory->details.description);
489 g_print (" Author(s):\t%s\n", factory->details.author);
490 g_print (" Rank:\t\t%s\n", get_rank_name(GST_PLUGIN_FEATURE(factory)->rank));
493 output_hierarchy (G_OBJECT_TYPE (element), 0, &maxlevel);
495 g_print ("Pad Templates:\n");
496 if (factory->numpadtemplates) {
497 pads = factory->padtemplates;
499 padtemplate = (GstPadTemplate*)(pads->data);
500 pads = g_list_next(pads);
502 if (padtemplate->direction == GST_PAD_SRC)
503 g_print (" SRC template: '%s'\n", padtemplate->name_template);
504 else if (padtemplate->direction == GST_PAD_SINK)
505 g_print (" SINK template: '%s'\n", padtemplate->name_template);
507 g_print (" UNKNOWN!!! template: '%s'\n", padtemplate->name_template);
509 if (padtemplate->presence == GST_PAD_ALWAYS)
510 g_print (" Availability: Always\n");
511 else if (padtemplate->presence == GST_PAD_SOMETIMES)
512 g_print (" Availability: Sometimes\n");
513 else if (padtemplate->presence == GST_PAD_REQUEST) {
514 g_print (" Availability: On request\n");
515 g_print (" Has request_new_pad() function: %s\n",
516 GST_DEBUG_FUNCPTR_NAME (gstelement_class->request_new_pad));
519 g_print (" Availability: UNKNOWN!!!\n");
521 if (padtemplate->caps) {
522 g_print (" Capabilities:\n");
523 print_caps (padtemplate->caps, " ");
533 g_print ("\nElement Flags:\n");
534 if (GST_FLAG_IS_SET (element, GST_ELEMENT_COMPLEX)) {
535 g_print (" GST_ELEMENT_COMPLEX\n");
538 if (GST_FLAG_IS_SET (element, GST_ELEMENT_DECOUPLED)) {
539 g_print (" GST_ELEMENT_DECOUPLED\n");
542 if (GST_FLAG_IS_SET (element, GST_ELEMENT_THREAD_SUGGESTED)) {
543 g_print (" GST_ELEMENT_THREADSUGGESTED\n");
546 if (GST_FLAG_IS_SET (element, GST_ELEMENT_EVENT_AWARE)) {
547 g_print(" GST_ELEMENT_EVENT_AWARE\n");
551 g_print(" no flags set\n");
553 if (GST_IS_BIN (element)) {
554 g_print ("\nBin Flags:\n");
555 if (GST_FLAG_IS_SET (element, GST_BIN_FLAG_MANAGER)) {
556 g_print (" GST_BIN_FLAG_MANAGER\n");
559 if (GST_FLAG_IS_SET (element, GST_BIN_SELF_SCHEDULABLE)) {
560 g_print (" GST_BIN_SELF_SCHEDULABLE\n");
563 if (GST_FLAG_IS_SET (element, GST_BIN_FLAG_PREFER_COTHREADS)) {
564 g_print (" GST_BIN_FLAG_PREFER_COTHREADS\n");
568 g_print (" no flags set\n");
573 g_print ("\nElement Implementation:\n");
575 if (element->loopfunc)
576 g_print (" loopfunc()-based element: %s\n",
577 GST_DEBUG_FUNCPTR_NAME (element->loopfunc));
579 g_print (" No loopfunc(), must be chain-based or not configured yet\n");
581 g_print (" Has change_state() function: %s\n",
582 GST_DEBUG_FUNCPTR_NAME (gstelement_class->change_state));
583 #ifndef GST_DISABLE_LOADSAVE
584 g_print (" Has custom save_thyself() function: %s\n",
585 GST_DEBUG_FUNCPTR_NAME (gstobject_class->save_thyself));
586 g_print (" Has custom restore_thyself() function: %s\n",
587 GST_DEBUG_FUNCPTR_NAME (gstobject_class->restore_thyself));
592 g_print ("\nClocking Interaction:\n");
593 if (gst_element_requires_clock (element)) {
594 g_print (" element requires a clock\n");
597 if (gst_element_provides_clock (element)) {
600 clock = gst_element_get_clock (element);
602 g_print (" element provides a clock: %s\n", GST_OBJECT_NAME(clock));
604 g_print (" element is supposed to provide a clock but returned NULL\n");
611 #ifndef GST_DISABLE_INDEX
612 g_print ("\nIndexing capabilities:\n");
613 if (gst_element_is_indexable (element)) {
614 g_print (" element can do indexing\n");
621 g_print ("\nPads:\n");
622 if (element->numpads) {
624 pads = gst_element_get_pad_list (element);
626 pad = GST_PAD (pads->data);
627 pads = g_list_next (pads);
628 realpad = GST_PAD_REALIZE (pad);
630 if (gst_pad_get_direction (pad) == GST_PAD_SRC)
631 g_print (" SRC: '%s'", gst_pad_get_name (pad));
632 else if (gst_pad_get_direction (pad) == GST_PAD_SINK)
633 g_print (" SINK: '%s'", gst_pad_get_name (pad));
635 g_print (" UNKNOWN!!!: '%s'\n", gst_pad_get_name (pad));
637 if (GST_IS_GHOST_PAD (pad))
638 g_print (", ghost of real pad %s:%s\n", GST_DEBUG_PAD_NAME (realpad));
642 g_print (" Implementation:\n");
643 if (realpad->chainfunc)
644 g_print (" Has chainfunc(): %s\n",
645 GST_DEBUG_FUNCPTR_NAME (realpad->chainfunc));
646 if (realpad->getfunc)
647 g_print (" Has getfunc(): %s\n",
648 GST_DEBUG_FUNCPTR_NAME (realpad->getfunc));
649 if (realpad->formatsfunc != gst_pad_get_formats_default) {
650 g_print (" Supports seeking/conversion/query formats:\n");
651 print_formats (gst_pad_get_formats (GST_PAD (realpad)));
653 if (realpad->convertfunc != gst_pad_convert_default)
654 g_print (" Has custom convertfunc(): %s\n",
655 GST_DEBUG_FUNCPTR_NAME (realpad->convertfunc));
656 if (realpad->eventfunc != gst_pad_event_default)
657 g_print (" Has custom eventfunc(): %s\n",
658 GST_DEBUG_FUNCPTR_NAME (realpad->eventfunc));
659 if (realpad->eventmaskfunc != gst_pad_get_event_masks_default) {
660 g_print (" Provides event masks:\n");
661 print_event_masks (gst_pad_get_event_masks (GST_PAD (realpad)));
663 if (realpad->queryfunc != gst_pad_query_default)
664 g_print (" Has custom queryfunc(): %s\n",
665 GST_DEBUG_FUNCPTR_NAME (realpad->queryfunc));
666 if (realpad->querytypefunc != gst_pad_get_query_types_default) {
667 g_print (" Provides query types:\n");
668 print_query_types (gst_pad_get_query_types (GST_PAD (realpad)));
671 if (realpad->intlinkfunc != gst_pad_get_internal_links_default)
672 g_print (" Has custom intconnfunc(): %s\n",
673 GST_DEBUG_FUNCPTR_NAME(realpad->intlinkfunc));
675 if (realpad->bufferpoolfunc)
676 g_print (" Has bufferpoolfunc(): %s\n",
677 GST_DEBUG_FUNCPTR_NAME(realpad->bufferpoolfunc));
679 if (pad->padtemplate)
680 g_print (" Pad Template: '%s'\n",
681 pad->padtemplate->name_template);
684 g_print (" Capabilities:\n");
685 print_caps (realpad->caps, " ");
691 print_element_properties (element);
693 /* Dynamic Parameters block */
695 GstDParamManager* dpman;
699 g_print ("\nDynamic Parameters:\n");
700 if((dpman = gst_dpman_get_manager (element))) {
701 specs = gst_dpman_list_dparam_specs (dpman);
702 for (x = 0; specs[x] != NULL; x++) {
703 g_print (" %-20.20s: ", g_param_spec_get_name (specs[x]));
705 switch (G_PARAM_SPEC_VALUE_TYPE (specs[x])) {
707 g_print ("64 Bit Integer (Default %" G_GINT64_FORMAT ", Range %"
708 G_GINT64_FORMAT " -> %" G_GINT64_FORMAT ")",
709 ((GParamSpecInt64 *) specs[x])->default_value,
710 ((GParamSpecInt64 *) specs[x])->minimum,
711 ((GParamSpecInt64 *) specs[x])->maximum);
714 g_print ("Integer (Default %d, Range %d -> %d)",
715 ((GParamSpecInt *) specs[x])->default_value,
716 ((GParamSpecInt *) specs[x])->minimum,
717 ((GParamSpecInt *) specs[x])->maximum);
720 g_print ("Float. Default: %-8.8s %15.7g\n", "",
721 ((GParamSpecFloat *) specs[x])->default_value);
722 g_print ("%-23.23s Range: %15.7g - %15.7g", "",
723 ((GParamSpecFloat *) specs[x])->minimum,
724 ((GParamSpecFloat *) specs[x])->maximum);
726 default: g_print ("unknown %ld", G_PARAM_SPEC_VALUE_TYPE (specs[x]));
737 /* Signals/Actions Block */
745 for (k = 0; k < 2; k++) {
749 g_print ("\nElement Signals:\n");
751 g_print ("\nElement Actions:\n");
753 for(type = G_OBJECT_TYPE(element); type; type = g_type_parent(type)){
754 signals = g_signal_list_ids (type, &nsignals);
756 for (i = 0; i < nsignals; i++) {
759 const GType *param_types;
762 query = g_new0 (GSignalQuery,1);
763 g_signal_query (signals[i], query);
765 if ((k == 0 && !(query->signal_flags & G_SIGNAL_ACTION)) ||
766 (k == 1 && (query->signal_flags & G_SIGNAL_ACTION))) {
767 n_params = query->n_params;
768 return_type = query->return_type;
769 param_types = query->param_types;
771 g_print (" \"%s\" :\t %s user_function (%s* object",
772 query->signal_name, g_type_name (return_type),
775 for (j = 0; j < n_params; j++) {
776 g_print (",\n \t\t\t\t%s arg%d", g_type_name(param_types[j]), j);
779 g_print (",\n \t\t\t\tgpointer user_data);\n");
789 if (counted == 0) g_print (" none\n");
793 /* for compound elements */
794 if (GST_IS_BIN (element)) {
795 g_print ("\nChildren:\n");
796 children = (GList *) gst_bin_get_list (GST_BIN (element));
801 child = GST_ELEMENT (children->data);
802 children = g_list_next (children);
804 g_print (" %s\n", GST_ELEMENT_NAME (child));
813 print_element_list (void)
817 plugins = gst_registry_pool_plugin_list();
822 plugin = (GstPlugin*)(plugins->data);
823 plugins = g_list_next (plugins);
825 features = gst_plugin_get_feature_list (plugin);
827 GstPluginFeature *feature;
829 feature = GST_PLUGIN_FEATURE (features->data);
831 if (GST_IS_ELEMENT_FACTORY (feature)) {
832 GstElementFactory *factory;
834 factory = GST_ELEMENT_FACTORY (feature);
835 g_print ("%s: %s: %s\n", plugin->desc.name,
836 GST_PLUGIN_FEATURE_NAME (factory) ,factory->details.longname);
838 #ifndef GST_DISABLE_INDEX
839 else if (GST_IS_INDEX_FACTORY (feature)) {
840 GstIndexFactory *factory;
842 factory = GST_INDEX_FACTORY (feature);
843 g_print ("%s: %s: %s\n", plugin->desc.name,
844 GST_PLUGIN_FEATURE_NAME (factory), factory->longdesc);
847 else if (GST_IS_TYPE_FIND_FACTORY (feature)) {
848 GstTypeFindFactory *factory;
850 factory = GST_TYPE_FIND_FACTORY (feature);
851 if (factory->extensions) {
853 g_print ("%s type: ", plugin->desc.name);
854 while (factory->extensions[i]) {
855 g_print ("%s%s", i > 0 ? ", " : "", factory->extensions[i]);
859 g_print ("%s type: N/A\n", plugin->desc.name);
861 else if (GST_IS_SCHEDULER_FACTORY (feature)) {
862 GstSchedulerFactory *factory;
864 factory = GST_SCHEDULER_FACTORY (feature);
865 g_print ("%s: %s: %s\n", plugin->desc.name,
866 GST_PLUGIN_FEATURE_NAME (factory), factory->longdesc);
869 g_print ("%s: %s (%s)\n", plugin->desc.name,
870 GST_PLUGIN_FEATURE_NAME (feature),
871 g_type_name (G_OBJECT_TYPE (feature)));
874 features = g_list_next (features);
880 print_plugin_info (GstPlugin *plugin)
883 gint num_features = 0;
884 gint num_elements = 0;
886 gint num_schedulers = 0;
887 gint num_indexes = 0;
890 g_print ("Plugin Details:\n");
891 g_print (" Name:\t\t%s\n", plugin->desc.name);
892 g_print (" Description:\t%s\n", plugin->desc.description);
893 g_print (" Filename:\t%s\n", plugin->filename);
894 g_print (" Version:\t%s\n", plugin->desc.version);
895 g_print (" License:\t%s\n", plugin->desc.license);
896 g_print (" Copyright:\t%s\n", plugin->desc.copyright);
897 g_print (" Package:\t%s\n", plugin->desc.package);
898 g_print (" Origin URL:\t%s\n", plugin->desc.origin);
901 features = gst_plugin_get_feature_list (plugin);
904 GstPluginFeature *feature;
906 feature = GST_PLUGIN_FEATURE (features->data);
908 if (GST_IS_ELEMENT_FACTORY (feature)) {
909 GstElementFactory *factory;
911 factory = GST_ELEMENT_FACTORY (feature);
912 g_print (" %s: %s\n", GST_OBJECT_NAME (factory),
913 factory->details.longname);
916 #ifndef GST_DISABLE_INDEX
917 else if (GST_IS_INDEX_FACTORY (feature)) {
918 GstIndexFactory *factory;
920 factory = GST_INDEX_FACTORY (feature);
921 g_print (" %s: %s\n", GST_OBJECT_NAME (factory), factory->longdesc);
925 else if (GST_IS_TYPE_FIND_FACTORY (feature)) {
926 GstTypeFindFactory *factory;
928 factory = GST_TYPE_FIND_FACTORY (feature);
929 if (factory->extensions) {
931 g_print ("%s type: ", plugin->desc.name);
932 while (factory->extensions[i]) {
933 g_print ("%s%s", i > 0 ? ", " : "", factory->extensions[i]);
937 g_print ("%s type: N/A\n", plugin->desc.name);
941 else if (GST_IS_SCHEDULER_FACTORY (feature)) {
942 GstSchedulerFactory *factory;
944 factory = GST_SCHEDULER_FACTORY (feature);
945 g_print (" %s: %s\n", GST_OBJECT_NAME (factory), factory->longdesc);
949 g_print (" %s (%s)\n", gst_object_get_name (GST_OBJECT (feature)),
950 g_type_name (G_OBJECT_TYPE (feature)));
954 features = g_list_next (features);
956 g_print ("\n %d features:\n", num_features);
957 if (num_elements > 0)
958 g_print (" +-- %d elements\n", num_elements);
960 g_print (" +-- %d types\n", num_types);
961 if (num_schedulers > 0)
962 g_print (" +-- %d schedulers\n", num_schedulers);
964 g_print (" +-- %d indexes\n", num_indexes);
966 g_print (" +-- %d other objects\n", num_other);
972 main (int argc, char *argv[])
974 GstElementFactory *factory;
977 struct poptOption options[] = {
978 {"gst-inspect-plugin", 'p', POPT_ARG_STRING|POPT_ARGFLAG_STRIP, NULL, 0,
979 "Show plugin details", NULL},
980 {"gst-inspect-scheduler", 's', POPT_ARG_STRING|POPT_ARGFLAG_STRIP, NULL, 0,
981 "Show scheduler details", NULL},
985 gst_init_with_popt_table (&argc, &argv, options);
986 gst_control_init (&argc, &argv);
988 /* if no arguments, print out list of elements */
990 print_element_list();
992 /* else we try to get a factory */
994 /* first check for help */
995 if (strstr (argv[1], "-help")) {
996 g_print ("Usage: %s\t\t\tList all registered elements\n",argv[0]);
997 g_print (" %s element-name\tShow element details\n",argv[0]);
998 g_print (" %s plugin-name[.so]\tShow information about plugin\n",
1003 /* only search for a factory if there's not a '.so' */
1004 if (! strstr (argv[1], ".so")) {
1005 factory = gst_element_factory_find (argv[1]);
1007 /* if there's a factory, print out the info */
1009 return print_element_info (factory);
1011 GstPluginFeature* feature;
1013 /* FIXME implement other pretty print function for these */
1014 feature = gst_registry_pool_find_feature (argv[1],
1015 GST_TYPE_SCHEDULER_FACTORY);
1017 g_print ("%s: a scheduler\n", argv[1]);
1020 #ifndef GST_DISABLE_INDEX
1021 feature = gst_registry_pool_find_feature (argv[1],
1022 GST_TYPE_INDEX_FACTORY);
1024 g_print ("%s: an index\n", argv[1]);
1028 feature = gst_registry_pool_find_feature (argv[1],
1029 GST_TYPE_TYPE_FIND_FACTORY);
1031 g_print ("%s: a typefind function\n", argv[1]);
1034 #ifndef GST_DISABLE_URI
1035 feature = gst_registry_pool_find_feature (argv[1],
1036 GST_TYPE_URI_HANDLER);
1038 g_print ("%s: an uri handler\n", argv[1]);
1045 so = strstr(argv[1],".so");
1049 /* otherwise assume it's a plugin */
1050 plugin = gst_registry_pool_find_plugin (argv[1]);
1052 /* if there is such a plugin, print out info */
1055 print_plugin_info (plugin);
1058 g_print("no such element or plugin '%s'\n", argv[1]);