code cleanups use either g_print or printf can you tell I'm back to taking the train to work ?

Original commit message from CVS:
code cleanups
use either g_print or printf
can you tell I'm back to taking the train to work ?
This commit is contained in:
Thomas Vander Stichele 2002-09-09 09:30:07 +00:00
parent 7f317f840b
commit 1037275ae7

View file

@ -359,27 +359,27 @@ print_element_info (GstElementFactory *factory)
gboolean have_flags; gboolean have_flags;
gint maxlevel = 0; gint maxlevel = 0;
element = gst_element_factory_create(factory,"element"); element = gst_element_factory_create (factory, "element");
if (!element) { if (!element) {
g_print ("couldn't construct element for some reason\n"); printf ("couldn't construct element for some reason\n");
return -1; return -1;
} }
gstobject_class = GST_OBJECT_CLASS (G_OBJECT_GET_CLASS (element)); gstobject_class = GST_OBJECT_CLASS (G_OBJECT_GET_CLASS (element));
gstelement_class = GST_ELEMENT_CLASS (G_OBJECT_GET_CLASS (element)); gstelement_class = GST_ELEMENT_CLASS (G_OBJECT_GET_CLASS (element));
printf("Factory Details:\n"); printf ("Factory Details:\n");
printf(" Long name:\t%s\n",factory->details->longname); printf (" Long name:\t%s\n", factory->details->longname);
printf(" Class:\t%s\n",factory->details->klass); printf (" Class:\t%s\n", factory->details->klass);
printf(" Description:\t%s\n",factory->details->description); printf (" Description:\t%s\n", factory->details->description);
printf(" Version:\t%s\n",factory->details->version); printf (" Version:\t%s\n", factory->details->version);
printf(" Author(s):\t%s\n",factory->details->author); printf (" Author(s):\t%s\n", factory->details->author);
printf(" Copyright:\t%s\n",factory->details->copyright); printf (" Copyright:\t%s\n", factory->details->copyright);
printf("\n"); printf ("\n");
output_hierarchy (G_OBJECT_TYPE (element), 0, &maxlevel); output_hierarchy (G_OBJECT_TYPE (element), 0, &maxlevel);
printf("Pad Templates:\n"); printf ("Pad Templates:\n");
if (factory->numpadtemplates) { if (factory->numpadtemplates) {
pads = factory->padtemplates; pads = factory->padtemplates;
while (pads) { while (pads) {
@ -387,66 +387,66 @@ print_element_info (GstElementFactory *factory)
pads = g_list_next(pads); pads = g_list_next(pads);
if (padtemplate->direction == GST_PAD_SRC) if (padtemplate->direction == GST_PAD_SRC)
printf(" SRC template: '%s'\n",padtemplate->name_template); printf (" SRC template: '%s'\n", padtemplate->name_template);
else if (padtemplate->direction == GST_PAD_SINK) else if (padtemplate->direction == GST_PAD_SINK)
printf(" SINK template: '%s'\n",padtemplate->name_template); printf (" SINK template: '%s'\n", padtemplate->name_template);
else else
printf(" UNKNOWN!!! template: '%s'\n",padtemplate->name_template); printf (" UNKNOWN!!! template: '%s'\n", padtemplate->name_template);
if (padtemplate->presence == GST_PAD_ALWAYS) if (padtemplate->presence == GST_PAD_ALWAYS)
printf(" Availability: Always\n"); printf (" Availability: Always\n");
else if (padtemplate->presence == GST_PAD_SOMETIMES) else if (padtemplate->presence == GST_PAD_SOMETIMES)
printf(" Availability: Sometimes\n"); printf (" Availability: Sometimes\n");
else if (padtemplate->presence == GST_PAD_REQUEST) { else if (padtemplate->presence == GST_PAD_REQUEST) {
printf(" Availability: On request\n"); printf (" Availability: On request\n");
printf(" Has request_new_pad() function: %s\n", printf (" Has request_new_pad() function: %s\n",
GST_DEBUG_FUNCPTR_NAME(gstelement_class->request_new_pad)); GST_DEBUG_FUNCPTR_NAME (gstelement_class->request_new_pad));
} }
else else
printf(" Availability: UNKNOWN!!!\n"); printf (" Availability: UNKNOWN!!!\n");
if (padtemplate->caps) { if (padtemplate->caps) {
printf(" Capabilities:\n"); printf (" Capabilities:\n");
caps = padtemplate->caps; caps = padtemplate->caps;
while (caps) { while (caps) {
GstType *type; GstType *type;
printf(" '%s':\n",caps->name); printf (" '%s':\n",caps->name);
type = gst_type_find_by_id (caps->id); type = gst_type_find_by_id (caps->id);
if (type) if (type)
printf(" MIME type: '%s':\n",type->mime); printf (" MIME type: '%s':\n", type->mime);
else else
printf(" MIME type: 'unknown/unknown':\n"); printf (" MIME type: 'unknown/unknown':\n");
if (caps->properties) if (caps->properties)
print_props(caps->properties," "); print_props(caps->properties, " ");
caps = caps->next; caps = caps->next;
} }
} }
printf("\n"); printf ("\n");
} }
} else } else
printf(" none\n"); printf (" none\n");
have_flags = FALSE; have_flags = FALSE;
printf("\nElement Flags:\n"); printf ("\nElement Flags:\n");
if (GST_FLAG_IS_SET(element,GST_ELEMENT_COMPLEX)) { if (GST_FLAG_IS_SET (element, GST_ELEMENT_COMPLEX)) {
printf(" GST_ELEMENT_COMPLEX\n"); printf (" GST_ELEMENT_COMPLEX\n");
have_flags = TRUE; have_flags = TRUE;
} }
if (GST_FLAG_IS_SET(element,GST_ELEMENT_DECOUPLED)) { if (GST_FLAG_IS_SET (element, GST_ELEMENT_DECOUPLED)) {
printf(" GST_ELEMENT_DECOUPLED\n"); printf (" GST_ELEMENT_DECOUPLED\n");
have_flags = TRUE; have_flags = TRUE;
} }
if (GST_FLAG_IS_SET(element,GST_ELEMENT_THREAD_SUGGESTED)) { if (GST_FLAG_IS_SET (element, GST_ELEMENT_THREAD_SUGGESTED)) {
printf(" GST_ELEMENT_THREADSUGGESTED\n"); printf (" GST_ELEMENT_THREADSUGGESTED\n");
have_flags = TRUE; have_flags = TRUE;
} }
if (GST_FLAG_IS_SET(element,GST_ELEMENT_EVENT_AWARE)) { if (GST_FLAG_IS_SET (element, GST_ELEMENT_EVENT_AWARE)) {
printf(" GST_ELEMENT_EVENT_AWARE\n"); printf(" GST_ELEMENT_EVENT_AWARE\n");
have_flags = TRUE; have_flags = TRUE;
} }
@ -454,46 +454,47 @@ print_element_info (GstElementFactory *factory)
printf(" no flags set\n"); printf(" no flags set\n");
if (GST_IS_BIN (element)) { if (GST_IS_BIN (element)) {
printf("\nBin Flags:\n"); printf ("\nBin Flags:\n");
if (GST_FLAG_IS_SET(element,GST_BIN_FLAG_MANAGER)) { if (GST_FLAG_IS_SET (element, GST_BIN_FLAG_MANAGER)) {
printf(" GST_BIN_FLAG_MANAGER\n"); printf (" GST_BIN_FLAG_MANAGER\n");
have_flags = TRUE; have_flags = TRUE;
} }
if (GST_FLAG_IS_SET(element,GST_BIN_SELF_SCHEDULABLE)) { if (GST_FLAG_IS_SET (element, GST_BIN_SELF_SCHEDULABLE)) {
printf(" GST_BIN_SELF_SCHEDULABLE\n"); printf (" GST_BIN_SELF_SCHEDULABLE\n");
have_flags = TRUE; have_flags = TRUE;
} }
if (GST_FLAG_IS_SET(element,GST_BIN_FLAG_PREFER_COTHREADS)) { if (GST_FLAG_IS_SET (element, GST_BIN_FLAG_PREFER_COTHREADS)) {
printf(" GST_BIN_FLAG_PREFER_COTHREADS\n"); printf (" GST_BIN_FLAG_PREFER_COTHREADS\n");
have_flags = TRUE; have_flags = TRUE;
} }
if (!have_flags) if (!have_flags)
printf(" no flags set\n"); printf (" no flags set\n");
} }
printf("\nElement Implementation:\n"); printf ("\nElement Implementation:\n");
if (element->loopfunc) if (element->loopfunc)
printf(" loopfunc()-based element: %s\n",GST_DEBUG_FUNCPTR_NAME(element->loopfunc)); printf (" loopfunc()-based element: %s\n",
GST_DEBUG_FUNCPTR_NAME (element->loopfunc));
else else
printf(" No loopfunc(), must be chain-based or not configured yet\n"); printf (" No loopfunc(), must be chain-based or not configured yet\n");
printf(" Has change_state() function: %s\n", printf (" Has change_state() function: %s\n",
GST_DEBUG_FUNCPTR_NAME(gstelement_class->change_state)); GST_DEBUG_FUNCPTR_NAME (gstelement_class->change_state));
#ifndef GST_DISABLE_LOADSAVE #ifndef GST_DISABLE_LOADSAVE
printf(" Has custom save_thyself() function: %s\n", printf (" Has custom save_thyself() function: %s\n",
GST_DEBUG_FUNCPTR_NAME(gstobject_class->save_thyself)); GST_DEBUG_FUNCPTR_NAME (gstobject_class->save_thyself));
printf(" Has custom restore_thyself() function: %s\n", printf (" Has custom restore_thyself() function: %s\n",
GST_DEBUG_FUNCPTR_NAME(gstobject_class->restore_thyself)); GST_DEBUG_FUNCPTR_NAME (gstobject_class->restore_thyself));
#endif #endif
have_flags = FALSE; have_flags = FALSE;
printf("\nClocking Interaction:\n"); printf ("\nClocking Interaction:\n");
if (element->setclockfunc) { if (element->setclockfunc) {
printf(" element requires a clock\n"); printf (" element requires a clock\n");
have_flags = TRUE; have_flags = TRUE;
} }
if (element->getclockfunc) { if (element->getclockfunc) {
@ -501,90 +502,98 @@ print_element_info (GstElementFactory *factory)
clock = gst_element_get_clock (element); clock = gst_element_get_clock (element);
if (clock) if (clock)
printf(" element provides a clock: %s\n", GST_OBJECT_NAME(clock)); printf (" element provides a clock: %s\n", GST_OBJECT_NAME(clock));
have_flags = TRUE; have_flags = TRUE;
} }
if (!have_flags) { if (!have_flags) {
printf(" none\n"); printf (" none\n");
} }
printf("\nPads:\n"); printf ("\nPads:\n");
if (element->numpads) { if (element->numpads) {
pads = gst_element_get_pad_list(element); pads = gst_element_get_pad_list (element);
while (pads) { while (pads) {
pad = GST_PAD(pads->data); pad = GST_PAD (pads->data);
pads = g_list_next(pads); pads = g_list_next (pads);
realpad = GST_PAD_REALIZE(pad); realpad = GST_PAD_REALIZE (pad);
if (gst_pad_get_direction(pad) == GST_PAD_SRC) if (gst_pad_get_direction (pad) == GST_PAD_SRC)
printf(" SRC: '%s'",gst_pad_get_name(pad)); printf (" SRC: '%s'", gst_pad_get_name (pad));
else if (gst_pad_get_direction(pad) == GST_PAD_SINK) else if (gst_pad_get_direction (pad) == GST_PAD_SINK)
printf(" SINK: '%s'",gst_pad_get_name(pad)); printf (" SINK: '%s'", gst_pad_get_name (pad));
else else
printf(" UNKNOWN!!!: '%s'\n",gst_pad_get_name(pad)); printf (" UNKNOWN!!!: '%s'\n", gst_pad_get_name (pad));
if (GST_IS_GHOST_PAD(pad)) if (GST_IS_GHOST_PAD (pad))
printf(", ghost of real pad %s:%s\n",GST_DEBUG_PAD_NAME(realpad)); printf (", ghost of real pad %s:%s\n", GST_DEBUG_PAD_NAME (realpad));
else else
printf("\n"); printf ("\n");
printf(" Implementation:\n"); printf (" Implementation:\n");
if (realpad->chainfunc) if (realpad->chainfunc)
printf(" Has chainfunc(): %s\n",GST_DEBUG_FUNCPTR_NAME(realpad->chainfunc)); printf (" Has chainfunc(): %s\n",
GST_DEBUG_FUNCPTR_NAME (realpad->chainfunc));
if (realpad->getfunc) if (realpad->getfunc)
printf(" Has getfunc(): %s\n",GST_DEBUG_FUNCPTR_NAME(realpad->getfunc)); printf (" Has getfunc(): %s\n",
GST_DEBUG_FUNCPTR_NAME (realpad->getfunc));
if (realpad->formatsfunc != gst_pad_get_formats_default) { if (realpad->formatsfunc != gst_pad_get_formats_default) {
printf(" Supports seeking/conversion/query formats:\n"); printf (" Supports seeking/conversion/query formats:\n");
print_formats(gst_pad_get_formats (GST_PAD (realpad))); print_formats (gst_pad_get_formats (GST_PAD (realpad)));
} }
if (realpad->convertfunc != gst_pad_convert_default) if (realpad->convertfunc != gst_pad_convert_default)
printf(" Has custom convertfunc(): %s\n",GST_DEBUG_FUNCPTR_NAME(realpad->convertfunc)); printf (" Has custom convertfunc(): %s\n",
GST_DEBUG_FUNCPTR_NAME (realpad->convertfunc));
if (realpad->eventfunc != gst_pad_event_default) if (realpad->eventfunc != gst_pad_event_default)
printf(" Has custom eventfunc(): %s\n",GST_DEBUG_FUNCPTR_NAME(realpad->eventfunc)); printf (" Has custom eventfunc(): %s\n",
GST_DEBUG_FUNCPTR_NAME (realpad->eventfunc));
if (realpad->eventmaskfunc != gst_pad_get_event_masks_default) { if (realpad->eventmaskfunc != gst_pad_get_event_masks_default) {
printf(" Provides event masks:\n"); printf (" Provides event masks:\n");
print_event_masks(gst_pad_get_event_masks (GST_PAD (realpad))); print_event_masks (gst_pad_get_event_masks (GST_PAD (realpad)));
} }
if (realpad->queryfunc != gst_pad_query_default) if (realpad->queryfunc != gst_pad_query_default)
printf(" Has custom queryfunc(): %s\n",GST_DEBUG_FUNCPTR_NAME(realpad->queryfunc)); printf (" Has custom queryfunc(): %s\n",
GST_DEBUG_FUNCPTR_NAME (realpad->queryfunc));
if (realpad->querytypefunc != gst_pad_get_query_types_default) { if (realpad->querytypefunc != gst_pad_get_query_types_default) {
printf(" Provides query types:\n"); printf (" Provides query types:\n");
print_query_types(gst_pad_get_query_types (GST_PAD (realpad))); print_query_types (gst_pad_get_query_types (GST_PAD (realpad)));
} }
if (realpad->intconnfunc != gst_pad_get_internal_connections_default) if (realpad->intconnfunc != gst_pad_get_internal_connections_default)
printf(" Has custom intconnfunc(): %s\n",GST_DEBUG_FUNCPTR_NAME(realpad->intconnfunc)); printf (" Has custom intconnfunc(): %s\n",
GST_DEBUG_FUNCPTR_NAME(realpad->intconnfunc));
if (realpad->bufferpoolfunc) if (realpad->bufferpoolfunc)
printf(" Has bufferpoolfunc(): %s\n",GST_DEBUG_FUNCPTR_NAME(realpad->bufferpoolfunc)); printf (" Has bufferpoolfunc(): %s\n",
GST_DEBUG_FUNCPTR_NAME(realpad->bufferpoolfunc));
if (pad->padtemplate) if (pad->padtemplate)
printf(" Pad Template: '%s'\n",pad->padtemplate->name_template); printf (" Pad Template: '%s'\n",
pad->padtemplate->name_template);
if (realpad->caps) { if (realpad->caps) {
printf(" Capabilities:\n"); printf (" Capabilities:\n");
caps = realpad->caps; caps = realpad->caps;
while (caps) { while (caps) {
GstType *type; GstType *type;
printf(" '%s':\n",caps->name); printf (" '%s':\n", caps->name);
type = gst_type_find_by_id (caps->id); type = gst_type_find_by_id (caps->id);
if (type) if (type)
printf(" MIME type: '%s':\n",type->mime); printf (" MIME type: '%s':\n", type->mime);
else else
printf(" MIME type: 'unknown/unknown':\n"); printf (" MIME type: 'unknown/unknown':\n");
if (caps->properties) if (caps->properties)
print_props(caps->properties," "); print_props (caps->properties, " ");
caps = caps->next; caps = caps->next;
} }
} }
} }
} else } else
printf(" none\n"); printf (" none\n");
print_element_properties (element); print_element_properties (element);
@ -594,40 +603,40 @@ print_element_info (GstElementFactory *factory)
GParamSpec** specs; GParamSpec** specs;
gint x; gint x;
printf("\nDynamic Parameters:\n"); printf ("\nDynamic Parameters:\n");
if((dpman = gst_dpman_get_manager (element))){ if((dpman = gst_dpman_get_manager (element))) {
specs = gst_dpman_list_dparam_specs(dpman); specs = gst_dpman_list_dparam_specs (dpman);
for (x=0; specs[x] != NULL; x++){ for (x = 0; specs[x] != NULL; x++) {
printf(" %-20.20s: ", g_param_spec_get_name (specs[x])); printf (" %-20.20s: ", g_param_spec_get_name (specs[x]));
switch (G_PARAM_SPEC_VALUE_TYPE (specs[x])) { switch (G_PARAM_SPEC_VALUE_TYPE (specs[x])) {
case G_TYPE_INT64: case G_TYPE_INT64:
printf("64 Bit Integer (Default %lld, Range %lld -> %lld)", printf ("64 Bit Integer (Default %lld, Range %lld -> %lld)",
((GParamSpecInt64*)specs[x])->default_value, ((GParamSpecInt64 *) specs[x])->default_value,
((GParamSpecInt64*)specs[x])->minimum, ((GParamSpecInt64 *) specs[x])->minimum,
((GParamSpecInt64*)specs[x])->maximum); ((GParamSpecInt64 *) specs[x])->maximum);
break; break;
case G_TYPE_INT: case G_TYPE_INT:
printf("Integer (Default %d, Range %d -> %d)", printf ("Integer (Default %d, Range %d -> %d)",
((GParamSpecInt*)specs[x])->default_value, ((GParamSpecInt *) specs[x])->default_value,
((GParamSpecInt*)specs[x])->minimum, ((GParamSpecInt *) specs[x])->minimum,
((GParamSpecInt*)specs[x])->maximum); ((GParamSpecInt *) specs[x])->maximum);
break; break;
case G_TYPE_FLOAT: case G_TYPE_FLOAT:
printf("Float. Default: %-8.8s %15.7g\n", "", printf ("Float. Default: %-8.8s %15.7g\n", "",
((GParamSpecFloat*)specs[x])->default_value); ((GParamSpecFloat *) specs[x])->default_value);
printf("%-23.23s Range: %15.7g - %15.7g", "", printf ("%-23.23s Range: %15.7g - %15.7g", "",
((GParamSpecFloat*)specs[x])->minimum, ((GParamSpecFloat *) specs[x])->minimum,
((GParamSpecFloat*)specs[x])->maximum); ((GParamSpecFloat *) specs[x])->maximum);
break; break;
default: printf("unknown %ld", G_PARAM_SPEC_VALUE_TYPE (specs[x])); default: printf ("unknown %ld", G_PARAM_SPEC_VALUE_TYPE (specs[x]));
} }
printf("\n"); printf ("\n");
} }
g_free(specs); g_free (specs);
} }
else { else {
g_print (" none\n"); printf (" none\n");
} }
} }
@ -639,21 +648,21 @@ print_element_info (GstElementFactory *factory)
GSignalQuery *query; GSignalQuery *query;
signals = g_signal_list_ids (G_OBJECT_TYPE (element), &nsignals); signals = g_signal_list_ids (G_OBJECT_TYPE (element), &nsignals);
for (k=0; k<2; k++) { for (k = 0; k < 2; k++) {
gint counted = 0; gint counted = 0;
if (k == 0) if (k == 0)
printf("\nElement Signals:\n"); printf ("\nElement Signals:\n");
else else
printf("\nElement Actions:\n"); printf ("\nElement Actions:\n");
for (i=0; i<nsignals; i++) { for (i = 0; i < nsignals; i++) {
gint n_params; gint n_params;
GType return_type; GType return_type;
const GType *param_types; const GType *param_types;
gint j; gint j;
query = g_new0(GSignalQuery,1); query = g_new0 (GSignalQuery,1);
g_signal_query (signals[i], query); g_signal_query (signals[i], query);
if ((k == 0 && !(query->signal_flags & G_SIGNAL_ACTION)) || if ((k == 0 && !(query->signal_flags & G_SIGNAL_ACTION)) ||
@ -662,10 +671,11 @@ print_element_info (GstElementFactory *factory)
return_type = query->return_type; return_type = query->return_type;
param_types = query->param_types; param_types = query->param_types;
printf (" \"%s\" :\t %s user_function (%s* object, \n", query->signal_name, g_type_name (return_type), printf (" \"%s\" :\t %s user_function (%s* object, \n",
g_type_name (G_OBJECT_TYPE (element))); query->signal_name, g_type_name (return_type),
g_type_name (G_OBJECT_TYPE (element)));
for (j=0; j<n_params; j++) { for (j = 0; j < n_params; j++) {
printf (" \t\t\t\t%s arg%d,\n", g_type_name (param_types[j]), j); printf (" \t\t\t\t%s arg%d,\n", g_type_name (param_types[j]), j);
} }
printf (" \t\t\t\tgpointer user_data);\n"); printf (" \t\t\t\tgpointer user_data);\n");
@ -675,23 +685,23 @@ print_element_info (GstElementFactory *factory)
g_free (query); g_free (query);
} }
if (counted == 0) g_print (" none\n"); if (counted == 0) printf (" none\n");
} }
} }
/* for compound elements */ /* for compound elements */
if (GST_IS_BIN(element)) { if (GST_IS_BIN (element)) {
printf("\nChildren:\n"); printf ("\nChildren:\n");
children = (GList *) gst_bin_get_list(GST_BIN(element)); children = (GList *) gst_bin_get_list (GST_BIN (element));
if (!children) if (!children)
g_print (" none\n"); printf (" none\n");
else { else {
while (children) { while (children) {
child = GST_ELEMENT (children->data); child = GST_ELEMENT (children->data);
children = g_list_next (children); children = g_list_next (children);
g_print(" %s\n",GST_ELEMENT_NAME(child)); printf (" %s\n", GST_ELEMENT_NAME (child));
} }
} }
} }
@ -722,32 +732,38 @@ print_element_list (void)
GstElementFactory *factory; GstElementFactory *factory;
factory = GST_ELEMENT_FACTORY (feature); factory = GST_ELEMENT_FACTORY (feature);
printf("%s: %s: %s\n",plugin->name, GST_PLUGIN_FEATURE_NAME (factory) ,factory->details->longname); printf ("%s: %s: %s\n", plugin->name,
GST_PLUGIN_FEATURE_NAME (factory) ,factory->details->longname);
} }
else if (GST_IS_AUTOPLUG_FACTORY (feature)) { else if (GST_IS_AUTOPLUG_FACTORY (feature)) {
GstAutoplugFactory *factory; GstAutoplugFactory *factory;
factory = GST_AUTOPLUG_FACTORY (feature); factory = GST_AUTOPLUG_FACTORY (feature);
printf("%s: %s: %s\n", plugin->name, GST_PLUGIN_FEATURE_NAME (factory), factory->longdesc); printf ("%s: %s: %s\n", plugin->name,
GST_PLUGIN_FEATURE_NAME (factory), factory->longdesc);
} }
else if (GST_IS_TYPE_FACTORY (feature)) { else if (GST_IS_TYPE_FACTORY (feature)) {
GstTypeFactory *factory; GstTypeFactory *factory;
factory = GST_TYPE_FACTORY (feature); factory = GST_TYPE_FACTORY (feature);
printf("%s type: %s: %s\n", plugin->name, factory->mime, factory->exts); printf ("%s type: %s: %s\n", plugin->name,
factory->mime, factory->exts);
if (factory->typefindfunc) if (factory->typefindfunc)
printf(" Has typefind function: %s\n",GST_DEBUG_FUNCPTR_NAME(factory->typefindfunc)); printf (" Has typefind function: %s\n",
GST_DEBUG_FUNCPTR_NAME (factory->typefindfunc));
} }
else if (GST_IS_SCHEDULER_FACTORY (feature)) { else if (GST_IS_SCHEDULER_FACTORY (feature)) {
GstSchedulerFactory *factory; GstSchedulerFactory *factory;
factory = GST_SCHEDULER_FACTORY (feature); factory = GST_SCHEDULER_FACTORY (feature);
printf("%s: %s: %s\n", plugin->name, GST_PLUGIN_FEATURE_NAME (factory), factory->longdesc); printf ("%s: %s: %s\n", plugin->name,
GST_PLUGIN_FEATURE_NAME (factory), factory->longdesc);
} }
else { else {
printf("%s: %s (%s)\n", plugin->name, GST_PLUGIN_FEATURE_NAME (feature), printf ("%s: %s (%s)\n", plugin->name,
g_type_name (G_OBJECT_TYPE (feature))); GST_PLUGIN_FEATURE_NAME (feature),
g_type_name (G_OBJECT_TYPE (feature)));
} }
features = g_list_next (features); features = g_list_next (features);
@ -760,11 +776,11 @@ print_plugin_info (GstPlugin *plugin)
{ {
GList *features; GList *features;
printf("Plugin Details:\n"); printf ("Plugin Details:\n");
printf(" Name:\t\t%s\n",plugin->name); printf (" Name:\t\t%s\n", plugin->name);
printf(" Long Name:\t%s\n",plugin->longname); printf (" Long Name:\t%s\n", plugin->longname);
printf(" Filename:\t%s\n",plugin->filename); printf (" Filename:\t%s\n", plugin->filename);
printf("\n"); printf ("\n");
features = gst_plugin_get_feature_list (plugin); features = gst_plugin_get_feature_list (plugin);
@ -777,38 +793,40 @@ print_plugin_info (GstPlugin *plugin)
GstElementFactory *factory; GstElementFactory *factory;
factory = GST_ELEMENT_FACTORY (feature); factory = GST_ELEMENT_FACTORY (feature);
printf(" %s: %s\n", GST_OBJECT_NAME (factory) ,factory->details->longname); printf (" %s: %s\n", GST_OBJECT_NAME (factory),
factory->details->longname);
} }
else if (GST_IS_AUTOPLUG_FACTORY (feature)) { else if (GST_IS_AUTOPLUG_FACTORY (feature)) {
GstAutoplugFactory *factory; GstAutoplugFactory *factory;
factory = GST_AUTOPLUG_FACTORY (feature); factory = GST_AUTOPLUG_FACTORY (feature);
printf(" %s: %s\n", GST_OBJECT_NAME (factory), factory->longdesc); printf (" %s: %s\n", GST_OBJECT_NAME (factory), factory->longdesc);
} }
else if (GST_IS_TYPE_FACTORY (feature)) { else if (GST_IS_TYPE_FACTORY (feature)) {
GstTypeFactory *factory; GstTypeFactory *factory;
factory = GST_TYPE_FACTORY (feature); factory = GST_TYPE_FACTORY (feature);
printf(" %s: %s\n", factory->mime, factory->exts); printf (" %s: %s\n", factory->mime, factory->exts);
if (factory->typefindfunc) if (factory->typefindfunc)
printf(" Has typefind function: %s\n",GST_DEBUG_FUNCPTR_NAME(factory->typefindfunc)); printf (" Has typefind function: %s\n",
GST_DEBUG_FUNCPTR_NAME (factory->typefindfunc));
} }
else if (GST_IS_SCHEDULER_FACTORY (feature)) { else if (GST_IS_SCHEDULER_FACTORY (feature)) {
GstSchedulerFactory *factory; GstSchedulerFactory *factory;
factory = GST_SCHEDULER_FACTORY (feature); factory = GST_SCHEDULER_FACTORY (feature);
printf(" %s: %s\n", GST_OBJECT_NAME (factory), factory->longdesc); printf (" %s: %s\n", GST_OBJECT_NAME (factory), factory->longdesc);
} }
else { else {
printf(" %s (%s)\n", gst_object_get_name (GST_OBJECT (feature)), printf (" %s (%s)\n", gst_object_get_name (GST_OBJECT (feature)),
g_type_name (G_OBJECT_TYPE (feature))); g_type_name (G_OBJECT_TYPE (feature)));
} }
features = g_list_next (features); features = g_list_next (features);
} }
printf("\n"); printf ("\n");
} }
@ -819,8 +837,8 @@ main (int argc, char *argv[])
GstPlugin *plugin; GstPlugin *plugin;
gchar *so; gchar *so;
gst_init(&argc,&argv); gst_init (&argc, &argv);
gst_control_init(&argc,&argv); gst_control_init (&argc, &argv);
/* if no arguments, print out list of elements */ /* if no arguments, print out list of elements */
if (argc == 1) { if (argc == 1) {
@ -829,20 +847,21 @@ main (int argc, char *argv[])
/* else we try to get a factory */ /* else we try to get a factory */
} else { } else {
/* first check for help */ /* first check for help */
if (strstr(argv[1],"-help")) { if (strstr (argv[1], "-help")) {
printf("Usage: %s\t\t\tList all registered elements\n",argv[0]); printf ("Usage: %s\t\t\tList all registered elements\n",argv[0]);
printf(" %s element-name\tShow element details\n",argv[0]); printf (" %s element-name\tShow element details\n",argv[0]);
printf(" %s plugin-name[.so]\tShow information about plugin\n",argv[0]); printf (" %s plugin-name[.so]\tShow information about plugin\n",
argv[0]);
return 0; return 0;
} }
/* only search for a factory if there's not a '.so' */ /* only search for a factory if there's not a '.so' */
if (! strstr(argv[1],".so")) { if (! strstr (argv[1], ".so")) {
factory = gst_element_factory_find (argv[1]); factory = gst_element_factory_find (argv[1]);
/* if there's a factory, print out the info */ /* if there's a factory, print out the info */
if (factory) if (factory)
return print_element_info(factory); return print_element_info (factory);
} else { } else {
/* strip the .so */ /* strip the .so */
so = strstr(argv[1],".so"); so = strstr(argv[1],".so");
@ -855,10 +874,10 @@ main (int argc, char *argv[])
/* if there is such a plugin, print out info */ /* if there is such a plugin, print out info */
if (plugin) { if (plugin) {
print_plugin_info(plugin); print_plugin_info (plugin);
} else { } else {
printf("no such element or plugin '%s'\n",argv[1]); printf("no such element or plugin '%s'\n", argv[1]);
return -1; return -1;
} }
} }