mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2024-12-23 08:46:40 +00:00
- Make inspect show the event masks, formats and qupported query types.
Original commit message from CVS: - Make inspect show the event masks, formats and qupported query types. - convert enum values to something readable in -launch
This commit is contained in:
parent
a33c875057
commit
abc329c725
2 changed files with 156 additions and 22 deletions
|
@ -107,6 +107,94 @@ print_props (GstProps *properties, gchar *pfx)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static void
|
||||||
|
print_formats (const GstFormat *formats)
|
||||||
|
{
|
||||||
|
GType format_type;
|
||||||
|
GEnumClass *klass;
|
||||||
|
|
||||||
|
format_type = gst_format_get_type();
|
||||||
|
klass = (GEnumClass *) g_type_class_ref (format_type);
|
||||||
|
|
||||||
|
while (formats && *formats) {
|
||||||
|
GEnumValue *value;
|
||||||
|
|
||||||
|
value = g_enum_get_value (klass, *formats);
|
||||||
|
|
||||||
|
printf ("\t\t(%d):\t%s (%s)\n", value->value, value->value_nick, value->value_name);
|
||||||
|
formats++;
|
||||||
|
}
|
||||||
|
g_type_class_unref (klass);
|
||||||
|
}
|
||||||
|
|
||||||
|
static void
|
||||||
|
print_event_masks (const GstEventMask *masks)
|
||||||
|
{
|
||||||
|
GType event_type;
|
||||||
|
GEnumClass *klass;
|
||||||
|
GType event_flags;
|
||||||
|
GFlagsClass *flags_class = NULL;
|
||||||
|
|
||||||
|
event_type = gst_event_type_get_type();
|
||||||
|
klass = (GEnumClass *) g_type_class_ref (event_type);
|
||||||
|
|
||||||
|
while (masks && masks->type) {
|
||||||
|
GEnumValue *value;
|
||||||
|
gint flags = 0, index = 0;
|
||||||
|
|
||||||
|
switch (masks->type) {
|
||||||
|
case GST_EVENT_SEEK:
|
||||||
|
flags = masks->flags;
|
||||||
|
event_flags = gst_seek_type_get_type ();
|
||||||
|
flags_class = (GFlagsClass *) g_type_class_ref (event_flags);
|
||||||
|
break;
|
||||||
|
default:
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
|
value = g_enum_get_value (klass, masks->type);
|
||||||
|
printf ("\t\t%s ", value->value_nick);
|
||||||
|
|
||||||
|
while (flags) {
|
||||||
|
GFlagsValue *value;
|
||||||
|
|
||||||
|
if (flags & 1) {
|
||||||
|
value = g_flags_get_first_value (flags_class, 1 << index);
|
||||||
|
|
||||||
|
if (value)
|
||||||
|
printf ("| %s ", value->value_nick);
|
||||||
|
else
|
||||||
|
printf ("| ? ");
|
||||||
|
}
|
||||||
|
flags >>= 1;
|
||||||
|
index++;
|
||||||
|
}
|
||||||
|
printf ("\n");
|
||||||
|
|
||||||
|
masks++;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
static void
|
||||||
|
print_query_types (const GstPadQueryType *types)
|
||||||
|
{
|
||||||
|
GType query_type;
|
||||||
|
GEnumClass *klass;
|
||||||
|
|
||||||
|
query_type = gst_pad_query_type_get_type();
|
||||||
|
klass = (GEnumClass *) g_type_class_ref (query_type);
|
||||||
|
|
||||||
|
while (types && *types) {
|
||||||
|
GEnumValue *value;
|
||||||
|
|
||||||
|
value = g_enum_get_value (klass, *types);
|
||||||
|
|
||||||
|
printf ("\t\t(%d):\t%s (%s)\n", value->value, value->value_nick, value->value_name);
|
||||||
|
types++;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
static void
|
static void
|
||||||
output_hierarchy (GType type, gint level, gint *maxlevel)
|
output_hierarchy (GType type, gint level, gint *maxlevel)
|
||||||
{
|
{
|
||||||
|
@ -440,6 +528,30 @@ print_element_info (GstElementFactory *factory)
|
||||||
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) {
|
||||||
|
printf(" Supports seeking/conversion/query formats:\n");
|
||||||
|
print_formats(gst_pad_get_formats (GST_PAD (realpad)));
|
||||||
|
}
|
||||||
|
if (realpad->convertfunc != gst_pad_convert_default)
|
||||||
|
printf(" Has custom convertfunc(): %s\n",GST_DEBUG_FUNCPTR_NAME(realpad->convertfunc));
|
||||||
|
if (realpad->eventfunc != gst_pad_event_default)
|
||||||
|
printf(" Has custom eventfunc(): %s\n",GST_DEBUG_FUNCPTR_NAME(realpad->eventfunc));
|
||||||
|
if (realpad->eventmaskfunc != gst_pad_get_event_masks_default) {
|
||||||
|
printf(" Provides event masks:\n");
|
||||||
|
print_event_masks(gst_pad_get_event_masks (GST_PAD (realpad)));
|
||||||
|
}
|
||||||
|
if (realpad->queryfunc != gst_pad_query_default)
|
||||||
|
printf(" Has custom queryfunc(): %s\n",GST_DEBUG_FUNCPTR_NAME(realpad->queryfunc));
|
||||||
|
if (realpad->querytypefunc != gst_pad_get_query_types_default) {
|
||||||
|
printf(" Provides query types:\n");
|
||||||
|
print_query_types(gst_pad_get_query_types (GST_PAD (realpad)));
|
||||||
|
}
|
||||||
|
|
||||||
|
if (realpad->intconnfunc != gst_pad_get_internal_connections_default)
|
||||||
|
printf(" Has custom intconnfunc(): %s\n",GST_DEBUG_FUNCPTR_NAME(realpad->intconnfunc));
|
||||||
|
|
||||||
|
if (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);
|
||||||
|
@ -513,16 +625,21 @@ print_element_info (GstElementFactory *factory)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Signals Block */
|
/* Signals/Actions Block */
|
||||||
{
|
{
|
||||||
guint *signals;
|
guint *signals;
|
||||||
guint nsignals;
|
guint nsignals;
|
||||||
gint i;
|
gint i, k;
|
||||||
GSignalQuery *query;
|
GSignalQuery *query;
|
||||||
|
|
||||||
printf("\nElement Signals:\n");
|
|
||||||
|
|
||||||
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++) {
|
||||||
|
gint counted = 0;
|
||||||
|
|
||||||
|
if (k == 0)
|
||||||
|
printf("\nElement Signals:\n");
|
||||||
|
else
|
||||||
|
printf("\nElement Actions:\n");
|
||||||
|
|
||||||
for (i=0; i<nsignals; i++) {
|
for (i=0; i<nsignals; i++) {
|
||||||
gint n_params;
|
gint n_params;
|
||||||
|
@ -532,6 +649,9 @@ print_element_info (GstElementFactory *factory)
|
||||||
|
|
||||||
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)) ||
|
||||||
|
(k == 1 && (query->signal_flags & G_SIGNAL_ACTION))) {
|
||||||
n_params = query->n_params;
|
n_params = query->n_params;
|
||||||
return_type = query->return_type;
|
return_type = query->return_type;
|
||||||
param_types = query->param_types;
|
param_types = query->param_types;
|
||||||
|
@ -544,9 +664,13 @@ print_element_info (GstElementFactory *factory)
|
||||||
}
|
}
|
||||||
printf (" \t\t\t\tgpointer user_data);\n");
|
printf (" \t\t\t\tgpointer user_data);\n");
|
||||||
|
|
||||||
|
counted++;
|
||||||
|
}
|
||||||
|
|
||||||
g_free (query);
|
g_free (query);
|
||||||
}
|
}
|
||||||
if (nsignals == 0) g_print (" none\n");
|
if (counted == 0) g_print (" none\n");
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -56,7 +56,17 @@ property_change_callback (GObject *object, GstObject *orig, GParamSpec *pspec, g
|
||||||
}
|
}
|
||||||
g_value_init(&value, G_PARAM_SPEC_VALUE_TYPE (pspec));
|
g_value_init(&value, G_PARAM_SPEC_VALUE_TYPE (pspec));
|
||||||
g_object_get_property (G_OBJECT (orig), pspec->name, &value);
|
g_object_get_property (G_OBJECT (orig), pspec->name, &value);
|
||||||
|
|
||||||
|
if (G_IS_PARAM_SPEC_ENUM (pspec)) {
|
||||||
|
GEnumValue *enum_value;
|
||||||
|
enum_value = g_enum_get_value (G_ENUM_CLASS (g_type_class_ref (pspec->value_type)),
|
||||||
|
g_value_get_enum (&value));
|
||||||
|
|
||||||
|
str = g_strdup_printf ("%s (%d)", enum_value->value_nick, enum_value->value);
|
||||||
|
}
|
||||||
|
else {
|
||||||
str = g_strdup_value_contents (&value);
|
str = g_strdup_value_contents (&value);
|
||||||
|
}
|
||||||
g_print ("%s: %s = %s\n", GST_OBJECT_NAME (orig), pspec->name, str);
|
g_print ("%s: %s = %s\n", GST_OBJECT_NAME (orig), pspec->name, str);
|
||||||
g_free (str);
|
g_free (str);
|
||||||
g_value_unset(&value);
|
g_value_unset(&value);
|
||||||
|
|
Loading…
Reference in a new issue