mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2025-01-25 08:38:21 +00:00
Added signal output and object hierarchy output.
Original commit message from CVS: Added signal output and object hierarchy output.
This commit is contained in:
parent
4456b616ae
commit
695c1a2960
1 changed files with 80 additions and 6 deletions
|
@ -69,6 +69,31 @@ void print_props(GstProps *properties,gchar *pfx) {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static void
|
||||||
|
output_hierarchy (GType type, gint level, gint *maxlevel)
|
||||||
|
{
|
||||||
|
GType parent;
|
||||||
|
gint i;
|
||||||
|
|
||||||
|
parent = g_type_parent (type);
|
||||||
|
|
||||||
|
*maxlevel = *maxlevel + 1;
|
||||||
|
level++;
|
||||||
|
|
||||||
|
if (parent)
|
||||||
|
output_hierarchy (parent, level, maxlevel);
|
||||||
|
|
||||||
|
for (i=1; i<*maxlevel-level; i++)
|
||||||
|
g_print (" ");
|
||||||
|
if (*maxlevel-level)
|
||||||
|
g_print (" +----");
|
||||||
|
|
||||||
|
g_print ("%s\n", g_type_name (type));
|
||||||
|
|
||||||
|
if (level == 1)
|
||||||
|
g_print ("\n");
|
||||||
|
}
|
||||||
|
|
||||||
gint
|
gint
|
||||||
print_element_info (GstElementFactory *factory)
|
print_element_info (GstElementFactory *factory)
|
||||||
{
|
{
|
||||||
|
@ -85,6 +110,7 @@ print_element_info (GstElementFactory *factory)
|
||||||
GList *children;
|
GList *children;
|
||||||
GstElement *child;
|
GstElement *child;
|
||||||
gboolean have_flags;
|
gboolean have_flags;
|
||||||
|
gint maxlevel = 0;
|
||||||
|
|
||||||
element = gst_elementfactory_create(factory,"element");
|
element = gst_elementfactory_create(factory,"element");
|
||||||
if (!element) {
|
if (!element) {
|
||||||
|
@ -104,6 +130,8 @@ print_element_info (GstElementFactory *factory)
|
||||||
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);
|
||||||
|
|
||||||
printf("Pad Templates:\n");
|
printf("Pad Templates:\n");
|
||||||
if (factory->numpadtemplates) {
|
if (factory->numpadtemplates) {
|
||||||
pads = factory->padtemplates;
|
pads = factory->padtemplates;
|
||||||
|
@ -305,19 +333,65 @@ print_element_info (GstElementFactory *factory)
|
||||||
/*
|
/*
|
||||||
g_free (args);
|
g_free (args);
|
||||||
*/
|
*/
|
||||||
if (num_properties == 0) g_print (" none");
|
if (num_properties == 0) g_print (" none\n");
|
||||||
printf("\n");
|
|
||||||
|
|
||||||
|
{
|
||||||
|
guint *signals;
|
||||||
|
guint nsignals;
|
||||||
|
gint i;
|
||||||
|
#ifdef USE_GLIB2
|
||||||
|
GSignalQuery query;
|
||||||
|
#else
|
||||||
|
GtkSignalQuery *query;
|
||||||
|
#endif
|
||||||
|
|
||||||
|
printf("\nElement Signals:\n");
|
||||||
|
|
||||||
|
signals = g_signal_list_ids (G_OBJECT_TYPE (element), &nsignals);
|
||||||
|
|
||||||
|
for (i=0; i<nsignals; i++) {
|
||||||
|
gint n_params;
|
||||||
|
GType return_type;
|
||||||
|
const GType *param_types;
|
||||||
|
gint j;
|
||||||
|
|
||||||
|
#ifdef USE_GLIB2
|
||||||
|
g_signal_query (signals[i], &query);
|
||||||
|
n_params = query->n_params;
|
||||||
|
return_type = query->return_type;
|
||||||
|
param_types = query->param_types;
|
||||||
|
#else
|
||||||
|
query = gtk_signal_query (signals[i]);
|
||||||
|
n_params = query->nparams;
|
||||||
|
return_type = query->return_val;
|
||||||
|
param_types = query->params;
|
||||||
|
#endif
|
||||||
|
|
||||||
|
printf (" \"%s\" :\t %s user_function (%s* object, \n", query->signal_name, g_type_name (return_type),
|
||||||
|
g_type_name (G_OBJECT_TYPE (element)));
|
||||||
|
|
||||||
|
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\tgpointer user_data);\n");
|
||||||
|
}
|
||||||
|
if (nsignals == 0) g_print (" 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 = gst_bin_get_list(GST_BIN(element));
|
children = gst_bin_get_list(GST_BIN(element));
|
||||||
while (children) {
|
if (!children)
|
||||||
child = GST_ELEMENT (children->data);
|
g_print (" none\n");
|
||||||
children = g_list_next (children);
|
else {
|
||||||
|
while (children) {
|
||||||
|
child = GST_ELEMENT (children->data);
|
||||||
|
children = g_list_next (children);
|
||||||
|
|
||||||
g_print(" %s\n",GST_ELEMENT_NAME(child));
|
g_print(" %s\n",GST_ELEMENT_NAME(child));
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue