2001-01-03 07:38:45 +00:00
|
|
|
#include <gst/gst.h>
|
2001-01-04 10:47:39 +00:00
|
|
|
#include <string.h>
|
2001-01-03 07:38:45 +00:00
|
|
|
|
Updates, it prints a lot more stuff now, like padtemplates, caps/props, and arguments. More stuff can be done, but n...
Original commit message from CVS:
Updates, it prints a lot more stuff now, like padtemplates, caps/props,
and arguments. More stuff can be done, but not now, I must sleep.
2001-01-03 08:48:36 +00:00
|
|
|
// this must be built within the gstreamer dir, else this will fail
|
|
|
|
#include <gst/gstpropsprivate.h>
|
|
|
|
|
|
|
|
void print_prop(GstPropsEntry *prop,gboolean showname,gchar *pfx) {
|
|
|
|
GList *list;
|
|
|
|
GstPropsEntry *listentry;
|
|
|
|
gchar *longprefix;
|
|
|
|
|
|
|
|
if (showname)
|
|
|
|
printf("%s%s: ",pfx,g_quark_to_string(prop->propid));
|
|
|
|
else
|
|
|
|
printf(pfx);
|
|
|
|
|
|
|
|
switch (prop->propstype) {
|
2001-04-14 18:56:37 +00:00
|
|
|
case GST_PROPS_INT_ID:
|
Updates, it prints a lot more stuff now, like padtemplates, caps/props, and arguments. More stuff can be done, but n...
Original commit message from CVS:
Updates, it prints a lot more stuff now, like padtemplates, caps/props,
and arguments. More stuff can be done, but not now, I must sleep.
2001-01-03 08:48:36 +00:00
|
|
|
printf("Integer: %d\n",prop->data.int_data);
|
|
|
|
break;
|
2001-04-14 18:56:37 +00:00
|
|
|
case GST_PROPS_INT_RANGE_ID:
|
Updates, it prints a lot more stuff now, like padtemplates, caps/props, and arguments. More stuff can be done, but n...
Original commit message from CVS:
Updates, it prints a lot more stuff now, like padtemplates, caps/props,
and arguments. More stuff can be done, but not now, I must sleep.
2001-01-03 08:48:36 +00:00
|
|
|
printf("Integer range: %d - %d\n",prop->data.int_range_data.min,
|
|
|
|
prop->data.int_range_data.max);
|
|
|
|
break;
|
2001-04-28 19:16:30 +00:00
|
|
|
case GST_PROPS_FLOAT_ID:
|
|
|
|
printf("Float: %f\n",prop->data.float_data);
|
|
|
|
break;
|
|
|
|
case GST_PROPS_FLOAT_RANGE_ID:
|
|
|
|
printf("Float range: %f - %f\n",prop->data.float_range_data.min,
|
|
|
|
prop->data.float_range_data.max);
|
|
|
|
break;
|
2001-04-14 18:56:37 +00:00
|
|
|
case GST_PROPS_BOOL_ID:
|
Updates, it prints a lot more stuff now, like padtemplates, caps/props, and arguments. More stuff can be done, but n...
Original commit message from CVS:
Updates, it prints a lot more stuff now, like padtemplates, caps/props,
and arguments. More stuff can be done, but not now, I must sleep.
2001-01-03 08:48:36 +00:00
|
|
|
printf("Boolean: %s\n",prop->data.bool_data ? "TRUE" : "FALSE");
|
|
|
|
break;
|
2001-04-14 18:56:37 +00:00
|
|
|
case GST_PROPS_STRING_ID:
|
2001-03-24 17:22:03 +00:00
|
|
|
printf("String: %s\n",prop->data.string_data.string);
|
|
|
|
break;
|
2001-04-14 18:56:37 +00:00
|
|
|
case GST_PROPS_FOURCC_ID:
|
2001-05-27 23:57:34 +00:00
|
|
|
printf("FourCC: '%c%c%c%c'\n",
|
2001-01-04 18:57:29 +00:00
|
|
|
prop->data.fourcc_data & 0xff,prop->data.fourcc_data>>8 & 0xff,
|
|
|
|
prop->data.fourcc_data>>16 & 0xff,prop->data.fourcc_data>>24 & 0xff);
|
Updates, it prints a lot more stuff now, like padtemplates, caps/props, and arguments. More stuff can be done, but n...
Original commit message from CVS:
Updates, it prints a lot more stuff now, like padtemplates, caps/props,
and arguments. More stuff can be done, but not now, I must sleep.
2001-01-03 08:48:36 +00:00
|
|
|
break;
|
2001-04-14 18:56:37 +00:00
|
|
|
case GST_PROPS_LIST_ID:
|
Updates, it prints a lot more stuff now, like padtemplates, caps/props, and arguments. More stuff can be done, but n...
Original commit message from CVS:
Updates, it prints a lot more stuff now, like padtemplates, caps/props,
and arguments. More stuff can be done, but not now, I must sleep.
2001-01-03 08:48:36 +00:00
|
|
|
printf("List:\n");
|
|
|
|
longprefix = g_strdup_printf("%s ",pfx);
|
|
|
|
list = prop->data.list_data.entries;
|
|
|
|
while (list) {
|
|
|
|
listentry = (GstPropsEntry*)(list->data);
|
|
|
|
list = g_list_next(list);
|
|
|
|
print_prop(listentry,FALSE,longprefix);
|
|
|
|
}
|
|
|
|
g_free(longprefix);
|
|
|
|
break;
|
|
|
|
default:
|
2001-03-07 21:52:56 +00:00
|
|
|
printf("unknown props %d\n", prop->propstype);
|
Updates, it prints a lot more stuff now, like padtemplates, caps/props, and arguments. More stuff can be done, but n...
Original commit message from CVS:
Updates, it prints a lot more stuff now, like padtemplates, caps/props,
and arguments. More stuff can be done, but not now, I must sleep.
2001-01-03 08:48:36 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
void print_props(GstProps *properties,gchar *pfx) {
|
2001-01-03 20:21:22 +00:00
|
|
|
GList *props;
|
Updates, it prints a lot more stuff now, like padtemplates, caps/props, and arguments. More stuff can be done, but n...
Original commit message from CVS:
Updates, it prints a lot more stuff now, like padtemplates, caps/props,
and arguments. More stuff can be done, but not now, I must sleep.
2001-01-03 08:48:36 +00:00
|
|
|
GstPropsEntry *prop;
|
|
|
|
|
|
|
|
props = properties->properties;
|
|
|
|
while (props) {
|
|
|
|
prop = (GstPropsEntry*)(props->data);
|
2001-01-03 20:21:22 +00:00
|
|
|
props = g_list_next(props);
|
Updates, it prints a lot more stuff now, like padtemplates, caps/props, and arguments. More stuff can be done, but n...
Original commit message from CVS:
Updates, it prints a lot more stuff now, like padtemplates, caps/props,
and arguments. More stuff can be done, but not now, I must sleep.
2001-01-03 08:48:36 +00:00
|
|
|
|
|
|
|
print_prop(prop,TRUE,pfx);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2001-03-07 21:52:56 +00:00
|
|
|
gint
|
|
|
|
print_element_info (GstElementFactory *factory)
|
|
|
|
{
|
2001-01-03 07:38:45 +00:00
|
|
|
GstElement *element;
|
2001-01-29 00:06:02 +00:00
|
|
|
GstObjectClass *gstobject_class;
|
2001-01-03 07:38:45 +00:00
|
|
|
GstElementClass *gstelement_class;
|
2001-03-13 22:21:29 +00:00
|
|
|
GList *pads;
|
|
|
|
GstCaps *caps;
|
2001-01-03 07:38:45 +00:00
|
|
|
GstPad *pad;
|
2001-01-19 02:23:35 +00:00
|
|
|
GstRealPad *realpad;
|
Updates, it prints a lot more stuff now, like padtemplates, caps/props, and arguments. More stuff can be done, but n...
Original commit message from CVS:
Updates, it prints a lot more stuff now, like padtemplates, caps/props,
and arguments. More stuff can be done, but not now, I must sleep.
2001-01-03 08:48:36 +00:00
|
|
|
GstPadTemplate *padtemplate;
|
2001-06-04 14:50:21 +00:00
|
|
|
GtkArg *args, *args2;
|
Updates, it prints a lot more stuff now, like padtemplates, caps/props, and arguments. More stuff can be done, but n...
Original commit message from CVS:
Updates, it prints a lot more stuff now, like padtemplates, caps/props,
and arguments. More stuff can be done, but not now, I must sleep.
2001-01-03 08:48:36 +00:00
|
|
|
guint32 *flags;
|
|
|
|
gint num_args,i;
|
2001-05-25 21:00:07 +00:00
|
|
|
GList *children;
|
|
|
|
GstElement *child;
|
2001-05-20 20:12:45 +00:00
|
|
|
gboolean have_flags;
|
2001-01-03 07:38:45 +00:00
|
|
|
|
2001-01-04 10:47:39 +00:00
|
|
|
element = gst_elementfactory_create(factory,"element");
|
|
|
|
if (!element) {
|
|
|
|
g_print ("couldn't construct element for some reason\n");
|
2001-01-03 20:21:22 +00:00
|
|
|
return -1;
|
|
|
|
}
|
2001-01-29 00:06:02 +00:00
|
|
|
|
|
|
|
gstobject_class = GST_OBJECT_CLASS (GTK_OBJECT (element)->klass);
|
2001-01-03 07:38:45 +00:00
|
|
|
gstelement_class = GST_ELEMENT_CLASS (GTK_OBJECT (element)->klass);
|
|
|
|
|
Updates, it prints a lot more stuff now, like padtemplates, caps/props, and arguments. More stuff can be done, but n...
Original commit message from CVS:
Updates, it prints a lot more stuff now, like padtemplates, caps/props,
and arguments. More stuff can be done, but not now, I must sleep.
2001-01-03 08:48:36 +00:00
|
|
|
printf("Factory Details:\n");
|
2001-01-03 07:38:45 +00:00
|
|
|
printf(" Long name:\t%s\n",factory->details->longname);
|
|
|
|
printf(" Class:\t%s\n",factory->details->klass);
|
|
|
|
printf(" Description:\t%s\n",factory->details->description);
|
|
|
|
printf(" Version:\t%s\n",factory->details->version);
|
|
|
|
printf(" Author(s):\t%s\n",factory->details->author);
|
|
|
|
printf(" Copyright:\t%s\n",factory->details->copyright);
|
|
|
|
printf("\n");
|
|
|
|
|
Updates, it prints a lot more stuff now, like padtemplates, caps/props, and arguments. More stuff can be done, but n...
Original commit message from CVS:
Updates, it prints a lot more stuff now, like padtemplates, caps/props,
and arguments. More stuff can be done, but not now, I must sleep.
2001-01-03 08:48:36 +00:00
|
|
|
printf("Pad Templates:\n");
|
2001-01-03 20:55:16 +00:00
|
|
|
if (factory->numpadtemplates) {
|
Updates, it prints a lot more stuff now, like padtemplates, caps/props, and arguments. More stuff can be done, but n...
Original commit message from CVS:
Updates, it prints a lot more stuff now, like padtemplates, caps/props,
and arguments. More stuff can be done, but not now, I must sleep.
2001-01-03 08:48:36 +00:00
|
|
|
pads = factory->padtemplates;
|
|
|
|
while (pads) {
|
|
|
|
padtemplate = (GstPadTemplate*)(pads->data);
|
|
|
|
pads = g_list_next(pads);
|
|
|
|
|
|
|
|
if (padtemplate->direction == GST_PAD_SRC)
|
|
|
|
printf(" SRC template: '%s'\n",padtemplate->name_template);
|
|
|
|
else if (padtemplate->direction == GST_PAD_SINK)
|
|
|
|
printf(" SINK template: '%s'\n",padtemplate->name_template);
|
|
|
|
else
|
|
|
|
printf(" UNKNOWN!!! template: '%s'\n",padtemplate->name_template);
|
|
|
|
|
|
|
|
if (padtemplate->presence == GST_PAD_ALWAYS)
|
|
|
|
printf(" Exists: Always\n");
|
|
|
|
else if (padtemplate->presence == GST_PAD_SOMETIMES)
|
|
|
|
printf(" Exists: Sometimes\n");
|
2001-01-19 00:07:10 +00:00
|
|
|
else if (padtemplate->presence == GST_PAD_REQUEST)
|
|
|
|
printf(" Exists: Request\n");
|
Updates, it prints a lot more stuff now, like padtemplates, caps/props, and arguments. More stuff can be done, but n...
Original commit message from CVS:
Updates, it prints a lot more stuff now, like padtemplates, caps/props,
and arguments. More stuff can be done, but not now, I must sleep.
2001-01-03 08:48:36 +00:00
|
|
|
else
|
|
|
|
printf(" Exists: UNKNOWN!!!\n");
|
|
|
|
|
|
|
|
if (padtemplate->caps) {
|
|
|
|
printf(" Capabilities:\n");
|
|
|
|
caps = padtemplate->caps;
|
|
|
|
while (caps) {
|
2001-01-03 20:21:22 +00:00
|
|
|
GstType *type;
|
|
|
|
|
2001-03-13 22:21:29 +00:00
|
|
|
printf(" '%s':\n",caps->name);
|
2001-01-03 20:21:22 +00:00
|
|
|
|
2001-03-13 22:21:29 +00:00
|
|
|
type = gst_type_find_by_id (caps->id);
|
2001-01-03 20:21:22 +00:00
|
|
|
if (type)
|
|
|
|
printf(" MIME type: '%s':\n",type->mime);
|
|
|
|
else
|
|
|
|
printf(" MIME type: 'unknown/unknown':\n");
|
|
|
|
|
2001-03-13 22:21:29 +00:00
|
|
|
if (caps->properties)
|
|
|
|
print_props(caps->properties," ");
|
|
|
|
|
|
|
|
caps = caps->next;
|
Updates, it prints a lot more stuff now, like padtemplates, caps/props, and arguments. More stuff can be done, but n...
Original commit message from CVS:
Updates, it prints a lot more stuff now, like padtemplates, caps/props,
and arguments. More stuff can be done, but not now, I must sleep.
2001-01-03 08:48:36 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
printf("\n");
|
|
|
|
}
|
|
|
|
} else
|
2001-05-25 21:00:07 +00:00
|
|
|
printf(" none\n");
|
Updates, it prints a lot more stuff now, like padtemplates, caps/props, and arguments. More stuff can be done, but n...
Original commit message from CVS:
Updates, it prints a lot more stuff now, like padtemplates, caps/props,
and arguments. More stuff can be done, but not now, I must sleep.
2001-01-03 08:48:36 +00:00
|
|
|
|
2001-05-20 20:12:45 +00:00
|
|
|
have_flags = FALSE;
|
|
|
|
|
2001-01-03 07:38:45 +00:00
|
|
|
printf("Element Flags:\n");
|
2001-05-20 20:12:45 +00:00
|
|
|
if (GST_FLAG_IS_SET(element,GST_ELEMENT_COMPLEX)) {
|
2001-01-03 07:38:45 +00:00
|
|
|
printf(" GST_ELEMENT_COMPLEX\n");
|
2001-05-20 20:12:45 +00:00
|
|
|
have_flags = TRUE;
|
|
|
|
}
|
|
|
|
if (GST_FLAG_IS_SET(element,GST_ELEMENT_DECOUPLED)) {
|
2001-01-03 07:38:45 +00:00
|
|
|
printf(" GST_ELEMENT_DECOUPLED\n");
|
2001-05-20 20:12:45 +00:00
|
|
|
have_flags = TRUE;
|
|
|
|
}
|
|
|
|
if (GST_FLAG_IS_SET(element,GST_ELEMENT_THREAD_SUGGESTED)) {
|
2001-01-03 07:38:45 +00:00
|
|
|
printf(" GST_ELEMENT_THREADSUGGESTED\n");
|
2001-05-20 20:12:45 +00:00
|
|
|
have_flags = TRUE;
|
|
|
|
}
|
|
|
|
if (GST_FLAG_IS_SET(element,GST_ELEMENT_NO_SEEK)) {
|
2001-01-03 07:38:45 +00:00
|
|
|
printf(" GST_ELEMENT_NO_SEEK\n");
|
2001-05-20 20:12:45 +00:00
|
|
|
have_flags = TRUE;
|
|
|
|
}
|
|
|
|
if (!have_flags)
|
2001-01-03 07:38:45 +00:00
|
|
|
printf(" no flags set\n");
|
|
|
|
|
|
|
|
|
2001-05-25 21:00:07 +00:00
|
|
|
|
|
|
|
printf("\nElement Implementation:\n");
|
|
|
|
|
2001-01-03 07:38:45 +00:00
|
|
|
if (element->loopfunc)
|
2001-05-25 21:00:07 +00:00
|
|
|
printf(" loopfunc()-based element: %s\n",GST_DEBUG_FUNCPTR_NAME(element->loopfunc));
|
2001-01-03 07:38:45 +00:00
|
|
|
else
|
|
|
|
printf(" No loopfunc(), must be chain-based or not configured yet\n");
|
|
|
|
|
2001-05-25 21:00:07 +00:00
|
|
|
printf(" Has change_state() function: %s\n",
|
|
|
|
GST_DEBUG_FUNCPTR_NAME(gstelement_class->change_state));
|
|
|
|
printf(" Has custom save_thyself() function: %s\n",
|
|
|
|
GST_DEBUG_FUNCPTR_NAME(gstobject_class->save_thyself));
|
|
|
|
printf(" Has custom restore_thyself() function: %s\n",
|
|
|
|
GST_DEBUG_FUNCPTR_NAME(gstobject_class->restore_thyself));
|
2001-01-03 07:38:45 +00:00
|
|
|
|
2001-05-25 21:00:07 +00:00
|
|
|
|
|
|
|
|
|
|
|
printf("\nPads:\n");
|
Updates, it prints a lot more stuff now, like padtemplates, caps/props, and arguments. More stuff can be done, but n...
Original commit message from CVS:
Updates, it prints a lot more stuff now, like padtemplates, caps/props,
and arguments. More stuff can be done, but not now, I must sleep.
2001-01-03 08:48:36 +00:00
|
|
|
if (element->numpads) {
|
|
|
|
pads = gst_element_get_pad_list(element);
|
|
|
|
while (pads) {
|
|
|
|
pad = GST_PAD(pads->data);
|
|
|
|
pads = g_list_next(pads);
|
2001-05-25 21:00:07 +00:00
|
|
|
realpad = GST_PAD_REALIZE(pad);
|
Updates, it prints a lot more stuff now, like padtemplates, caps/props, and arguments. More stuff can be done, but n...
Original commit message from CVS:
Updates, it prints a lot more stuff now, like padtemplates, caps/props,
and arguments. More stuff can be done, but not now, I must sleep.
2001-01-03 08:48:36 +00:00
|
|
|
|
|
|
|
if (gst_pad_get_direction(pad) == GST_PAD_SRC)
|
2001-05-25 21:00:07 +00:00
|
|
|
printf(" SRC: '%s'",gst_pad_get_name(pad));
|
Updates, it prints a lot more stuff now, like padtemplates, caps/props, and arguments. More stuff can be done, but n...
Original commit message from CVS:
Updates, it prints a lot more stuff now, like padtemplates, caps/props,
and arguments. More stuff can be done, but not now, I must sleep.
2001-01-03 08:48:36 +00:00
|
|
|
else if (gst_pad_get_direction(pad) == GST_PAD_SINK)
|
2001-05-25 21:00:07 +00:00
|
|
|
printf(" SINK: '%s'",gst_pad_get_name(pad));
|
2001-01-03 07:38:45 +00:00
|
|
|
else
|
Updates, it prints a lot more stuff now, like padtemplates, caps/props, and arguments. More stuff can be done, but n...
Original commit message from CVS:
Updates, it prints a lot more stuff now, like padtemplates, caps/props,
and arguments. More stuff can be done, but not now, I must sleep.
2001-01-03 08:48:36 +00:00
|
|
|
printf(" UNKNOWN!!!: '%s'\n",gst_pad_get_name(pad));
|
|
|
|
|
2001-05-25 21:00:07 +00:00
|
|
|
if (GST_IS_GHOST_PAD(pad))
|
|
|
|
printf(", ghost of real pad %s:%s\n",GST_DEBUG_PAD_NAME(realpad));
|
|
|
|
else
|
|
|
|
printf("\n");
|
|
|
|
|
Updates, it prints a lot more stuff now, like padtemplates, caps/props, and arguments. More stuff can be done, but n...
Original commit message from CVS:
Updates, it prints a lot more stuff now, like padtemplates, caps/props,
and arguments. More stuff can be done, but not now, I must sleep.
2001-01-03 08:48:36 +00:00
|
|
|
printf(" Implementation:\n");
|
2001-01-19 02:23:35 +00:00
|
|
|
if (realpad->chainfunc)
|
|
|
|
printf(" Has chainfunc(): %s\n",GST_DEBUG_FUNCPTR_NAME(realpad->chainfunc));
|
|
|
|
if (realpad->getfunc)
|
|
|
|
printf(" Has getfunc(): %s\n",GST_DEBUG_FUNCPTR_NAME(realpad->getfunc));
|
|
|
|
if (realpad->getregionfunc)
|
|
|
|
printf(" Has getregionfunc(): %s\n",GST_DEBUG_FUNCPTR_NAME(realpad->getregionfunc));
|
|
|
|
if (realpad->qosfunc)
|
|
|
|
printf(" Has qosfunc(): %s\n",GST_DEBUG_FUNCPTR_NAME(realpad->qosfunc));
|
2001-05-25 21:00:07 +00:00
|
|
|
if (realpad->eosfunc != gst_pad_eos_func) {
|
2001-01-21 23:20:46 +00:00
|
|
|
printf(" Has eosfunc(): %s\n",GST_DEBUG_FUNCPTR_NAME(realpad->eosfunc));
|
2001-01-03 20:55:16 +00:00
|
|
|
}
|
Updates, it prints a lot more stuff now, like padtemplates, caps/props, and arguments. More stuff can be done, but n...
Original commit message from CVS:
Updates, it prints a lot more stuff now, like padtemplates, caps/props,
and arguments. More stuff can be done, but not now, I must sleep.
2001-01-03 08:48:36 +00:00
|
|
|
|
|
|
|
if (pad->padtemplate)
|
|
|
|
printf(" Pad Template: '%s'\n",pad->padtemplate->name_template);
|
|
|
|
|
2001-01-19 02:23:35 +00:00
|
|
|
if (realpad->caps) {
|
Updates, it prints a lot more stuff now, like padtemplates, caps/props, and arguments. More stuff can be done, but n...
Original commit message from CVS:
Updates, it prints a lot more stuff now, like padtemplates, caps/props,
and arguments. More stuff can be done, but not now, I must sleep.
2001-01-03 08:48:36 +00:00
|
|
|
printf(" Capabilities:\n");
|
2001-01-19 02:23:35 +00:00
|
|
|
caps = realpad->caps;
|
Updates, it prints a lot more stuff now, like padtemplates, caps/props, and arguments. More stuff can be done, but n...
Original commit message from CVS:
Updates, it prints a lot more stuff now, like padtemplates, caps/props,
and arguments. More stuff can be done, but not now, I must sleep.
2001-01-03 08:48:36 +00:00
|
|
|
while (caps) {
|
2001-01-04 19:16:57 +00:00
|
|
|
GstType *type;
|
|
|
|
|
2001-03-13 22:21:29 +00:00
|
|
|
printf(" '%s':\n",caps->name);
|
2001-01-04 19:16:57 +00:00
|
|
|
|
2001-03-13 22:21:29 +00:00
|
|
|
type = gst_type_find_by_id (caps->id);
|
2001-01-04 19:16:57 +00:00
|
|
|
if (type)
|
|
|
|
printf(" MIME type: '%s':\n",type->mime);
|
|
|
|
else
|
|
|
|
printf(" MIME type: 'unknown/unknown':\n");
|
|
|
|
|
2001-03-13 22:21:29 +00:00
|
|
|
if (caps->properties)
|
|
|
|
print_props(caps->properties," ");
|
|
|
|
|
|
|
|
caps = caps->next;
|
Updates, it prints a lot more stuff now, like padtemplates, caps/props, and arguments. More stuff can be done, but n...
Original commit message from CVS:
Updates, it prints a lot more stuff now, like padtemplates, caps/props,
and arguments. More stuff can be done, but not now, I must sleep.
2001-01-03 08:48:36 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
} else
|
2001-05-25 21:00:07 +00:00
|
|
|
printf(" none\n");
|
|
|
|
|
|
|
|
|
Updates, it prints a lot more stuff now, like padtemplates, caps/props, and arguments. More stuff can be done, but n...
Original commit message from CVS:
Updates, it prints a lot more stuff now, like padtemplates, caps/props,
and arguments. More stuff can be done, but not now, I must sleep.
2001-01-03 08:48:36 +00:00
|
|
|
|
2001-05-25 21:00:07 +00:00
|
|
|
printf("\nElement Arguments:\n");
|
Updates, it prints a lot more stuff now, like padtemplates, caps/props, and arguments. More stuff can be done, but n...
Original commit message from CVS:
Updates, it prints a lot more stuff now, like padtemplates, caps/props,
and arguments. More stuff can be done, but not now, I must sleep.
2001-01-03 08:48:36 +00:00
|
|
|
args = gtk_object_query_args(GTK_OBJECT_TYPE(element), &flags, &num_args);
|
2001-06-04 14:50:21 +00:00
|
|
|
args2 = gtk_object_query_args(GTK_OBJECT_TYPE(element), &flags, &num_args);
|
Updates, it prints a lot more stuff now, like padtemplates, caps/props, and arguments. More stuff can be done, but n...
Original commit message from CVS:
Updates, it prints a lot more stuff now, like padtemplates, caps/props,
and arguments. More stuff can be done, but not now, I must sleep.
2001-01-03 08:48:36 +00:00
|
|
|
for (i=0;i<num_args;i++) {
|
|
|
|
|
2001-01-19 02:23:35 +00:00
|
|
|
// FIXME should say whether it's read-only or not
|
2001-06-04 14:50:21 +00:00
|
|
|
gtk_object_getv (GTK_OBJECT (element), num_args, args2);
|
2001-01-19 02:23:35 +00:00
|
|
|
|
2001-06-05 17:45:52 +00:00
|
|
|
printf(" %-40.40s: ",args[i].name);
|
Updates, it prints a lot more stuff now, like padtemplates, caps/props, and arguments. More stuff can be done, but n...
Original commit message from CVS:
Updates, it prints a lot more stuff now, like padtemplates, caps/props,
and arguments. More stuff can be done, but not now, I must sleep.
2001-01-03 08:48:36 +00:00
|
|
|
switch (args[i].type) {
|
2001-06-04 14:50:21 +00:00
|
|
|
case GTK_TYPE_STRING: printf("String (Default \"%s\")", GTK_VALUE_STRING (args2[i]));break;
|
|
|
|
case GTK_TYPE_BOOL: printf("Boolean (Default %s)", (GTK_VALUE_BOOL (args2[i])?"true":"false"));break;
|
|
|
|
case GTK_TYPE_ULONG: printf("Unsigned Long (Default %lu)", GTK_VALUE_ULONG (args2[i]));break;
|
|
|
|
case GTK_TYPE_LONG: printf("Long (Default %ld)", GTK_VALUE_LONG (args2[i]));break;
|
|
|
|
case GTK_TYPE_UINT: printf("Unsigned Integer (Default %u)", GTK_VALUE_UINT (args2[i]));break;
|
|
|
|
case GTK_TYPE_INT: printf("Integer (Default %d)", GTK_VALUE_INT (args2[i]));break;
|
|
|
|
case GTK_TYPE_FLOAT: printf("Float (Default %f)", GTK_VALUE_FLOAT (args2[i]));break;
|
|
|
|
case GTK_TYPE_DOUBLE: printf("Double (Default %lf)", GTK_VALUE_DOUBLE (args2[i]));break;
|
Updates, it prints a lot more stuff now, like padtemplates, caps/props, and arguments. More stuff can be done, but n...
Original commit message from CVS:
Updates, it prints a lot more stuff now, like padtemplates, caps/props,
and arguments. More stuff can be done, but not now, I must sleep.
2001-01-03 08:48:36 +00:00
|
|
|
default:
|
|
|
|
if (args[i].type == GST_TYPE_FILENAME)
|
|
|
|
printf("Filename");
|
2001-01-04 18:57:29 +00:00
|
|
|
else if (GTK_FUNDAMENTAL_TYPE (args[i].type) == GTK_TYPE_ENUM) {
|
|
|
|
GtkEnumValue *values;
|
|
|
|
guint j = 0;
|
|
|
|
|
|
|
|
printf("Enum (default %d)", GTK_VALUE_ENUM (args[i]));
|
|
|
|
values = gtk_type_enum_get_values (args[i].type);
|
|
|
|
while (values[j].value_name) {
|
|
|
|
printf("\n (%d): \t%s", values[j].value, values[j].value_nick);
|
|
|
|
j++;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
else if (args[i].type == GTK_TYPE_WIDGET)
|
|
|
|
printf("GtkWidget");
|
Updates, it prints a lot more stuff now, like padtemplates, caps/props, and arguments. More stuff can be done, but n...
Original commit message from CVS:
Updates, it prints a lot more stuff now, like padtemplates, caps/props,
and arguments. More stuff can be done, but not now, I must sleep.
2001-01-03 08:48:36 +00:00
|
|
|
else
|
2001-05-20 21:24:59 +00:00
|
|
|
printf("unknown %d", args[i].type);
|
Updates, it prints a lot more stuff now, like padtemplates, caps/props, and arguments. More stuff can be done, but n...
Original commit message from CVS:
Updates, it prints a lot more stuff now, like padtemplates, caps/props,
and arguments. More stuff can be done, but not now, I must sleep.
2001-01-03 08:48:36 +00:00
|
|
|
break;
|
2001-01-03 07:38:45 +00:00
|
|
|
}
|
|
|
|
printf("\n");
|
|
|
|
}
|
2001-01-09 04:39:35 +00:00
|
|
|
g_free (args);
|
2001-01-03 20:21:22 +00:00
|
|
|
if (num_args == 0) g_print (" none");
|
2001-01-03 07:38:45 +00:00
|
|
|
printf("\n");
|
|
|
|
|
2001-05-25 21:00:07 +00:00
|
|
|
|
|
|
|
|
|
|
|
// for compound elements
|
|
|
|
if (GST_IS_BIN(element)) {
|
|
|
|
printf("\nChildren:\n");
|
|
|
|
children = gst_bin_get_list(GST_BIN(element));
|
|
|
|
while (children) {
|
|
|
|
child = GST_ELEMENT (children->data);
|
|
|
|
children = g_list_next (children);
|
|
|
|
|
|
|
|
g_print(" %s\n",GST_ELEMENT_NAME(child));
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2001-01-03 07:38:45 +00:00
|
|
|
return 0;
|
|
|
|
}
|
2001-01-04 10:47:39 +00:00
|
|
|
|
|
|
|
void print_element_list() {
|
|
|
|
GList *plugins, *factories;
|
|
|
|
GstPlugin *plugin;
|
|
|
|
GstElementFactory *factory;
|
|
|
|
|
|
|
|
plugins = gst_plugin_get_list();
|
|
|
|
while (plugins) {
|
|
|
|
plugin = (GstPlugin*)(plugins->data);
|
|
|
|
plugins = g_list_next (plugins);
|
|
|
|
|
|
|
|
// printf("%s:\n",plugin->name);
|
|
|
|
|
|
|
|
factories = gst_plugin_get_factory_list(plugin);
|
|
|
|
while (factories) {
|
|
|
|
factory = (GstElementFactory*)(factories->data);
|
|
|
|
factories = g_list_next (factories);
|
|
|
|
|
|
|
|
printf("%s: %s: %s\n",plugin->name,factory->name,factory->details->longname);
|
|
|
|
}
|
|
|
|
|
|
|
|
// printf("\n");
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2001-03-07 21:52:56 +00:00
|
|
|
void
|
|
|
|
print_plugin_info (GstPlugin *plugin)
|
|
|
|
{
|
2001-01-04 10:47:39 +00:00
|
|
|
printf("Plugin Details:\n");
|
|
|
|
printf(" Name:\t\t%s\n",plugin->name);
|
|
|
|
printf(" Long Name:\t%s\n",plugin->longname);
|
|
|
|
printf(" Filename:\t%s\n",plugin->filename);
|
|
|
|
printf("\n");
|
|
|
|
|
|
|
|
if (plugin->numelements) {
|
2001-03-07 21:52:56 +00:00
|
|
|
GList *factories;
|
|
|
|
GstElementFactory *factory;
|
|
|
|
|
2001-01-04 10:47:39 +00:00
|
|
|
printf("Element Factories:\n");
|
|
|
|
|
|
|
|
factories = gst_plugin_get_factory_list(plugin);
|
|
|
|
while (factories) {
|
|
|
|
factory = (GstElementFactory*)(factories->data);
|
|
|
|
factories = g_list_next(factories);
|
|
|
|
|
|
|
|
printf(" %s: %s\n",factory->name,factory->details->longname);
|
|
|
|
}
|
|
|
|
}
|
2001-03-07 21:52:56 +00:00
|
|
|
if (plugin->numautopluggers) {
|
|
|
|
GList *factories;
|
|
|
|
GstAutoplugFactory *factory;
|
|
|
|
|
|
|
|
printf("Autpluggers:\n");
|
|
|
|
|
|
|
|
factories = gst_plugin_get_autoplug_list(plugin);
|
|
|
|
while (factories) {
|
|
|
|
factory = (GstAutoplugFactory*)(factories->data);
|
|
|
|
factories = g_list_next(factories);
|
|
|
|
|
|
|
|
printf(" %s: %s\n", factory->name, factory->longdesc);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
if (plugin->numtypes) {
|
|
|
|
GList *factories;
|
|
|
|
GstTypeFactory *factory;
|
|
|
|
|
|
|
|
printf("Types:\n");
|
|
|
|
|
|
|
|
factories = gst_plugin_get_type_list(plugin);
|
|
|
|
while (factories) {
|
|
|
|
factory = (GstTypeFactory*)(factories->data);
|
|
|
|
factories = g_list_next(factories);
|
|
|
|
|
|
|
|
printf(" %s: %s\n", factory->mime, factory->exts);
|
|
|
|
if (factory->typefindfunc)
|
|
|
|
printf(" Has typefind function: %s\n",GST_DEBUG_FUNCPTR_NAME(factory->typefindfunc));
|
|
|
|
}
|
|
|
|
}
|
2001-01-04 10:47:39 +00:00
|
|
|
printf("\n");
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
int main(int argc,char *argv[]) {
|
|
|
|
GstElementFactory *factory;
|
|
|
|
GstPlugin *plugin;
|
|
|
|
gchar *so;
|
|
|
|
|
|
|
|
gst_init(&argc,&argv);
|
|
|
|
|
|
|
|
// if no arguments, print out list of elements
|
|
|
|
if (argc == 1) {
|
2001-03-07 21:52:56 +00:00
|
|
|
print_element_list();
|
2001-01-04 10:47:39 +00:00
|
|
|
|
|
|
|
// else we try to get a factory
|
|
|
|
} else {
|
|
|
|
// first check for help
|
|
|
|
if (strstr(argv[1],"-help")) {
|
|
|
|
printf("Usage: %s\t\t\tList all registered elements\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]);
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
|
|
|
|
// only search for a factory if there's not a '.so'
|
|
|
|
if (! strstr(argv[1],".so")) {
|
|
|
|
factory = gst_elementfactory_find (argv[1]);
|
|
|
|
|
|
|
|
// if there's a factory, print out the info
|
|
|
|
if (factory)
|
|
|
|
return print_element_info(factory);
|
|
|
|
} else {
|
|
|
|
// strip the .so
|
|
|
|
so = strstr(argv[1],".so");
|
|
|
|
so[0] = '\0';
|
|
|
|
}
|
|
|
|
|
|
|
|
// otherwise assume it's a plugin
|
|
|
|
plugin = gst_plugin_find (argv[1]);
|
|
|
|
|
|
|
|
// if there is such a plugin, print out info
|
|
|
|
if (plugin) {
|
|
|
|
print_plugin_info(plugin);
|
|
|
|
|
|
|
|
} else {
|
|
|
|
printf("no such element or plugin '%s'\n",argv[1]);
|
|
|
|
return -1;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
return 0;
|
|
|
|
}
|