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

@ -361,7 +361,7 @@ print_element_info (GstElementFactory *factory)
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;
} }
@ -476,7 +476,8 @@ print_element_info (GstElementFactory *factory)
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");
@ -531,36 +532,44 @@ print_element_info (GstElementFactory *factory)
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");
@ -627,7 +636,7 @@ print_element_info (GstElementFactory *factory)
g_free (specs); g_free (specs);
} }
else { else {
g_print (" none\n"); printf (" none\n");
} }
} }
@ -662,7 +671,8 @@ 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",
query->signal_name, g_type_name (return_type),
g_type_name (G_OBJECT_TYPE (element))); g_type_name (G_OBJECT_TYPE (element)));
for (j = 0; j < n_params; j++) { for (j = 0; j < n_params; j++) {
@ -675,7 +685,7 @@ print_element_info (GstElementFactory *factory)
g_free (query); g_free (query);
} }
if (counted == 0) g_print (" none\n"); if (counted == 0) printf (" none\n");
} }
} }
@ -685,13 +695,13 @@ print_element_info (GstElementFactory *factory)
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,31 +732,37 @@ 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,
GST_PLUGIN_FEATURE_NAME (feature),
g_type_name (G_OBJECT_TYPE (feature))); g_type_name (G_OBJECT_TYPE (feature)));
} }
@ -777,7 +793,8 @@ 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;
@ -792,7 +809,8 @@ print_plugin_info (GstPlugin *plugin)
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;
@ -832,7 +850,8 @@ main (int argc, char *argv[])
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;
} }