2 #include <gst/control/control.h>
6 print_prop (GstPropsEntry *prop, gboolean showname, const gchar *pfx)
11 g_print("%s%-20.20s: ", pfx, gst_props_entry_get_name (prop));
15 type = gst_props_entry_get_type (prop);
18 case GST_PROPS_INT_TYPE:
21 gst_props_entry_get_int (prop, &val);
22 g_print("Integer: %d\n", val);
25 case GST_PROPS_INT_RANGE_TYPE:
28 gst_props_entry_get_int_range (prop, &min, &max);
29 g_print("Integer range: %d - %d\n", min, max);
32 case GST_PROPS_FLOAT_TYPE:
35 gst_props_entry_get_float (prop, &val);
36 g_print("Float: %f\n", val);
39 case GST_PROPS_FLOAT_RANGE_TYPE:
42 gst_props_entry_get_float_range (prop, &min, &max);
43 g_print("Float range: %f - %f\n", min, max);
46 case GST_PROPS_BOOLEAN_TYPE:
49 gst_props_entry_get_boolean (prop, &val);
50 g_print("Boolean: %s\n", val ? "TRUE" : "FALSE");
53 case GST_PROPS_STRING_TYPE:
56 gst_props_entry_get_string (prop, &val);
57 g_print("String: \"%s\"\n", val);
60 case GST_PROPS_FOURCC_TYPE:
63 gst_props_entry_get_fourcc_int (prop, &val);
64 g_print("FourCC: '%c%c%c%c'\n",
66 (gchar)((val >> 8) & 0xff),
67 (gchar)((val >> 16) & 0xff),
68 (gchar)((val >> 24) & 0xff));
71 case GST_PROPS_LIST_TYPE:
76 gst_props_entry_get_list (prop, &list);
78 longprefix = g_strdup_printf ("%s ", pfx);
80 GstPropsEntry *listentry;
82 listentry = (GstPropsEntry*) (list->data);
83 print_prop (listentry, FALSE, longprefix);
85 list = g_list_next (list);
91 g_print("unknown props %d\n", type);
96 print_props (GstProps *properties, const gchar *pfx)
101 props = properties->properties;
103 prop = (GstPropsEntry*)(props->data);
104 props = g_list_next(props);
106 print_prop(prop,TRUE,pfx);
111 print_caps (const GstCaps *caps, const gchar *pfx)
116 g_print ("%s'%s': (%sfixed)\n", pfx, caps->name, (GST_CAPS_IS_FIXED (caps) ? "" : "NOT "));
118 type = gst_type_find_by_id (caps->id);
120 g_print ("%s MIME type: '%s':\n", pfx, type->mime);
122 g_print ("%s MIME type: 'unknown/unknown':\n", pfx);
124 if (caps->properties) {
125 gchar *prefix = g_strdup_printf ("%s ", pfx);
127 print_props(caps->properties, prefix);
137 print_formats (const GstFormat *formats)
139 while (formats && *formats) {
140 const GstFormatDefinition *definition;
142 definition = gst_format_get_details (*formats);
144 g_print ("\t\t(%d):\t%s (%s)\n", *formats,
145 definition->nick, definition->description);
147 g_print ("\t\t(%d):\tUnknown format\n", *formats);
154 print_query_types (const GstQueryType *types)
156 while (types && *types) {
157 const GstQueryTypeDefinition *definition;
159 definition = gst_query_type_get_details (*types);
161 g_print ("\t\t(%d):\t%s (%s)\n", *types,
162 definition->nick, definition->description);
164 g_print ("\t\t(%d):\tUnknown query format\n", *types);
171 print_event_masks (const GstEventMask *masks)
176 GFlagsClass *flags_class = NULL;
178 event_type = gst_event_type_get_type();
179 klass = (GEnumClass *) g_type_class_ref (event_type);
181 while (masks && masks->type) {
183 gint flags = 0, index = 0;
185 switch (masks->type) {
187 flags = masks->flags;
188 event_flags = gst_seek_type_get_type ();
189 flags_class = (GFlagsClass *) g_type_class_ref (event_flags);
195 value = g_enum_get_value (klass, masks->type);
196 g_print ("\t\t%s ", value->value_nick);
202 value = g_flags_get_first_value (flags_class, 1 << index);
205 g_print ("| %s ", value->value_nick);
219 output_hierarchy (GType type, gint level, gint *maxlevel)
224 parent = g_type_parent (type);
226 *maxlevel = *maxlevel + 1;
230 output_hierarchy (parent, level, maxlevel);
232 for (i=1; i<*maxlevel-level; i++)
237 g_print ("%s\n", g_type_name (type));
244 print_element_properties (GstElement *element)
246 GParamSpec **property_specs;
247 gint num_properties,i;
251 property_specs = g_object_class_list_properties
252 (G_OBJECT_GET_CLASS (element), &num_properties);
253 g_print("\nElement Arguments:\n");
255 for (i = 0; i < num_properties; i++) {
256 GValue value = { 0, };
257 GParamSpec *param = property_specs[i];
260 g_value_init (&value, param->value_type);
261 if (param->flags & G_PARAM_READABLE) {
262 g_object_get_property (G_OBJECT (element), param->name, &value);
266 g_print(" %-20s: %s\n", g_param_spec_get_name (param),
267 g_param_spec_get_blurb (param));
269 switch (G_VALUE_TYPE (&value)) {
271 g_print ("%-23.23s String. ", "");
272 if (readable) g_print ("(Default \"%s\")", g_value_get_string (&value));
275 g_print ("%-23.23s Boolean. ", "");
276 if (readable) g_print ("(Default %s)", (g_value_get_boolean (&value) ? "true" : "false"));
280 GParamSpecULong *pulong = G_PARAM_SPEC_ULONG (param);
281 g_print("%-23.23s Unsigned Long. ", "");
282 if (readable) g_print("Range: %lu - %lu (Default %lu)",
283 pulong->minimum, pulong->maximum, g_value_get_ulong (&value));
288 GParamSpecLong *plong = G_PARAM_SPEC_LONG (param);
289 g_print("%-23.23s Long. ", "");
290 if (readable) g_print("Range: %ld - %ld (Default %ld)",
291 plong->minimum, plong->maximum, g_value_get_long (&value));
296 GParamSpecUInt *puint = G_PARAM_SPEC_UINT (param);
297 g_print("%-23.23s Unsigned Integer. ", "");
298 if (readable) g_print("Range: %u - %u (Default %u)",
299 puint->minimum, puint->maximum, g_value_get_uint (&value));
304 GParamSpecInt *pint = G_PARAM_SPEC_INT (param);
305 g_print("%-23.23s Integer. ", "");
306 if (readable) g_print("Range: %d - %d (Default %d)",
307 pint->minimum, pint->maximum, g_value_get_int (&value));
312 GParamSpecUInt64 *puint64 = G_PARAM_SPEC_UINT64 (param);
313 g_print("%-23.23s Unsigned Integer64. ", "");
314 if (readable) g_print("Range: %" G_GUINT64_FORMAT " - %" G_GUINT64_FORMAT " (Default %" G_GUINT64_FORMAT ")",
315 puint64->minimum, puint64->maximum, g_value_get_uint64 (&value));
320 GParamSpecInt64 *pint64 = G_PARAM_SPEC_INT64 (param);
321 g_print("%-23.23s Integer64. ", "");
322 if (readable) g_print("Range: %" G_GINT64_FORMAT " - %" G_GINT64_FORMAT " (Default %" G_GINT64_FORMAT ")",
323 pint64->minimum, pint64->maximum, g_value_get_int64 (&value));
328 GParamSpecFloat *pfloat = G_PARAM_SPEC_FLOAT (param);
329 g_print("%-23.23s Float. Default: %-8.8s %15.7g\n", "", "",
330 g_value_get_float (&value));
331 g_print("%-23.23s Range: %15.7g - %15.7g", "",
332 pfloat->minimum, pfloat->maximum);
337 GParamSpecDouble *pdouble = G_PARAM_SPEC_DOUBLE (param);
338 g_print("%-23.23s Double. Default: %-8.8s %15.7g\n", "", "",
339 g_value_get_double (&value));
340 g_print("%-23.23s Range: %15.7g - %15.7g", "",
341 pdouble->minimum, pdouble->maximum);
345 if (param->value_type == GST_TYPE_FILENAME) {
346 g_print("%-23.23s Filename", "");
348 if (param->value_type == GST_TYPE_CAPS) {
349 GstCaps *caps = g_value_peek_pointer (&value);
352 g_print("%-23.23s Caps (NULL)", "");
354 print_caps (caps, " ");
357 else if (G_IS_PARAM_SPEC_ENUM (param)) {
362 values = G_ENUM_CLASS (g_type_class_ref (param->value_type))->values;
363 enum_value = g_value_get_enum (&value);
365 while (values[j].value_name) {
366 if (values[j].value == enum_value)
371 g_print ("%-23.23s Enum \"%s\" (default %d, \"%s\")", "",
372 g_type_name (G_VALUE_TYPE (&value)),
373 enum_value, values[j].value_nick);
376 while (values[j].value_name) {
377 g_print("\n%-23.23s (%d): \t%s", "",
378 values[j].value, values[j].value_nick);
381 /* g_type_class_unref (ec); */
383 else if (G_IS_PARAM_SPEC_FLAGS (param)) {
387 GString *flags = NULL;
389 values = G_FLAGS_CLASS (g_type_class_ref (param->value_type))->values;
390 flags_value = g_value_get_flags (&value);
392 while (values[j].value_name) {
393 if (values[j].value & flags_value) {
395 g_string_append_printf (flags, " | %s", values[j].value_nick);
398 flags = g_string_new (values[j].value_nick);
404 g_print ("%-23.23s Flags \"%s\" (default %d, \"%s\")", "",
405 g_type_name (G_VALUE_TYPE (&value)),
406 flags_value, (flags ? flags->str : "(none)"));
409 while (values[j].value_name) {
410 g_print("\n%-23.23s (%d): \t%s", "",
411 values[j].value, values[j].value_nick);
416 g_string_free (flags, TRUE);
418 else if (G_IS_PARAM_SPEC_OBJECT (param)) {
419 g_print("%-23.23s Object of type \"%s\"", "",
420 g_type_name(param->value_type));
423 g_print ("%-23.23s Unknown type %ld \"%s\"", "",param->value_type,
424 g_type_name(param->value_type));
429 g_print (" Write only\n");
433 if (num_properties == 0)
438 print_element_info (GstElementFactory *factory)
441 GstObjectClass *gstobject_class;
442 GstElementClass *gstelement_class;
446 GstPadTemplate *padtemplate;
452 element = gst_element_factory_create (factory, "element");
454 g_print ("couldn't construct element for some reason\n");
458 gstobject_class = GST_OBJECT_CLASS (G_OBJECT_GET_CLASS (element));
459 gstelement_class = GST_ELEMENT_CLASS (G_OBJECT_GET_CLASS (element));
461 g_print ("Factory Details:\n");
462 g_print (" Long name:\t%s\n", factory->details->longname);
463 g_print (" Class:\t%s\n", factory->details->klass);
464 g_print (" License:\t%s\n", factory->details->license);
465 g_print (" Description:\t%s\n", factory->details->description);
466 g_print (" Version:\t%s\n", factory->details->version);
467 g_print (" Author(s):\t%s\n", factory->details->author);
468 g_print (" Copyright:\t%s\n", factory->details->copyright);
471 output_hierarchy (G_OBJECT_TYPE (element), 0, &maxlevel);
473 g_print ("Pad Templates:\n");
474 if (factory->numpadtemplates) {
475 pads = factory->padtemplates;
477 padtemplate = (GstPadTemplate*)(pads->data);
478 pads = g_list_next(pads);
480 if (padtemplate->direction == GST_PAD_SRC)
481 g_print (" SRC template: '%s'\n", padtemplate->name_template);
482 else if (padtemplate->direction == GST_PAD_SINK)
483 g_print (" SINK template: '%s'\n", padtemplate->name_template);
485 g_print (" UNKNOWN!!! template: '%s'\n", padtemplate->name_template);
487 if (padtemplate->presence == GST_PAD_ALWAYS)
488 g_print (" Availability: Always\n");
489 else if (padtemplate->presence == GST_PAD_SOMETIMES)
490 g_print (" Availability: Sometimes\n");
491 else if (padtemplate->presence == GST_PAD_REQUEST) {
492 g_print (" Availability: On request\n");
493 g_print (" Has request_new_pad() function: %s\n",
494 GST_DEBUG_FUNCPTR_NAME (gstelement_class->request_new_pad));
497 g_print (" Availability: UNKNOWN!!!\n");
499 if (padtemplate->caps) {
500 g_print (" Capabilities:\n");
501 print_caps (padtemplate->caps, " ");
511 g_print ("\nElement Flags:\n");
512 if (GST_FLAG_IS_SET (element, GST_ELEMENT_COMPLEX)) {
513 g_print (" GST_ELEMENT_COMPLEX\n");
516 if (GST_FLAG_IS_SET (element, GST_ELEMENT_DECOUPLED)) {
517 g_print (" GST_ELEMENT_DECOUPLED\n");
520 if (GST_FLAG_IS_SET (element, GST_ELEMENT_THREAD_SUGGESTED)) {
521 g_print (" GST_ELEMENT_THREADSUGGESTED\n");
524 if (GST_FLAG_IS_SET (element, GST_ELEMENT_EVENT_AWARE)) {
525 g_print(" GST_ELEMENT_EVENT_AWARE\n");
529 g_print(" no flags set\n");
531 if (GST_IS_BIN (element)) {
532 g_print ("\nBin Flags:\n");
533 if (GST_FLAG_IS_SET (element, GST_BIN_FLAG_MANAGER)) {
534 g_print (" GST_BIN_FLAG_MANAGER\n");
537 if (GST_FLAG_IS_SET (element, GST_BIN_SELF_SCHEDULABLE)) {
538 g_print (" GST_BIN_SELF_SCHEDULABLE\n");
541 if (GST_FLAG_IS_SET (element, GST_BIN_FLAG_PREFER_COTHREADS)) {
542 g_print (" GST_BIN_FLAG_PREFER_COTHREADS\n");
546 g_print (" no flags set\n");
551 g_print ("\nElement Implementation:\n");
553 if (element->loopfunc)
554 g_print (" loopfunc()-based element: %s\n",
555 GST_DEBUG_FUNCPTR_NAME (element->loopfunc));
557 g_print (" No loopfunc(), must be chain-based or not configured yet\n");
559 g_print (" Has change_state() function: %s\n",
560 GST_DEBUG_FUNCPTR_NAME (gstelement_class->change_state));
561 #ifndef GST_DISABLE_LOADSAVE
562 g_print (" Has custom save_thyself() function: %s\n",
563 GST_DEBUG_FUNCPTR_NAME (gstobject_class->save_thyself));
564 g_print (" Has custom restore_thyself() function: %s\n",
565 GST_DEBUG_FUNCPTR_NAME (gstobject_class->restore_thyself));
570 g_print ("\nClocking Interaction:\n");
571 if (gst_element_requires_clock (element)) {
572 g_print (" element requires a clock\n");
575 if (gst_element_provides_clock (element)) {
578 clock = gst_element_get_clock (element);
580 g_print (" element provides a clock: %s\n", GST_OBJECT_NAME(clock));
582 g_print (" element is supposed to provide a clock but returned NULL\n");
589 g_print ("\nIndexing capabilities:\n");
590 if (gst_element_is_indexable (element)) {
591 g_print (" element can do indexing\n");
597 g_print ("\nPads:\n");
598 if (element->numpads) {
600 pads = gst_element_get_pad_list (element);
602 pad = GST_PAD (pads->data);
603 pads = g_list_next (pads);
604 realpad = GST_PAD_REALIZE (pad);
606 if (gst_pad_get_direction (pad) == GST_PAD_SRC)
607 g_print (" SRC: '%s'", gst_pad_get_name (pad));
608 else if (gst_pad_get_direction (pad) == GST_PAD_SINK)
609 g_print (" SINK: '%s'", gst_pad_get_name (pad));
611 g_print (" UNKNOWN!!!: '%s'\n", gst_pad_get_name (pad));
613 if (GST_IS_GHOST_PAD (pad))
614 g_print (", ghost of real pad %s:%s\n", GST_DEBUG_PAD_NAME (realpad));
618 g_print (" Implementation:\n");
619 if (realpad->chainfunc)
620 g_print (" Has chainfunc(): %s\n",
621 GST_DEBUG_FUNCPTR_NAME (realpad->chainfunc));
622 if (realpad->getfunc)
623 g_print (" Has getfunc(): %s\n",
624 GST_DEBUG_FUNCPTR_NAME (realpad->getfunc));
625 if (realpad->formatsfunc != gst_pad_get_formats_default) {
626 g_print (" Supports seeking/conversion/query formats:\n");
627 print_formats (gst_pad_get_formats (GST_PAD (realpad)));
629 if (realpad->convertfunc != gst_pad_convert_default)
630 g_print (" Has custom convertfunc(): %s\n",
631 GST_DEBUG_FUNCPTR_NAME (realpad->convertfunc));
632 if (realpad->eventfunc != gst_pad_event_default)
633 g_print (" Has custom eventfunc(): %s\n",
634 GST_DEBUG_FUNCPTR_NAME (realpad->eventfunc));
635 if (realpad->eventmaskfunc != gst_pad_get_event_masks_default) {
636 g_print (" Provides event masks:\n");
637 print_event_masks (gst_pad_get_event_masks (GST_PAD (realpad)));
639 if (realpad->queryfunc != gst_pad_query_default)
640 g_print (" Has custom queryfunc(): %s\n",
641 GST_DEBUG_FUNCPTR_NAME (realpad->queryfunc));
642 if (realpad->querytypefunc != gst_pad_get_query_types_default) {
643 g_print (" Provides query types:\n");
644 print_query_types (gst_pad_get_query_types (GST_PAD (realpad)));
647 if (realpad->intlinkfunc != gst_pad_get_internal_links_default)
648 g_print (" Has custom intconnfunc(): %s\n",
649 GST_DEBUG_FUNCPTR_NAME(realpad->intlinkfunc));
651 if (realpad->bufferpoolfunc)
652 g_print (" Has bufferpoolfunc(): %s\n",
653 GST_DEBUG_FUNCPTR_NAME(realpad->bufferpoolfunc));
655 if (pad->padtemplate)
656 g_print (" Pad Template: '%s'\n",
657 pad->padtemplate->name_template);
660 g_print (" Capabilities:\n");
661 print_caps (realpad->caps, " ");
667 print_element_properties (element);
669 /* Dynamic Parameters block */
671 GstDParamManager* dpman;
675 g_print ("\nDynamic Parameters:\n");
676 if((dpman = gst_dpman_get_manager (element))) {
677 specs = gst_dpman_list_dparam_specs (dpman);
678 for (x = 0; specs[x] != NULL; x++) {
679 g_print (" %-20.20s: ", g_param_spec_get_name (specs[x]));
681 switch (G_PARAM_SPEC_VALUE_TYPE (specs[x])) {
683 g_print ("64 Bit Integer (Default %" G_GINT64_FORMAT ", Range %" G_GINT64_FORMAT " -> %" G_GINT64_FORMAT ")",
684 ((GParamSpecInt64 *) specs[x])->default_value,
685 ((GParamSpecInt64 *) specs[x])->minimum,
686 ((GParamSpecInt64 *) specs[x])->maximum);
689 g_print ("Integer (Default %d, Range %d -> %d)",
690 ((GParamSpecInt *) specs[x])->default_value,
691 ((GParamSpecInt *) specs[x])->minimum,
692 ((GParamSpecInt *) specs[x])->maximum);
695 g_print ("Float. Default: %-8.8s %15.7g\n", "",
696 ((GParamSpecFloat *) specs[x])->default_value);
697 g_print ("%-23.23s Range: %15.7g - %15.7g", "",
698 ((GParamSpecFloat *) specs[x])->minimum,
699 ((GParamSpecFloat *) specs[x])->maximum);
701 default: g_print ("unknown %ld", G_PARAM_SPEC_VALUE_TYPE (specs[x]));
712 /* Signals/Actions Block */
719 signals = g_signal_list_ids (G_OBJECT_TYPE (element), &nsignals);
720 for (k = 0; k < 2; k++) {
724 g_print ("\nElement Signals:\n");
726 g_print ("\nElement Actions:\n");
728 for (i = 0; i < nsignals; i++) {
731 const GType *param_types;
734 query = g_new0 (GSignalQuery,1);
735 g_signal_query (signals[i], query);
737 if ((k == 0 && !(query->signal_flags & G_SIGNAL_ACTION)) ||
738 (k == 1 && (query->signal_flags & G_SIGNAL_ACTION))) {
739 n_params = query->n_params;
740 return_type = query->return_type;
741 param_types = query->param_types;
743 g_print (" \"%s\" :\t %s user_function (%s* object",
744 query->signal_name, g_type_name (return_type),
745 g_type_name (G_OBJECT_TYPE (element)));
747 for (j = 0; j < n_params; j++) {
748 g_print (",\n \t\t\t\t%s arg%d", g_type_name (param_types[j]), j);
751 g_print (",\n \t\t\t\tgpointer user_data);\n");
760 if (counted == 0) g_print (" none\n");
765 /* for compound elements */
766 if (GST_IS_BIN (element)) {
767 g_print ("\nChildren:\n");
768 children = (GList *) gst_bin_get_list (GST_BIN (element));
773 child = GST_ELEMENT (children->data);
774 children = g_list_next (children);
776 g_print (" %s\n", GST_ELEMENT_NAME (child));
785 print_element_list (void)
789 plugins = gst_registry_pool_plugin_list();
794 plugin = (GstPlugin*)(plugins->data);
795 plugins = g_list_next (plugins);
797 features = gst_plugin_get_feature_list (plugin);
799 GstPluginFeature *feature;
801 feature = GST_PLUGIN_FEATURE (features->data);
803 if (GST_IS_ELEMENT_FACTORY (feature)) {
804 GstElementFactory *factory;
806 factory = GST_ELEMENT_FACTORY (feature);
807 g_print ("%s: %s: %s\n", plugin->name,
808 GST_PLUGIN_FEATURE_NAME (factory) ,factory->details->longname);
810 else if (GST_IS_AUTOPLUG_FACTORY (feature)) {
811 GstAutoplugFactory *factory;
813 factory = GST_AUTOPLUG_FACTORY (feature);
814 g_print ("%s: %s: %s\n", plugin->name,
815 GST_PLUGIN_FEATURE_NAME (factory), factory->longdesc);
817 else if (GST_IS_INDEX_FACTORY (feature)) {
818 GstIndexFactory *factory;
820 factory = GST_INDEX_FACTORY (feature);
821 g_print ("%s: %s: %s\n", plugin->name,
822 GST_PLUGIN_FEATURE_NAME (factory), factory->longdesc);
824 else if (GST_IS_TYPE_FACTORY (feature)) {
825 GstTypeFactory *factory;
827 factory = GST_TYPE_FACTORY (feature);
828 g_print ("%s type: %s: %s\n", plugin->name,
829 factory->mime, factory->exts);
831 if (factory->typefindfunc)
832 g_print (" Has typefind function: %s\n",
833 GST_DEBUG_FUNCPTR_NAME (factory->typefindfunc));
835 else if (GST_IS_SCHEDULER_FACTORY (feature)) {
836 GstSchedulerFactory *factory;
838 factory = GST_SCHEDULER_FACTORY (feature);
839 g_print ("%s: %s: %s\n", plugin->name,
840 GST_PLUGIN_FEATURE_NAME (factory), factory->longdesc);
842 else if (GST_IS_URI_HANDLER (feature)) {
843 GstURIHandler *handler;
845 handler = GST_URI_HANDLER (feature);
846 g_print ("%s: %s: \"%s\" (%s) element \"%s\" property \"%s\"\n", plugin->name,
847 GST_PLUGIN_FEATURE_NAME (handler), handler->uri, handler->longdesc,
848 handler->element, handler->property);
851 g_print ("%s: %s (%s)\n", plugin->name,
852 GST_PLUGIN_FEATURE_NAME (feature),
853 g_type_name (G_OBJECT_TYPE (feature)));
856 features = g_list_next (features);
862 print_plugin_info (GstPlugin *plugin)
865 gint num_features = 0;
866 gint num_elements = 0;
867 gint num_autoplug = 0;
869 gint num_schedulers = 0;
870 gint num_indexes = 0;
873 g_print ("Plugin Details:\n");
874 g_print (" Name:\t\t%s\n", plugin->name);
875 g_print (" Long Name:\t%s\n", plugin->longname);
876 g_print (" Filename:\t%s\n", plugin->filename);
879 features = gst_plugin_get_feature_list (plugin);
882 GstPluginFeature *feature;
884 feature = GST_PLUGIN_FEATURE (features->data);
886 if (GST_IS_ELEMENT_FACTORY (feature)) {
887 GstElementFactory *factory;
889 factory = GST_ELEMENT_FACTORY (feature);
890 g_print (" %s: %s\n", GST_OBJECT_NAME (factory),
891 factory->details->longname);
894 else if (GST_IS_AUTOPLUG_FACTORY (feature)) {
895 GstAutoplugFactory *factory;
897 factory = GST_AUTOPLUG_FACTORY (feature);
898 g_print (" %s: %s\n", GST_OBJECT_NAME (factory), factory->longdesc);
901 else if (GST_IS_INDEX_FACTORY (feature)) {
902 GstIndexFactory *factory;
904 factory = GST_INDEX_FACTORY (feature);
905 g_print (" %s: %s\n", GST_OBJECT_NAME (factory), factory->longdesc);
908 else if (GST_IS_TYPE_FACTORY (feature)) {
909 GstTypeFactory *factory;
911 factory = GST_TYPE_FACTORY (feature);
912 g_print (" %s: %s\n", factory->mime, factory->exts);
914 if (factory->typefindfunc)
915 g_print (" Has typefind function: %s\n",
916 GST_DEBUG_FUNCPTR_NAME (factory->typefindfunc));
919 else if (GST_IS_SCHEDULER_FACTORY (feature)) {
920 GstSchedulerFactory *factory;
922 factory = GST_SCHEDULER_FACTORY (feature);
923 g_print (" %s: %s\n", GST_OBJECT_NAME (factory), factory->longdesc);
927 g_print (" %s (%s)\n", gst_object_get_name (GST_OBJECT (feature)),
928 g_type_name (G_OBJECT_TYPE (feature)));
932 features = g_list_next (features);
934 g_print ("\n %d features:\n", num_features);
935 if (num_elements > 0)
936 g_print (" +-- %d elements\n", num_elements);
937 if (num_autoplug > 0)
938 g_print (" +-- %d autopluggers\n", num_autoplug);
940 g_print (" +-- %d types\n", num_types);
941 if (num_schedulers > 0)
942 g_print (" +-- %d schedulers\n", num_schedulers);
944 g_print (" +-- %d indexes\n", num_indexes);
946 g_print (" +-- %d other objects\n", num_other);
953 main (int argc, char *argv[])
955 GstElementFactory *factory;
958 struct poptOption options[] = {
959 {"gst-inspect-plugin", 'p', POPT_ARG_STRING|POPT_ARGFLAG_STRIP, NULL, 0,
960 "Show plugin details", NULL},
961 {"gst-inspect-scheduler", 's', POPT_ARG_STRING|POPT_ARGFLAG_STRIP, NULL, 0,
962 "Show scheduler details", NULL},
966 gst_init_with_popt_table (&argc, &argv, options);
967 gst_control_init (&argc, &argv);
969 /* if no arguments, print out list of elements */
971 print_element_list();
973 /* else we try to get a factory */
975 /* first check for help */
976 if (strstr (argv[1], "-help")) {
977 g_print ("Usage: %s\t\t\tList all registered elements\n",argv[0]);
978 g_print (" %s element-name\tShow element details\n",argv[0]);
979 g_print (" %s plugin-name[.so]\tShow information about plugin\n",
984 /* only search for a factory if there's not a '.so' */
985 if (! strstr (argv[1], ".so")) {
986 factory = gst_element_factory_find (argv[1]);
988 /* if there's a factory, print out the info */
990 return print_element_info (factory);
992 GstPluginFeature* feature;
994 /* FIXME implement other pretty print function for these */
995 feature = gst_registry_pool_find_feature (argv[1], GST_TYPE_SCHEDULER_FACTORY);
997 g_print ("%s: a scheduler\n", argv[1]);
1000 feature = gst_registry_pool_find_feature (argv[1], GST_TYPE_INDEX_FACTORY);
1002 g_print ("%s: an index\n", argv[1]);
1005 feature = gst_registry_pool_find_feature (argv[1], GST_TYPE_AUTOPLUG_FACTORY);
1007 g_print ("%s: an autoplugger\n", argv[1]);
1010 feature = gst_registry_pool_find_feature (argv[1], GST_TYPE_TYPE_FACTORY);
1012 g_print ("%s: an type\n", argv[1]);
1015 feature = gst_registry_pool_find_feature (argv[1], GST_TYPE_URI_HANDLER);
1017 g_print ("%s: an uri handler\n", argv[1]);
1023 so = strstr(argv[1],".so");
1027 /* otherwise assume it's a plugin */
1028 plugin = gst_registry_pool_find_plugin (argv[1]);
1030 /* if there is such a plugin, print out info */
1033 print_plugin_info (plugin);
1036 g_print("no such element or plugin '%s'\n", argv[1]);