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 (const GstCaps *caps, const gchar *pfx)
120 g_print ("%s'%s': (%sfixed)\n", pfx, caps->name, (GST_CAPS_IS_FIXED (caps) ? "" : "NOT "));
122 type = gst_type_find_by_id (caps->id);
124 g_print ("%s MIME type: '%s':\n", pfx, type->mime);
126 g_print ("%s MIME type: 'unknown/unknown':\n", pfx);
128 if (caps->properties) {
129 gchar *prefix = g_strdup_printf ("%s ", pfx);
131 print_props(caps->properties, prefix);
141 print_formats (const GstFormat *formats)
143 while (formats && *formats) {
144 const GstFormatDefinition *definition;
146 definition = gst_format_get_details (*formats);
148 g_print ("\t\t(%d):\t%s (%s)\n", *formats,
149 definition->nick, definition->description);
151 g_print ("\t\t(%d):\tUnknown format\n", *formats);
158 print_query_types (const GstQueryType *types)
160 while (types && *types) {
161 const GstQueryTypeDefinition *definition;
163 definition = gst_query_type_get_details (*types);
165 g_print ("\t\t(%d):\t%s (%s)\n", *types,
166 definition->nick, definition->description);
168 g_print ("\t\t(%d):\tUnknown query format\n", *types);
175 print_event_masks (const GstEventMask *masks)
177 #ifndef GST_DISABLE_ENUMTYPES
181 GFlagsClass *flags_class = NULL;
183 event_type = gst_event_type_get_type();
184 klass = (GEnumClass *) g_type_class_ref (event_type);
186 while (masks && masks->type) {
188 gint flags = 0, index = 0;
190 switch (masks->type) {
192 flags = masks->flags;
193 event_flags = gst_seek_type_get_type ();
194 flags_class = (GFlagsClass *) g_type_class_ref (event_flags);
200 value = g_enum_get_value (klass, masks->type);
201 g_print ("\t\t%s ", value->value_nick);
207 value = g_flags_get_first_value (flags_class, 1 << index);
210 g_print ("| %s ", value->value_nick);
225 output_hierarchy (GType type, gint level, gint *maxlevel)
230 parent = g_type_parent (type);
232 *maxlevel = *maxlevel + 1;
236 output_hierarchy (parent, level, maxlevel);
238 for (i=1; i<*maxlevel-level; i++)
243 g_print ("%s\n", g_type_name (type));
250 print_element_properties (GstElement *element)
252 GParamSpec **property_specs;
253 gint num_properties,i;
255 const char *string_val;
257 property_specs = g_object_class_list_properties
258 (G_OBJECT_GET_CLASS (element), &num_properties);
259 g_print("\nElement Arguments:\n");
261 for (i = 0; i < num_properties; i++) {
262 GValue value = { 0, };
263 GParamSpec *param = property_specs[i];
266 g_value_init (&value, param->value_type);
267 if (param->flags & G_PARAM_READABLE) {
268 g_object_get_property (G_OBJECT (element), param->name, &value);
272 g_print(" %-20s: %s\n", g_param_spec_get_name (param),
273 g_param_spec_get_blurb (param));
275 switch (G_VALUE_TYPE (&value)) {
277 string_val = g_value_get_string (&value);
278 g_print ("%-23.23s String. ", "");
280 if (string_val == NULL)
281 g_print ("(Default \"\")");
283 g_print ("(Default \"%s\")", g_value_get_string (&value));
287 g_print ("%-23.23s Boolean. ", "");
288 if (readable) g_print ("(Default %s)", (g_value_get_boolean (&value) ? "true" : "false"));
292 GParamSpecULong *pulong = G_PARAM_SPEC_ULONG (param);
293 g_print("%-23.23s Unsigned Long. ", "");
294 if (readable) g_print("Range: %lu - %lu (Default %lu)",
295 pulong->minimum, pulong->maximum, g_value_get_ulong (&value));
300 GParamSpecLong *plong = G_PARAM_SPEC_LONG (param);
301 g_print("%-23.23s Long. ", "");
302 if (readable) g_print("Range: %ld - %ld (Default %ld)",
303 plong->minimum, plong->maximum, g_value_get_long (&value));
308 GParamSpecUInt *puint = G_PARAM_SPEC_UINT (param);
309 g_print("%-23.23s Unsigned Integer. ", "");
310 if (readable) g_print("Range: %u - %u (Default %u)",
311 puint->minimum, puint->maximum, g_value_get_uint (&value));
316 GParamSpecInt *pint = G_PARAM_SPEC_INT (param);
317 g_print("%-23.23s Integer. ", "");
318 if (readable) g_print("Range: %d - %d (Default %d)",
319 pint->minimum, pint->maximum, g_value_get_int (&value));
324 GParamSpecUInt64 *puint64 = G_PARAM_SPEC_UINT64 (param);
325 g_print("%-23.23s Unsigned Integer64. ", "");
326 if (readable) g_print("Range: %" G_GUINT64_FORMAT " - %"
327 G_GUINT64_FORMAT " (Default %" G_GUINT64_FORMAT ")",
328 puint64->minimum, puint64->maximum,
329 g_value_get_uint64 (&value));
334 GParamSpecInt64 *pint64 = G_PARAM_SPEC_INT64 (param);
335 g_print("%-23.23s Integer64. ", "");
336 if (readable) g_print("Range: %" G_GINT64_FORMAT " - %" G_GINT64_FORMAT " (Default %" G_GINT64_FORMAT ")", pint64->minimum,
337 pint64->maximum, g_value_get_int64 (&value));
342 GParamSpecFloat *pfloat = G_PARAM_SPEC_FLOAT (param);
343 g_print("%-23.23s Float. Default: %-8.8s %15.7g\n", "", "",
344 g_value_get_float (&value));
345 g_print("%-23.23s Range: %15.7g - %15.7g", "",
346 pfloat->minimum, pfloat->maximum);
351 GParamSpecDouble *pdouble = G_PARAM_SPEC_DOUBLE (param);
352 g_print("%-23.23s Double. Default: %-8.8s %15.7g\n", "", "",
353 g_value_get_double (&value));
354 g_print("%-23.23s Range: %15.7g - %15.7g", "",
355 pdouble->minimum, pdouble->maximum);
359 if (param->value_type == GST_TYPE_URI) {
360 g_print("%-23.23s URI", "");
362 if (param->value_type == GST_TYPE_CAPS) {
363 GstCaps *caps = g_value_peek_pointer (&value);
366 g_print("%-23.23s Caps (NULL)", "");
368 print_caps (caps, " ");
371 else if (G_IS_PARAM_SPEC_ENUM (param)) {
376 values = G_ENUM_CLASS (g_type_class_ref (param->value_type))->values;
377 enum_value = g_value_get_enum (&value);
379 while (values[j].value_name) {
380 if (values[j].value == enum_value)
385 g_print ("%-23.23s Enum \"%s\" (default %d, \"%s\")", "",
386 g_type_name (G_VALUE_TYPE (&value)),
387 enum_value, values[j].value_nick);
390 while (values[j].value_name) {
391 g_print("\n%-23.23s (%d): \t%s", "",
392 values[j].value, values[j].value_nick);
395 /* g_type_class_unref (ec); */
397 else if (G_IS_PARAM_SPEC_FLAGS (param)) {
401 GString *flags = NULL;
403 values = G_FLAGS_CLASS (g_type_class_ref (param->value_type))->values;
404 flags_value = g_value_get_flags (&value);
406 while (values[j].value_name) {
407 if (values[j].value & flags_value) {
409 g_string_append_printf (flags, " | %s", values[j].value_nick);
412 flags = g_string_new (values[j].value_nick);
418 g_print("%-23.23s Flags \"%s\" (default %d, \"%s\")", "",
419 g_type_name (G_VALUE_TYPE (&value)),
420 flags_value, (flags ? flags->str : "(none)"));
423 while (values[j].value_name) {
424 g_print("\n%-23.23s (%d): \t%s", "",
425 values[j].value, values[j].value_nick);
430 g_string_free (flags, TRUE);
432 else if (G_IS_PARAM_SPEC_OBJECT (param)) {
433 g_print("%-23.23s Object of type \"%s\"", "",
434 g_type_name(param->value_type));
437 g_print ("%-23.23s Unknown type %ld \"%s\"", "", param->value_type,
438 g_type_name(param->value_type));
443 g_print (" Write only\n");
447 if (num_properties == 0)
452 print_element_info (GstElementFactory *factory)
455 GstObjectClass *gstobject_class;
456 GstElementClass *gstelement_class;
460 GstPadTemplate *padtemplate;
466 element = gst_element_factory_create (factory, "element");
468 g_print ("couldn't construct element for some reason\n");
472 gstobject_class = GST_OBJECT_CLASS (G_OBJECT_GET_CLASS (element));
473 gstelement_class = GST_ELEMENT_CLASS (G_OBJECT_GET_CLASS (element));
475 g_print ("Factory Details:\n");
476 g_print (" Long name:\t%s\n", factory->details->longname);
477 g_print (" Class:\t%s\n", factory->details->klass);
478 g_print (" License:\t%s\n", factory->details->license);
479 g_print (" Description:\t%s\n", factory->details->description);
480 g_print (" Version:\t%s\n", factory->details->version);
481 g_print (" Author(s):\t%s\n", factory->details->author);
482 g_print (" Copyright:\t%s\n", factory->details->copyright);
485 output_hierarchy (G_OBJECT_TYPE (element), 0, &maxlevel);
487 g_print ("Pad Templates:\n");
488 if (factory->numpadtemplates) {
489 pads = factory->padtemplates;
491 padtemplate = (GstPadTemplate*)(pads->data);
492 pads = g_list_next(pads);
494 if (padtemplate->direction == GST_PAD_SRC)
495 g_print (" SRC template: '%s'\n", padtemplate->name_template);
496 else if (padtemplate->direction == GST_PAD_SINK)
497 g_print (" SINK template: '%s'\n", padtemplate->name_template);
499 g_print (" UNKNOWN!!! template: '%s'\n", padtemplate->name_template);
501 if (padtemplate->presence == GST_PAD_ALWAYS)
502 g_print (" Availability: Always\n");
503 else if (padtemplate->presence == GST_PAD_SOMETIMES)
504 g_print (" Availability: Sometimes\n");
505 else if (padtemplate->presence == GST_PAD_REQUEST) {
506 g_print (" Availability: On request\n");
507 g_print (" Has request_new_pad() function: %s\n",
508 GST_DEBUG_FUNCPTR_NAME (gstelement_class->request_new_pad));
511 g_print (" Availability: UNKNOWN!!!\n");
513 if (padtemplate->caps) {
514 g_print (" Capabilities:\n");
515 print_caps (padtemplate->caps, " ");
525 g_print ("\nElement Flags:\n");
526 if (GST_FLAG_IS_SET (element, GST_ELEMENT_COMPLEX)) {
527 g_print (" GST_ELEMENT_COMPLEX\n");
530 if (GST_FLAG_IS_SET (element, GST_ELEMENT_DECOUPLED)) {
531 g_print (" GST_ELEMENT_DECOUPLED\n");
534 if (GST_FLAG_IS_SET (element, GST_ELEMENT_THREAD_SUGGESTED)) {
535 g_print (" GST_ELEMENT_THREADSUGGESTED\n");
538 if (GST_FLAG_IS_SET (element, GST_ELEMENT_EVENT_AWARE)) {
539 g_print(" GST_ELEMENT_EVENT_AWARE\n");
543 g_print(" no flags set\n");
545 if (GST_IS_BIN (element)) {
546 g_print ("\nBin Flags:\n");
547 if (GST_FLAG_IS_SET (element, GST_BIN_FLAG_MANAGER)) {
548 g_print (" GST_BIN_FLAG_MANAGER\n");
551 if (GST_FLAG_IS_SET (element, GST_BIN_SELF_SCHEDULABLE)) {
552 g_print (" GST_BIN_SELF_SCHEDULABLE\n");
555 if (GST_FLAG_IS_SET (element, GST_BIN_FLAG_PREFER_COTHREADS)) {
556 g_print (" GST_BIN_FLAG_PREFER_COTHREADS\n");
560 g_print (" no flags set\n");
565 g_print ("\nElement Implementation:\n");
567 if (element->loopfunc)
568 g_print (" loopfunc()-based element: %s\n",
569 GST_DEBUG_FUNCPTR_NAME (element->loopfunc));
571 g_print (" No loopfunc(), must be chain-based or not configured yet\n");
573 g_print (" Has change_state() function: %s\n",
574 GST_DEBUG_FUNCPTR_NAME (gstelement_class->change_state));
575 #ifndef GST_DISABLE_LOADSAVE
576 g_print (" Has custom save_thyself() function: %s\n",
577 GST_DEBUG_FUNCPTR_NAME (gstobject_class->save_thyself));
578 g_print (" Has custom restore_thyself() function: %s\n",
579 GST_DEBUG_FUNCPTR_NAME (gstobject_class->restore_thyself));
584 g_print ("\nClocking Interaction:\n");
585 if (gst_element_requires_clock (element)) {
586 g_print (" element requires a clock\n");
589 if (gst_element_provides_clock (element)) {
592 clock = gst_element_get_clock (element);
594 g_print (" element provides a clock: %s\n", GST_OBJECT_NAME(clock));
596 g_print (" element is supposed to provide a clock but returned NULL\n");
603 #ifndef GST_DISABLE_INDEX
604 g_print ("\nIndexing capabilities:\n");
605 if (gst_element_is_indexable (element)) {
606 g_print (" element can do indexing\n");
613 g_print ("\nPads:\n");
614 if (element->numpads) {
616 pads = gst_element_get_pad_list (element);
618 pad = GST_PAD (pads->data);
619 pads = g_list_next (pads);
620 realpad = GST_PAD_REALIZE (pad);
622 if (gst_pad_get_direction (pad) == GST_PAD_SRC)
623 g_print (" SRC: '%s'", gst_pad_get_name (pad));
624 else if (gst_pad_get_direction (pad) == GST_PAD_SINK)
625 g_print (" SINK: '%s'", gst_pad_get_name (pad));
627 g_print (" UNKNOWN!!!: '%s'\n", gst_pad_get_name (pad));
629 if (GST_IS_GHOST_PAD (pad))
630 g_print (", ghost of real pad %s:%s\n", GST_DEBUG_PAD_NAME (realpad));
634 g_print (" Implementation:\n");
635 if (realpad->chainfunc)
636 g_print (" Has chainfunc(): %s\n",
637 GST_DEBUG_FUNCPTR_NAME (realpad->chainfunc));
638 if (realpad->getfunc)
639 g_print (" Has getfunc(): %s\n",
640 GST_DEBUG_FUNCPTR_NAME (realpad->getfunc));
641 if (realpad->formatsfunc != gst_pad_get_formats_default) {
642 g_print (" Supports seeking/conversion/query formats:\n");
643 print_formats (gst_pad_get_formats (GST_PAD (realpad)));
645 if (realpad->convertfunc != gst_pad_convert_default)
646 g_print (" Has custom convertfunc(): %s\n",
647 GST_DEBUG_FUNCPTR_NAME (realpad->convertfunc));
648 if (realpad->eventfunc != gst_pad_event_default)
649 g_print (" Has custom eventfunc(): %s\n",
650 GST_DEBUG_FUNCPTR_NAME (realpad->eventfunc));
651 if (realpad->eventmaskfunc != gst_pad_get_event_masks_default) {
652 g_print (" Provides event masks:\n");
653 print_event_masks (gst_pad_get_event_masks (GST_PAD (realpad)));
655 if (realpad->queryfunc != gst_pad_query_default)
656 g_print (" Has custom queryfunc(): %s\n",
657 GST_DEBUG_FUNCPTR_NAME (realpad->queryfunc));
658 if (realpad->querytypefunc != gst_pad_get_query_types_default) {
659 g_print (" Provides query types:\n");
660 print_query_types (gst_pad_get_query_types (GST_PAD (realpad)));
663 if (realpad->intlinkfunc != gst_pad_get_internal_links_default)
664 g_print (" Has custom intconnfunc(): %s\n",
665 GST_DEBUG_FUNCPTR_NAME(realpad->intlinkfunc));
667 if (realpad->bufferpoolfunc)
668 g_print (" Has bufferpoolfunc(): %s\n",
669 GST_DEBUG_FUNCPTR_NAME(realpad->bufferpoolfunc));
671 if (pad->padtemplate)
672 g_print (" Pad Template: '%s'\n",
673 pad->padtemplate->name_template);
676 g_print (" Capabilities:\n");
677 print_caps (realpad->caps, " ");
683 print_element_properties (element);
685 /* Dynamic Parameters block */
687 GstDParamManager* dpman;
691 g_print ("\nDynamic Parameters:\n");
692 if((dpman = gst_dpman_get_manager (element))) {
693 specs = gst_dpman_list_dparam_specs (dpman);
694 for (x = 0; specs[x] != NULL; x++) {
695 g_print (" %-20.20s: ", g_param_spec_get_name (specs[x]));
697 switch (G_PARAM_SPEC_VALUE_TYPE (specs[x])) {
699 g_print ("64 Bit Integer (Default %" G_GINT64_FORMAT ", Range %"
700 G_GINT64_FORMAT " -> %" G_GINT64_FORMAT ")",
701 ((GParamSpecInt64 *) specs[x])->default_value,
702 ((GParamSpecInt64 *) specs[x])->minimum,
703 ((GParamSpecInt64 *) specs[x])->maximum);
706 g_print ("Integer (Default %d, Range %d -> %d)",
707 ((GParamSpecInt *) specs[x])->default_value,
708 ((GParamSpecInt *) specs[x])->minimum,
709 ((GParamSpecInt *) specs[x])->maximum);
712 g_print ("Float. Default: %-8.8s %15.7g\n", "",
713 ((GParamSpecFloat *) specs[x])->default_value);
714 g_print ("%-23.23s Range: %15.7g - %15.7g", "",
715 ((GParamSpecFloat *) specs[x])->minimum,
716 ((GParamSpecFloat *) specs[x])->maximum);
718 default: g_print ("unknown %ld", G_PARAM_SPEC_VALUE_TYPE (specs[x]));
729 /* Signals/Actions Block */
737 for (k = 0; k < 2; k++) {
741 g_print ("\nElement Signals:\n");
743 g_print ("\nElement Actions:\n");
745 for(type = G_OBJECT_TYPE(element); type; type = g_type_parent(type)){
746 signals = g_signal_list_ids (type, &nsignals);
748 for (i = 0; i < nsignals; i++) {
751 const GType *param_types;
754 query = g_new0 (GSignalQuery,1);
755 g_signal_query (signals[i], query);
757 if ((k == 0 && !(query->signal_flags & G_SIGNAL_ACTION)) ||
758 (k == 1 && (query->signal_flags & G_SIGNAL_ACTION))) {
759 n_params = query->n_params;
760 return_type = query->return_type;
761 param_types = query->param_types;
763 g_print (" \"%s\" :\t %s user_function (%s* object",
764 query->signal_name, g_type_name (return_type),
767 for (j = 0; j < n_params; j++) {
768 g_print (",\n \t\t\t\t%s arg%d", g_type_name(param_types[j]), j);
771 g_print (",\n \t\t\t\tgpointer user_data);\n");
781 if (counted == 0) g_print (" none\n");
785 /* for compound elements */
786 if (GST_IS_BIN (element)) {
787 g_print ("\nChildren:\n");
788 children = (GList *) gst_bin_get_list (GST_BIN (element));
793 child = GST_ELEMENT (children->data);
794 children = g_list_next (children);
796 g_print (" %s\n", GST_ELEMENT_NAME (child));
805 print_element_list (void)
809 plugins = gst_registry_pool_plugin_list();
814 plugin = (GstPlugin*)(plugins->data);
815 plugins = g_list_next (plugins);
817 features = gst_plugin_get_feature_list (plugin);
819 GstPluginFeature *feature;
821 feature = GST_PLUGIN_FEATURE (features->data);
823 if (GST_IS_ELEMENT_FACTORY (feature)) {
824 GstElementFactory *factory;
826 factory = GST_ELEMENT_FACTORY (feature);
827 g_print ("%s: %s: %s\n", plugin->name,
828 GST_PLUGIN_FEATURE_NAME (factory) ,factory->details->longname);
830 #ifndef GST_DISABLE_AUTOPLUG
831 else if (GST_IS_AUTOPLUG_FACTORY (feature)) {
832 GstAutoplugFactory *factory;
834 factory = GST_AUTOPLUG_FACTORY (feature);
835 g_print ("%s: %s: %s\n", plugin->name,
836 GST_PLUGIN_FEATURE_NAME (factory), factory->longdesc);
839 #ifndef GST_DISABLE_INDEX
840 else if (GST_IS_INDEX_FACTORY (feature)) {
841 GstIndexFactory *factory;
843 factory = GST_INDEX_FACTORY (feature);
844 g_print ("%s: %s: %s\n", plugin->name,
845 GST_PLUGIN_FEATURE_NAME (factory), factory->longdesc);
848 else if (GST_IS_TYPE_FACTORY (feature)) {
849 GstTypeFactory *factory;
851 factory = GST_TYPE_FACTORY (feature);
853 g_print ("%s type: %s: %s\n", plugin->name,
854 factory->mime, factory->exts);
856 g_print ("%s type: %s: N/A\n", plugin->name,
859 if (factory->typefindfunc)
860 g_print (" Has typefind function: %s\n",
861 GST_DEBUG_FUNCPTR_NAME (factory->typefindfunc));
863 else if (GST_IS_SCHEDULER_FACTORY (feature)) {
864 GstSchedulerFactory *factory;
866 factory = GST_SCHEDULER_FACTORY (feature);
867 g_print ("%s: %s: %s\n", plugin->name,
868 GST_PLUGIN_FEATURE_NAME (factory), factory->longdesc);
870 #ifndef GST_DISABLE_URI
871 else if (GST_IS_URI_HANDLER (feature)) {
872 GstURIHandler *handler;
874 handler = GST_URI_HANDLER (feature);
875 g_print ("%s: %s: \"%s\" (%s) element \"%s\" property \"%s\"\n",
876 plugin->name, GST_PLUGIN_FEATURE_NAME (handler), handler->uri,
877 handler->longdesc, handler->element, handler->property);
881 g_print ("%s: %s (%s)\n", plugin->name,
882 GST_PLUGIN_FEATURE_NAME (feature),
883 g_type_name (G_OBJECT_TYPE (feature)));
886 features = g_list_next (features);
892 print_plugin_info (GstPlugin *plugin)
895 gint num_features = 0;
896 gint num_elements = 0;
897 gint num_autoplug = 0;
899 gint num_schedulers = 0;
900 gint num_indexes = 0;
903 g_print ("Plugin Details:\n");
904 g_print (" Name:\t\t%s\n", plugin->name);
905 g_print (" Long Name:\t%s\n", plugin->longname);
906 g_print (" Filename:\t%s\n", plugin->filename);
909 features = gst_plugin_get_feature_list (plugin);
912 GstPluginFeature *feature;
914 feature = GST_PLUGIN_FEATURE (features->data);
916 if (GST_IS_ELEMENT_FACTORY (feature)) {
917 GstElementFactory *factory;
919 factory = GST_ELEMENT_FACTORY (feature);
920 g_print (" %s: %s\n", GST_OBJECT_NAME (factory),
921 factory->details->longname);
924 #ifndef GST_DISABLE_AUTOPLUG
925 else if (GST_IS_AUTOPLUG_FACTORY (feature)) {
926 GstAutoplugFactory *factory;
928 factory = GST_AUTOPLUG_FACTORY (feature);
929 g_print (" %s: %s\n", GST_OBJECT_NAME (factory), factory->longdesc);
933 #ifndef GST_DISABLE_INDEX
934 else if (GST_IS_INDEX_FACTORY (feature)) {
935 GstIndexFactory *factory;
937 factory = GST_INDEX_FACTORY (feature);
938 g_print (" %s: %s\n", GST_OBJECT_NAME (factory), factory->longdesc);
942 else if (GST_IS_TYPE_FACTORY (feature)) {
943 GstTypeFactory *factory;
945 factory = GST_TYPE_FACTORY (feature);
946 g_print (" %s: %s\n", factory->mime, factory->exts);
948 if (factory->typefindfunc)
949 g_print (" Has typefind function: %s\n",
950 GST_DEBUG_FUNCPTR_NAME (factory->typefindfunc));
953 else if (GST_IS_SCHEDULER_FACTORY (feature)) {
954 GstSchedulerFactory *factory;
956 factory = GST_SCHEDULER_FACTORY (feature);
957 g_print (" %s: %s\n", GST_OBJECT_NAME (factory), factory->longdesc);
961 g_print (" %s (%s)\n", gst_object_get_name (GST_OBJECT (feature)),
962 g_type_name (G_OBJECT_TYPE (feature)));
966 features = g_list_next (features);
968 g_print ("\n %d features:\n", num_features);
969 if (num_elements > 0)
970 g_print (" +-- %d elements\n", num_elements);
971 if (num_autoplug > 0)
972 g_print (" +-- %d autopluggers\n", num_autoplug);
974 g_print (" +-- %d types\n", num_types);
975 if (num_schedulers > 0)
976 g_print (" +-- %d schedulers\n", num_schedulers);
978 g_print (" +-- %d indexes\n", num_indexes);
980 g_print (" +-- %d other objects\n", num_other);
986 main (int argc, char *argv[])
988 GstElementFactory *factory;
991 struct poptOption options[] = {
992 {"gst-inspect-plugin", 'p', POPT_ARG_STRING|POPT_ARGFLAG_STRIP, NULL, 0,
993 "Show plugin details", NULL},
994 {"gst-inspect-scheduler", 's', POPT_ARG_STRING|POPT_ARGFLAG_STRIP, NULL, 0,
995 "Show scheduler details", NULL},
999 gst_init_with_popt_table (&argc, &argv, options);
1000 gst_control_init (&argc, &argv);
1002 /* if no arguments, print out list of elements */
1004 print_element_list();
1006 /* else we try to get a factory */
1008 /* first check for help */
1009 if (strstr (argv[1], "-help")) {
1010 g_print ("Usage: %s\t\t\tList all registered elements\n",argv[0]);
1011 g_print (" %s element-name\tShow element details\n",argv[0]);
1012 g_print (" %s plugin-name[.so]\tShow information about plugin\n",
1017 /* only search for a factory if there's not a '.so' */
1018 if (! strstr (argv[1], ".so")) {
1019 factory = gst_element_factory_find (argv[1]);
1021 /* if there's a factory, print out the info */
1023 return print_element_info (factory);
1025 GstPluginFeature* feature;
1027 /* FIXME implement other pretty print function for these */
1028 feature = gst_registry_pool_find_feature (argv[1],
1029 GST_TYPE_SCHEDULER_FACTORY);
1031 g_print ("%s: a scheduler\n", argv[1]);
1034 #ifndef GST_DISABLE_INDEX
1035 feature = gst_registry_pool_find_feature (argv[1],
1036 GST_TYPE_INDEX_FACTORY);
1038 g_print ("%s: an index\n", argv[1]);
1042 #ifndef GST_DISABLE_AUTOPLUG
1043 feature = gst_registry_pool_find_feature (argv[1],
1044 GST_TYPE_AUTOPLUG_FACTORY);
1046 g_print ("%s: an autoplugger\n", argv[1]);
1050 feature = gst_registry_pool_find_feature (argv[1],
1051 GST_TYPE_TYPE_FACTORY);
1053 g_print ("%s: an type\n", argv[1]);
1056 #ifndef GST_DISABLE_URI
1057 feature = gst_registry_pool_find_feature (argv[1],
1058 GST_TYPE_URI_HANDLER);
1060 g_print ("%s: an uri handler\n", argv[1]);
1067 so = strstr(argv[1],".so");
1071 /* otherwise assume it's a plugin */
1072 plugin = gst_registry_pool_find_plugin (argv[1]);
1074 /* if there is such a plugin, print out info */
1077 print_plugin_info (plugin);
1080 g_print("no such element or plugin '%s'\n", argv[1]);