return s;
}
+static gboolean
+print_factory_details_metadata (GQuark field_id, const GValue * value,
+ gpointer user_data)
+{
+ gchar *val = g_strdup_value_contents (value);
+ gchar *key = g_strdup (g_quark_to_string (field_id));
+
+ key[0] = g_ascii_toupper (key[0]);
+ n_print (" %s:\t\t%s\n", key, val);
+ g_free (val);
+ g_free (key);
+ return TRUE;
+}
+
static void
print_factory_details_info (GstElementFactory * factory)
{
char s[20];
n_print ("Factory Details:\n");
- n_print (" Long name:\t%s\n", factory->details.longname);
- n_print (" Class:\t%s\n", factory->details.klass);
- n_print (" Description:\t%s\n", factory->details.description);
- n_print (" Author(s):\t%s\n", factory->details.author);
n_print (" Rank:\t\t%s (%d)\n",
get_rank_name (s, GST_PLUGIN_FEATURE (factory)->rank),
GST_PLUGIN_FEATURE (factory)->rank);
+ gst_structure_foreach ((GstStructure *) factory->metadata,
+ print_factory_details_metadata, NULL);
n_print ("\n");
}
--i;
if (vals[i].value != 0 && (flags_left & vals[i].value) == vals[i].value) {
if (s->len > 0)
- g_string_append (s, " | ");
+ g_string_append_c (s, '+');
g_string_append (s, vals[i].value_nick);
flags_left -= vals[i].value;
if (flags_left == 0)
return g_string_free (s, FALSE);
}
+#define KNOWN_PARAM_FLAGS \
+ (G_PARAM_CONSTRUCT | G_PARAM_CONSTRUCT_ONLY | \
+ G_PARAM_LAX_VALIDATION | G_PARAM_STATIC_STRINGS | \
+ G_PARAM_READABLE | G_PARAM_WRITABLE | GST_PARAM_CONTROLLABLE | \
+ GST_PARAM_MUTABLE_PLAYING | GST_PARAM_MUTABLE_PAUSED | \
+ GST_PARAM_MUTABLE_READY)
+
static void
print_element_properties_info (GstElement * element)
{
if (param->flags & G_PARAM_READABLE) {
g_object_get_property (G_OBJECT (element), param->name, &value);
readable = TRUE;
- if (!first_flag)
- g_print (", ");
- else
- first_flag = FALSE;
- g_print (_("readable"));
+ g_print ("%s%s", (first_flag) ? "" : ", ", _("readable"));
+ first_flag = FALSE;
}
if (param->flags & G_PARAM_WRITABLE) {
- if (!first_flag)
- g_print (", ");
- else
- first_flag = FALSE;
- g_print (_("writable"));
+ g_print ("%s%s", (first_flag) ? "" : ", ", _("writable"));
+ first_flag = FALSE;
}
if (param->flags & GST_PARAM_CONTROLLABLE) {
- if (!first_flag)
- g_print (", ");
- g_print (_("controllable"));
+ g_print (", %s", _("controllable"));
+ first_flag = FALSE;
+ }
+ if (param->flags & GST_PARAM_MUTABLE_PLAYING) {
+ g_print (", %s", _("changeable in NULL, READY, PAUSED or PLAYING state"));
+ } else if (param->flags & GST_PARAM_MUTABLE_PAUSED) {
+ g_print (", %s", _("changeable only in NULL, READY or PAUSED state"));
+ } else if (param->flags & GST_PARAM_MUTABLE_READY) {
+ g_print (", %s", _("changeable only in NULL or READY state"));
+ }
+ if (param->flags & ~KNOWN_PARAM_FLAGS) {
+ g_print ("%s0x%0x", (first_flag) ? "" : ", ",
+ param->flags & ~KNOWN_PARAM_FLAGS);
}
n_print ("\n");
gst_value_get_fraction_numerator (&value),
gst_value_get_fraction_denominator (&value));
- } else if (GST_IS_PARAM_SPEC_MINI_OBJECT (param)) {
- n_print ("%-23.23s MiniObject of type \"%s\"", "",
- g_type_name (param->value_type));
} else {
n_print ("%-23.23s Unknown type %ld \"%s\"", "", param->value_type,
g_type_name (param->value_type));
static void
print_implementation_info (GstElement * element)
{
- GstObjectClass *gstobject_class;
GstElementClass *gstelement_class;
- gstobject_class = GST_OBJECT_CLASS (G_OBJECT_GET_CLASS (element));
gstelement_class = GST_ELEMENT_CLASS (G_OBJECT_GET_CLASS (element));
n_print ("\n");
n_print (" Has change_state() function: %s\n",
GST_DEBUG_FUNCPTR_NAME (gstelement_class->change_state));
-#ifndef GST_DISABLE_LOADSAVE
- n_print (" Has custom save_thyself() function: %s\n",
- GST_DEBUG_FUNCPTR_NAME (gstobject_class->save_thyself));
- n_print (" Has custom restore_thyself() function: %s\n",
- GST_DEBUG_FUNCPTR_NAME (gstobject_class->restore_thyself));
-#endif
}
static void
pads = element->pads;
while (pads) {
gchar *name;
+ GstCaps *caps;
pad = GST_PAD (pads->data);
pads = g_list_next (pads);
n_print (" Has custom iterintlinkfunc(): %s\n",
GST_DEBUG_FUNCPTR_NAME (pad->iterintlinkfunc));
- if (pad->bufferallocfunc)
- n_print (" Has bufferallocfunc(): %s\n",
- GST_DEBUG_FUNCPTR_NAME (pad->bufferallocfunc));
-
if (pad->getcapsfunc)
n_print (" Has getcapsfunc(): %s\n",
GST_DEBUG_FUNCPTR_NAME (pad->getcapsfunc));
- if (pad->setcapsfunc)
- n_print (" Has setcapsfunc(): %s\n",
- GST_DEBUG_FUNCPTR_NAME (pad->setcapsfunc));
/* gst_pad_acceptcaps_default is static :/ */
if (pad->acceptcapsfunc)
n_print (" Has acceptcapsfunc(): %s\n",
if (pad->padtemplate)
n_print (" Pad Template: '%s'\n", pad->padtemplate->name_template);
- if (pad->caps) {
+ caps = gst_pad_get_current_caps (pad);
+ if (caps) {
n_print (" Capabilities:\n");
- print_caps (pad->caps, " ");
+ print_caps (caps, " ");
+ gst_caps_unref (caps);
}
}
}
-#if 0
-static gint
-compare_signal_names (GSignalQuery * a, GSignalQuery * b)
+static gboolean
+has_sometimes_template (GstElement * element)
{
- return strcmp (a->signal_name, b->signal_name);
+ GstElementClass *klass = GST_ELEMENT_GET_CLASS (element);
+ GList *l;
+
+ for (l = klass->padtemplates; l != NULL; l = l->next) {
+ if (GST_PAD_TEMPLATE (l->data)->presence == GST_PAD_SOMETIMES)
+ return TRUE;
+ }
+
+ return FALSE;
}
-#endif
static void
print_signal_info (GstElement * element)
for (k = 0; k < 2; k++) {
found_signals = NULL;
+
+ /* For elements that have sometimes pads, also list a few useful GstElement
+ * signals. Put these first, so element-specific ones come later. */
+ if (k == 0 && has_sometimes_template (element)) {
+ query = g_new0 (GSignalQuery, 1);
+ g_signal_query (g_signal_lookup ("pad-added", GST_TYPE_ELEMENT), query);
+ found_signals = g_slist_append (found_signals, query);
+ query = g_new0 (GSignalQuery, 1);
+ g_signal_query (g_signal_lookup ("pad-removed", GST_TYPE_ELEMENT), query);
+ found_signals = g_slist_append (found_signals, query);
+ query = g_new0 (GSignalQuery, 1);
+ g_signal_query (g_signal_lookup ("no-more-pads", GST_TYPE_ELEMENT),
+ query);
+ found_signals = g_slist_append (found_signals, query);
+ }
+
for (type = G_OBJECT_TYPE (element); type; type = g_type_parent (type)) {
if (type == GST_TYPE_ELEMENT || type == GST_TYPE_OBJECT)
break;
print_element_info (factory, TRUE);
else
g_print ("%s: %s: %s\n", plugin->desc.name,
- GST_PLUGIN_FEATURE_NAME (factory),
+ GST_OBJECT_NAME (factory),
gst_element_factory_get_longname (factory));
} else if (GST_IS_INDEX_FACTORY (feature)) {
GstIndexFactory *factory;
factory = GST_INDEX_FACTORY (feature);
if (!print_all)
g_print ("%s: %s: %s\n", plugin->desc.name,
- GST_PLUGIN_FEATURE_NAME (factory), factory->longdesc);
+ GST_OBJECT_NAME (factory), factory->longdesc);
} else if (GST_IS_TYPE_FIND_FACTORY (feature)) {
GstTypeFindFactory *factory;
} else {
if (!print_all)
n_print ("%s: %s (%s)\n", plugin->desc.name,
- GST_PLUGIN_FEATURE_NAME (feature),
- g_type_name (G_OBJECT_TYPE (feature)));
+ GST_OBJECT_NAME (feature), g_type_name (G_OBJECT_TYPE (feature)));
}
next:
gst_uri_handler_get_protocols (GST_URI_HANDLER (element));
joined = g_strjoinv (", ", uri_protocols);
- g_print ("%s (%s, rank %u): %s\n", GST_OBJECT_NAME (factory), dir,
+ g_print ("%s (%s, rank %u): %s\n",
+ gst_plugin_feature_get_name (GST_PLUGIN_FEATURE (factory)), dir,
gst_plugin_feature_get_rank (GST_PLUGIN_FEATURE (factory)),
joined);
g_free (joined);
- //g_strfreev (uri_protocols);
}
gst_object_unref (element);
static void
print_plugin_features (GstPlugin * plugin)
{
- GList *features;
+ GList *features, *origlist;
gint num_features = 0;
gint num_elements = 0;
gint num_typefinders = 0;
gint num_indexes = 0;
gint num_other = 0;
- features =
+ origlist = features =
gst_registry_get_feature_list_by_plugin (gst_registry_get_default (),
plugin->desc.name);
GstElementFactory *factory;
factory = GST_ELEMENT_FACTORY (feature);
- n_print (" %s: %s\n", GST_PLUGIN_FEATURE_NAME (factory),
+ n_print (" %s: %s\n", GST_OBJECT_NAME (factory),
gst_element_factory_get_longname (factory));
num_elements++;
} else if (GST_IS_INDEX_FACTORY (feature)) {
num_features++;
features = g_list_next (features);
}
+
+ gst_plugin_feature_list_free (origlist);
+
n_print ("\n");
n_print (" %d features:\n", num_features);
if (num_elements > 0)
}
if (print_names)
- _name = g_strdup_printf ("%s: ", GST_PLUGIN_FEATURE (factory)->name);
+ _name = g_strdup_printf ("%s: ", GST_OBJECT_NAME (factory));
else
_name = NULL;
if (caps == NULL) {
g_printerr ("Couldn't find static pad template for %s '%s'\n",
- type_name, GST_PLUGIN_FEATURE_NAME (factory));
+ type_name, GST_OBJECT_NAME (factory));
return;
}