Original commit message from CVS:
Fixed bug #108514.
This commit is contained in:
Christian Meyer 2003-03-16 20:06:02 +00:00
parent 17b8c5d004
commit dabb6637bd
9 changed files with 637 additions and 587 deletions

View file

@ -1,3 +1,21 @@
2003-03-16 Christian Meyer <chrisime@gnome.org>
* tools/gst-inspect.c
(print_prop): Modified to make compile compile with the new introduced
function.
* tools/gst-xmlinspect.c
(print_prop): ditto.
2003-03-16 Christian Meyer <chrisime@gnome.org>
* gst/gstprops.[ch]: Add function gst_props_get_type().
* gst/gstprops.[ch], gst/gstutils.c, gst/registries/gstxmlregistry.c:
- Rename gst_props_entry_get_type() -> gst_props_entry_get_props_type().
- Add gst_props_entry_get_type() (returning the GType).
* gst/gstcaps.[ch]: Add function gst_caps_get_type().
Applied patches from Martin Schulze.
2003-01-09 Thomas Vander Stichele <thomas at apestaart dot org> 2003-01-09 Thomas Vander Stichele <thomas at apestaart dot org>
* first pass at changing _connect/_disconnect -> _link/_unlink * first pass at changing _connect/_disconnect -> _link/_unlink

View file

@ -90,6 +90,12 @@ _gst_caps_initialize (void)
#endif #endif
} }
GType
gst_caps_get_type (void)
{
return _gst_caps_type;
}
static guint16 static guint16
get_type_for_mime (const gchar *mime) get_type_for_mime (const gchar *mime)
{ {

View file

@ -120,6 +120,7 @@ factoryname (void) \
void _gst_caps_initialize (void); void _gst_caps_initialize (void);
/* creating new caps */ /* creating new caps */
GType gst_caps_get_type (void);
GstCaps* gst_caps_new (const gchar *name, const gchar *mime, GstProps *props); GstCaps* gst_caps_new (const gchar *name, const gchar *mime, GstProps *props);
GstCaps* gst_caps_new_id (const gchar *name, const guint16 id, GstProps *props); GstCaps* gst_caps_new_id (const gchar *name, const guint16 id, GstProps *props);
/* replace pointer to caps, doing proper refcounting */ /* replace pointer to caps, doing proper refcounting */

View file

@ -41,7 +41,7 @@ GType _gst_props_entry_type;
struct _GstPropsEntry { struct _GstPropsEntry {
GQuark propid; GQuark propid;
GstPropsType propstype; GstPropsType propstype;
union { union {
/* flat values */ /* flat values */
@ -84,7 +84,7 @@ transform_func (const GValue *src_value,
if (props) { if (props) {
GList *propslist = props->properties; GList *propslist = props->properties;
while (propslist) { while (propslist) {
GstPropsEntry *entry = (GstPropsEntry *)propslist->data; GstPropsEntry *entry = (GstPropsEntry *)propslist->data;
const gchar *name = g_quark_to_string (entry->propid); const gchar *name = g_quark_to_string (entry->propid);
@ -108,7 +108,7 @@ transform_func (const GValue *src_value,
default: default:
break; break;
} }
propslist = g_list_next (propslist); propslist = g_list_next (propslist);
if (propslist) { if (propslist) {
g_string_append (result, "; "); g_string_append (result, "; ");
@ -119,16 +119,15 @@ transform_func (const GValue *src_value,
g_string_free (result, FALSE); g_string_free (result, FALSE);
} }
void
void _gst_props_initialize (void)
_gst_props_initialize (void)
{ {
_gst_props_entries_chunk = gst_mem_chunk_new ("GstPropsEntries", _gst_props_entries_chunk = gst_mem_chunk_new ("GstPropsEntries",
sizeof (GstPropsEntry), sizeof (GstPropsEntry) * 1024, sizeof (GstPropsEntry), sizeof (GstPropsEntry) * 1024,
G_ALLOC_AND_FREE); G_ALLOC_AND_FREE);
_gst_props_chunk = gst_mem_chunk_new ("GstProps", _gst_props_chunk = gst_mem_chunk_new ("GstProps",
sizeof (GstProps), sizeof (GstProps) * 256, sizeof (GstProps), sizeof (GstProps) * 256,
G_ALLOC_AND_FREE); G_ALLOC_AND_FREE);
_gst_props_type = g_boxed_type_register_static ("GstProps", _gst_props_type = g_boxed_type_register_static ("GstProps",
@ -199,9 +198,9 @@ gst_props_debug_entry (GstPropsEntry *entry)
} }
} }
static gint static gint
props_compare_func (gconstpointer a, props_compare_func (gconstpointer a,
gconstpointer b) gconstpointer b)
{ {
GstPropsEntry *entry1 = (GstPropsEntry *)a; GstPropsEntry *entry1 = (GstPropsEntry *)a;
GstPropsEntry *entry2 = (GstPropsEntry *)b; GstPropsEntry *entry2 = (GstPropsEntry *)b;
@ -209,9 +208,9 @@ props_compare_func (gconstpointer a,
return (entry1->propid - entry2->propid); return (entry1->propid - entry2->propid);
} }
static gint static gint
props_find_func (gconstpointer a, props_find_func (gconstpointer a,
gconstpointer b) gconstpointer b)
{ {
GstPropsEntry *entry2 = (GstPropsEntry *)a; GstPropsEntry *entry2 = (GstPropsEntry *)a;
GQuark quark = (GQuark) GPOINTER_TO_INT (b); GQuark quark = (GQuark) GPOINTER_TO_INT (b);
@ -325,10 +324,10 @@ static void
gst_props_entry_clean (GstPropsEntry *entry) gst_props_entry_clean (GstPropsEntry *entry)
{ {
switch (entry->propstype) { switch (entry->propstype) {
case GST_PROPS_STRING_TYPE: case GST_PROPS_STRING_TYPE:
g_free (entry->data.string_data.string); g_free (entry->data.string_data.string);
break; break;
case GST_PROPS_LIST_TYPE: case GST_PROPS_LIST_TYPE:
{ {
GList *entries = entry->data.list_data.entries; GList *entries = entry->data.list_data.entries;
@ -339,8 +338,8 @@ gst_props_entry_clean (GstPropsEntry *entry)
g_list_free (entry->data.list_data.entries); g_list_free (entry->data.list_data.entries);
break; break;
} }
default: default:
break; break;
} }
} }
@ -363,6 +362,12 @@ gst_props_entry_destroy (GstPropsEntry *entry)
#endif #endif
} }
GType
gst_props_get_type (void)
{
return _gst_props_type;
}
/** /**
* gst_props_empty_new: * gst_props_empty_new:
* *
@ -400,25 +405,25 @@ gst_props_empty_new (void)
*/ */
void void
gst_props_replace (GstProps **oldprops, GstProps *newprops) gst_props_replace (GstProps **oldprops, GstProps *newprops)
{ {
if (*oldprops != newprops) { if (*oldprops != newprops) {
if (newprops) gst_props_ref (newprops); if (newprops) gst_props_ref (newprops);
if (*oldprops) gst_props_unref (*oldprops); if (*oldprops) gst_props_unref (*oldprops);
*oldprops = newprops; *oldprops = newprops;
} }
} }
/** /**
* gst_props_replace_sink: * gst_props_replace_sink:
* @oldprops: the props to take replace * @oldprops: the props to take replace
* @newprops: the props to take replace * @newprops: the props to take replace
* *
* Replace the pointer to the props and take ownership. * Replace the pointer to the props and take ownership.
*/ */
void void
gst_props_replace_sink (GstProps **oldprops, GstProps *newprops) gst_props_replace_sink (GstProps **oldprops, GstProps *newprops)
{ {
gst_props_replace (oldprops, newprops); gst_props_replace (oldprops, newprops);
gst_props_sink (newprops); gst_props_sink (newprops);
} }
@ -473,7 +478,7 @@ gst_props_remove_entry_by_name (GstProps *props, const gchar *name)
g_return_if_fail (props != NULL); g_return_if_fail (props != NULL);
g_return_if_fail (name != NULL); g_return_if_fail (name != NULL);
quark = g_quark_from_string (name); quark = g_quark_from_string (name);
lentry = g_list_find_custom (props->properties, GINT_TO_POINTER (quark), props_find_func); lentry = g_list_find_custom (props->properties, GINT_TO_POINTER (quark), props_find_func);
@ -485,7 +490,7 @@ gst_props_remove_entry_by_name (GstProps *props, const gchar *name)
/** /**
* gst_props_new: * gst_props_new:
* @firstname: the first property name * @firstname: the first property name
* @...: the property values * @...: the property values
* *
* Create a new property from the given key/value pairs * Create a new property from the given key/value pairs
* *
@ -496,16 +501,15 @@ gst_props_new (const gchar *firstname, ...)
{ {
GstProps *props; GstProps *props;
va_list var_args; va_list var_args;
va_start (var_args, firstname); va_start (var_args, firstname);
props = gst_props_newv (firstname, var_args); props = gst_props_newv (firstname, var_args);
va_end (var_args);
return props;
}
va_end (var_args);
return props;
}
/** /**
* gst_props_debug: * gst_props_debug:
@ -520,11 +524,11 @@ gst_props_debug (GstProps *props)
GST_DEBUG (GST_CAT_PROPERTIES, "props %p, refcount %d, flags %d", props, props->refcount, props->flags); GST_DEBUG (GST_CAT_PROPERTIES, "props %p, refcount %d, flags %d", props, props->refcount, props->flags);
while (propslist) { while (propslist) {
GstPropsEntry *entry = (GstPropsEntry *)propslist->data; GstPropsEntry *entry = (GstPropsEntry *)propslist->data;
gst_props_debug_entry (entry); gst_props_debug_entry (entry);
propslist = g_list_next (propslist); propslist = g_list_next (propslist);
} }
} }
@ -636,6 +640,12 @@ gst_props_add_to_int_list (GList *entries, GstPropsEntry *newentry)
return g_list_prepend (entries, newentry); return g_list_prepend (entries, newentry);
} }
GType
gst_props_entry_get_type (void)
{
return _gst_props_entry_type;
}
static GstPropsEntry* static GstPropsEntry*
gst_props_entry_newv (const gchar *name, va_list var_args) gst_props_entry_newv (const gchar *name, va_list var_args)
{ {
@ -662,7 +672,7 @@ gst_props_entry_new (const gchar *name, ...)
{ {
va_list var_args; va_list var_args;
GstPropsEntry *entry; GstPropsEntry *entry;
va_start (var_args, name); va_start (var_args, name);
entry = gst_props_entry_newv (name, var_args); entry = gst_props_entry_newv (name, var_args);
va_end (var_args); va_end (var_args);
@ -709,7 +719,7 @@ gst_props_newv (const gchar *firstname, va_list var_args)
/* properties */ /* properties */
while (prop_name) { while (prop_name) {
GstPropsEntry *entry; GstPropsEntry *entry;
entry = gst_props_alloc_entry (); entry = gst_props_alloc_entry ();
entry->propid = g_quark_from_string (prop_name); entry->propid = g_quark_from_string (prop_name);
GST_PROPS_ENTRY_FILL (entry, var_args); GST_PROPS_ENTRY_FILL (entry, var_args);
@ -810,7 +820,7 @@ gst_props_set (GstProps *props, const gchar *name, ...)
va_list var_args; va_list var_args;
g_return_val_if_fail (props != NULL, NULL); g_return_val_if_fail (props != NULL, NULL);
quark = g_quark_from_string (name); quark = g_quark_from_string (name);
lentry = g_list_find_custom (props->properties, GINT_TO_POINTER (quark), props_find_func); lentry = g_list_find_custom (props->properties, GINT_TO_POINTER (quark), props_find_func);
@ -848,7 +858,7 @@ gst_props_unref (GstProps *props)
{ {
if (props == NULL) if (props == NULL)
return NULL; return NULL;
g_return_val_if_fail (props->refcount > 0, NULL); g_return_val_if_fail (props->refcount > 0, NULL);
GST_DEBUG (GST_CAT_PROPERTIES, "unref %p (%d->%d)", props, props->refcount, props->refcount-1); GST_DEBUG (GST_CAT_PROPERTIES, "unref %p (%d->%d)", props, props->refcount, props->refcount-1);
@ -879,7 +889,7 @@ gst_props_ref (GstProps *props)
g_return_val_if_fail (props->refcount > 0, NULL); g_return_val_if_fail (props->refcount > 0, NULL);
GST_DEBUG (GST_CAT_PROPERTIES, "ref %p (%d->%d)", props, props->refcount, props->refcount+1); GST_DEBUG (GST_CAT_PROPERTIES, "ref %p (%d->%d)", props, props->refcount, props->refcount+1);
props->refcount++; props->refcount++;
return props; return props;
@ -920,7 +930,7 @@ gst_props_destroy (GstProps *props)
if (props == NULL) if (props == NULL)
return; return;
entries = props->properties; entries = props->properties;
while (entries) { while (entries) {
@ -935,7 +945,7 @@ gst_props_destroy (GstProps *props)
#endif #endif
} }
/** /**
* gst_props_entry_copy: * gst_props_entry_copy:
* @entry: the entry to copy * @entry: the entry to copy
* *
@ -976,7 +986,7 @@ gst_props_list_copy (GList *propslist)
GstPropsEntry *entry = (GstPropsEntry *)propslist->data; GstPropsEntry *entry = (GstPropsEntry *)propslist->data;
new = g_list_prepend (new, gst_props_entry_copy (entry)); new = g_list_prepend (new, gst_props_entry_copy (entry));
propslist = g_list_next (propslist); propslist = g_list_next (propslist);
} }
new = g_list_reverse (new); new = g_list_reverse (new);
@ -1046,7 +1056,7 @@ gst_props_get_entry (GstProps *props, const gchar *name)
{ {
GList *lentry; GList *lentry;
GQuark quark; GQuark quark;
g_return_val_if_fail (props != NULL, NULL); g_return_val_if_fail (props != NULL, NULL);
g_return_val_if_fail (name != NULL, NULL); g_return_val_if_fail (name != NULL, NULL);
@ -1104,7 +1114,7 @@ gst_props_has_property_typed (GstProps *props, const gchar *name, GstPropsType t
* @props: the props to check * @props: the props to check
* @name: the name of the key to find * @name: the name of the key to find
* *
* Checks if a given props has a property with the given name that * Checks if a given props has a property with the given name that
* is also fixed, ie. is not a list or a range. * is also fixed, ie. is not a list or a range.
* *
* Returns: TRUE if the property was found, FALSE otherwise. * Returns: TRUE if the property was found, FALSE otherwise.
@ -1115,22 +1125,22 @@ gst_props_has_fixed_property (GstProps *props, const gchar *name)
const GstPropsEntry *entry; const GstPropsEntry *entry;
entry = gst_props_get_entry (props, name); entry = gst_props_get_entry (props, name);
if (!entry) if (!entry)
return FALSE; return FALSE;
return !GST_PROPS_ENTRY_IS_VARIABLE (entry); return !GST_PROPS_ENTRY_IS_VARIABLE (entry);
} }
/** /**
* gst_props_entry_get_type: * gst_props_entry_get_props_type:
* @entry: the props entry to query * @entry: the props entry to query
* *
* Get the type of the given props entry. * Get the type of the given props entry.
* *
* Returns: The type of the props entry. * Returns: The type of the props entry.
*/ */
GstPropsType GstPropsType
gst_props_entry_get_type (const GstPropsEntry *entry) gst_props_entry_get_props_type (const GstPropsEntry *entry)
{ {
g_return_val_if_fail (entry != NULL, GST_PROPS_INVALID_TYPE); g_return_val_if_fail (entry != NULL, GST_PROPS_INVALID_TYPE);
@ -1255,7 +1265,7 @@ gst_props_get (GstProps *props, gchar *first_name, ...)
va_start (var_args, first_name); va_start (var_args, first_name);
ret = gst_props_getv (props, FALSE, first_name, var_args); ret = gst_props_getv (props, FALSE, first_name, var_args);
va_end (var_args); va_end (var_args);
return ret; return ret;
} }
@ -1278,7 +1288,7 @@ gst_props_get_safe (GstProps *props, gchar *first_name, ...)
va_start (var_args, first_name); va_start (var_args, first_name);
ret = gst_props_getv (props, TRUE, first_name, var_args); ret = gst_props_getv (props, TRUE, first_name, var_args);
va_end (var_args); va_end (var_args);
return ret; return ret;
} }
@ -1289,7 +1299,7 @@ gst_props_get_safe (GstProps *props, gchar *first_name, ...)
* *
* Get the contents of the entry into the given gint. * Get the contents of the entry into the given gint.
* *
* Returns: TRUE is the value could be fetched. FALSE if the * Returns: TRUE is the value could be fetched. FALSE if the
* entry is not of given type or did not exist. * entry is not of given type or did not exist.
*/ */
gboolean gboolean
@ -1305,7 +1315,7 @@ gst_props_entry_get_int (const GstPropsEntry *entry, gint *val)
* *
* Get the contents of the entry into the given gfloat. * Get the contents of the entry into the given gfloat.
* *
* Returns: TRUE is the value could be fetched. FALSE if the * Returns: TRUE is the value could be fetched. FALSE if the
* entry is not of given type or did not exist. * entry is not of given type or did not exist.
*/ */
gboolean gboolean
@ -1321,7 +1331,7 @@ gst_props_entry_get_float (const GstPropsEntry *entry, gfloat *val)
* *
* Get the contents of the entry into the given guint32. * Get the contents of the entry into the given guint32.
* *
* Returns: TRUE is the value could be fetched. FALSE if the * Returns: TRUE is the value could be fetched. FALSE if the
* entry is not of given type or did not exist. * entry is not of given type or did not exist.
*/ */
gboolean gboolean
@ -1337,7 +1347,7 @@ gst_props_entry_get_fourcc_int (const GstPropsEntry *entry, guint32 *val)
* *
* Get the contents of the entry into the given gboolean. * Get the contents of the entry into the given gboolean.
* *
* Returns: TRUE is the value could be fetched. FALSE if the * Returns: TRUE is the value could be fetched. FALSE if the
* entry is not of given type or did not exist. * entry is not of given type or did not exist.
*/ */
gboolean gboolean
@ -1353,7 +1363,7 @@ gst_props_entry_get_boolean (const GstPropsEntry *entry, gboolean *val)
* *
* Get the contents of the entry into the given gchar*. * Get the contents of the entry into the given gchar*.
* *
* Returns: TRUE is the value could be fetched. FALSE if the * Returns: TRUE is the value could be fetched. FALSE if the
* entry is not of given type or did not exist. * entry is not of given type or did not exist.
*/ */
gboolean gboolean
@ -1370,7 +1380,7 @@ gst_props_entry_get_string (const GstPropsEntry *entry, const gchar **val)
* *
* Get the contents of the entry into the given gints. * Get the contents of the entry into the given gints.
* *
* Returns: TRUE is the value could be fetched. FALSE if the * Returns: TRUE is the value could be fetched. FALSE if the
* entry is not of given type or did not exist. * entry is not of given type or did not exist.
*/ */
gboolean gboolean
@ -1387,7 +1397,7 @@ gst_props_entry_get_int_range (const GstPropsEntry *entry, gint *min, gint *max)
* *
* Get the contents of the entry into the given gfloats. * Get the contents of the entry into the given gfloats.
* *
* Returns: TRUE is the value could be fetched. FALSE if the * Returns: TRUE is the value could be fetched. FALSE if the
* entry is not of given type or did not exist. * entry is not of given type or did not exist.
*/ */
gboolean gboolean
@ -1436,7 +1446,7 @@ gst_props_merge (GstProps *props, GstProps *tomerge)
GstPropsEntry *entry = (GstPropsEntry *)merge_props->data; GstPropsEntry *entry = (GstPropsEntry *)merge_props->data;
gst_props_add_entry (props, entry); gst_props_add_entry (props, entry);
merge_props = g_list_next (merge_props); merge_props = g_list_next (merge_props);
} }
@ -1465,8 +1475,7 @@ gst_props_entry_check_list_compatibility (GstPropsEntry *entry1, GstPropsEntry *
static gboolean static gboolean
gst_props_entry_check_compatibility (GstPropsEntry *entry1, GstPropsEntry *entry2) gst_props_entry_check_compatibility (GstPropsEntry *entry1, GstPropsEntry *entry2)
{ {
GST_DEBUG (GST_CAT_PROPERTIES,"compare: %s %s", g_quark_to_string (entry1->propid), GST_DEBUG (GST_CAT_PROPERTIES,"compare: %s %s", g_quark_to_string (entry1->propid), g_quark_to_string (entry2->propid));
g_quark_to_string (entry2->propid));
if (entry2->propstype == GST_PROPS_LIST_TYPE && entry1->propstype != GST_PROPS_LIST_TYPE) { if (entry2->propstype == GST_PROPS_LIST_TYPE && entry1->propstype != GST_PROPS_LIST_TYPE) {
return gst_props_entry_check_list_compatibility (entry1, entry2); return gst_props_entry_check_list_compatibility (entry1, entry2);
@ -1600,7 +1609,7 @@ gst_props_check_compatibility (GstProps *fromprops, GstProps *toprops)
g_return_val_if_fail (fromprops != NULL, FALSE); g_return_val_if_fail (fromprops != NULL, FALSE);
g_return_val_if_fail (toprops != NULL, FALSE); g_return_val_if_fail (toprops != NULL, FALSE);
sourcelist = fromprops->properties; sourcelist = fromprops->properties;
sinklist = toprops->properties; sinklist = toprops->properties;
@ -1750,7 +1759,7 @@ gst_props_entry_intersect (GstPropsEntry *entry1, GstPropsEntry *entry2)
break; break;
} }
if (this->data.int_data >= entry1->data.int_range_data.min && if (this->data.int_data >= entry1->data.int_range_data.min &&
this->data.int_data <= entry1->data.int_range_data.max) this->data.int_data <= entry1->data.int_range_data.max)
{ {
/* prepend and reverse at the end */ /* prepend and reverse at the end */
result->data.list_data.entries = g_list_prepend (result->data.list_data.entries, result->data.list_data.entries = g_list_prepend (result->data.list_data.entries,
@ -1875,7 +1884,7 @@ G_STMT_START { \
GST_PROPS_FLAG_UNSET ((props), GST_PROPS_FIXED); \ GST_PROPS_FLAG_UNSET ((props), GST_PROPS_FIXED); \
props->properties = g_list_prepend ((props)->properties, toadd); \ props->properties = g_list_prepend ((props)->properties, toadd); \
} G_STMT_END } G_STMT_END
/** /**
* gst_props_intersect: * gst_props_intersect:
* @props1: a property * @props1: a property
@ -1900,7 +1909,7 @@ gst_props_intersect (GstProps *props1, GstProps *props2)
g_return_val_if_fail (props2 != NULL, NULL); g_return_val_if_fail (props2 != NULL, NULL);
intersection = gst_props_empty_new (); intersection = gst_props_empty_new ();
props1list = props1->properties; props1list = props1->properties;
props2list = props2->properties; props2list = props2->properties;
@ -1915,7 +1924,7 @@ gst_props_intersect (GstProps *props1, GstProps *props2)
gst_props_entry_add_sorted_prepend (intersection, gst_props_entry_copy (entry1)); gst_props_entry_add_sorted_prepend (intersection, gst_props_entry_copy (entry1));
props1list = g_list_next (props1list); props1list = g_list_next (props1list);
if (!props1list) if (!props1list)
goto end; goto end;
entry1 = (GstPropsEntry *)props1list->data; entry1 = (GstPropsEntry *)props1list->data;
@ -1924,7 +1933,7 @@ gst_props_intersect (GstProps *props1, GstProps *props2)
gst_props_entry_add_sorted_prepend (intersection, gst_props_entry_copy (entry2)); gst_props_entry_add_sorted_prepend (intersection, gst_props_entry_copy (entry2));
props2list = g_list_next (props2list); props2list = g_list_next (props2list);
if (!props2list) if (!props2list)
goto end; goto end;
entry2 = (GstPropsEntry *)props2list->data; entry2 = (GstPropsEntry *)props2list->data;
@ -1951,7 +1960,7 @@ end:
leftovers = props2list; leftovers = props2list;
while (leftovers) { while (leftovers) {
gst_props_entry_add_sorted_prepend (intersection, gst_props_entry_add_sorted_prepend (intersection,
gst_props_entry_copy ((GstPropsEntry *) leftovers->data)); gst_props_entry_copy ((GstPropsEntry *) leftovers->data));
leftovers = g_list_next (leftovers); leftovers = g_list_next (leftovers);
} }
@ -1977,7 +1986,7 @@ gst_props_normalize (GstProps *props)
GList *entries; GList *entries;
GList *result = NULL; GList *result = NULL;
if (!props) if (!props)
return NULL; return NULL;
entries = props->properties; entries = props->properties;
@ -2011,7 +2020,7 @@ gst_props_normalize (GstProps *props)
result = g_list_append (result, newprops); result = g_list_append (result, newprops);
} }
list_entries = g_list_next (list_entries); list_entries = g_list_next (list_entries);
} }
/* we break out of the loop because the other lists are /* we break out of the loop because the other lists are
* unrolled in the recursive call */ * unrolled in the recursive call */
@ -2037,14 +2046,14 @@ gst_props_save_thyself_func (GstPropsEntry *entry, xmlNodePtr parent)
gchar *str; gchar *str;
switch (entry->propstype) { switch (entry->propstype) {
case GST_PROPS_INT_TYPE: case GST_PROPS_INT_TYPE:
subtree = xmlNewChild (parent, NULL, "int", NULL); subtree = xmlNewChild (parent, NULL, "int", NULL);
xmlNewProp (subtree, "name", g_quark_to_string (entry->propid)); xmlNewProp (subtree, "name", g_quark_to_string (entry->propid));
str = g_strdup_printf ("%d", entry->data.int_data); str = g_strdup_printf ("%d", entry->data.int_data);
xmlNewProp (subtree, "value", str); xmlNewProp (subtree, "value", str);
g_free(str); g_free(str);
break; break;
case GST_PROPS_INT_RANGE_TYPE: case GST_PROPS_INT_RANGE_TYPE:
subtree = xmlNewChild (parent, NULL, "range", NULL); subtree = xmlNewChild (parent, NULL, "range", NULL);
xmlNewProp (subtree, "name", g_quark_to_string (entry->propid)); xmlNewProp (subtree, "name", g_quark_to_string (entry->propid));
str = g_strdup_printf ("%d", entry->data.int_range_data.min); str = g_strdup_printf ("%d", entry->data.int_range_data.min);
@ -2054,14 +2063,14 @@ gst_props_save_thyself_func (GstPropsEntry *entry, xmlNodePtr parent)
xmlNewProp (subtree, "max", str); xmlNewProp (subtree, "max", str);
g_free(str); g_free(str);
break; break;
case GST_PROPS_FLOAT_TYPE: case GST_PROPS_FLOAT_TYPE:
subtree = xmlNewChild (parent, NULL, "float", NULL); subtree = xmlNewChild (parent, NULL, "float", NULL);
xmlNewProp (subtree, "name", g_quark_to_string (entry->propid)); xmlNewProp (subtree, "name", g_quark_to_string (entry->propid));
str = g_strdup_printf ("%f", entry->data.float_data); str = g_strdup_printf ("%f", entry->data.float_data);
xmlNewProp (subtree, "value", str); xmlNewProp (subtree, "value", str);
g_free(str); g_free(str);
break; break;
case GST_PROPS_FLOAT_RANGE_TYPE: case GST_PROPS_FLOAT_RANGE_TYPE:
subtree = xmlNewChild (parent, NULL, "floatrange", NULL); subtree = xmlNewChild (parent, NULL, "floatrange", NULL);
xmlNewProp (subtree, "name", g_quark_to_string (entry->propid)); xmlNewProp (subtree, "name", g_quark_to_string (entry->propid));
str = g_strdup_printf ("%f", entry->data.float_range_data.min); str = g_strdup_printf ("%f", entry->data.float_range_data.min);
@ -2085,12 +2094,12 @@ gst_props_save_thyself_func (GstPropsEntry *entry, xmlNodePtr parent)
xmlNewProp (subtree, "hexvalue", str); xmlNewProp (subtree, "hexvalue", str);
g_free(str); g_free(str);
break; break;
case GST_PROPS_BOOLEAN_TYPE: case GST_PROPS_BOOLEAN_TYPE:
subtree = xmlNewChild (parent, NULL, "boolean", NULL); subtree = xmlNewChild (parent, NULL, "boolean", NULL);
xmlNewProp (subtree, "name", g_quark_to_string (entry->propid)); xmlNewProp (subtree, "name", g_quark_to_string (entry->propid));
xmlNewProp (subtree, "value", (entry->data.bool_data ? "true" : "false")); xmlNewProp (subtree, "value", (entry->data.bool_data ? "true" : "false"));
break; break;
case GST_PROPS_STRING_TYPE: case GST_PROPS_STRING_TYPE:
subtree = xmlNewChild (parent, NULL, "string", NULL); subtree = xmlNewChild (parent, NULL, "string", NULL);
xmlNewProp (subtree, "name", g_quark_to_string (entry->propid)); xmlNewProp (subtree, "name", g_quark_to_string (entry->propid));
xmlNewProp (subtree, "value", entry->data.string_data.string); xmlNewProp (subtree, "value", entry->data.string_data.string);
@ -2137,7 +2146,7 @@ gst_props_save_thyself (GstProps *props, xmlNodePtr parent)
proplist = g_list_next (proplist); proplist = g_list_next (proplist);
} }
return parent; return parent;
} }
@ -2270,7 +2279,7 @@ gst_props_load_thyself (xmlNodePtr parent)
entry = gst_props_load_thyself_func (field); entry = gst_props_load_thyself_func (field);
if (entry) if (entry)
gst_props_add_entry (props, entry); gst_props_add_entry (props, entry);
} }
field = field->next; field = field->next;

View file

@ -115,6 +115,7 @@ struct _GstProps {
void _gst_props_initialize (void); void _gst_props_initialize (void);
/* creating new properties */ /* creating new properties */
GType gst_props_get_type (void);
GstProps* gst_props_new (const gchar *firstname, ...); GstProps* gst_props_new (const gchar *firstname, ...);
GstProps* gst_props_newv (const gchar *firstname, va_list var_args); GstProps* gst_props_newv (const gchar *firstname, va_list var_args);
GstProps* gst_props_empty_new (void); GstProps* gst_props_empty_new (void);
@ -161,11 +162,12 @@ void gst_props_remove_entry (GstProps *props, GstPropsEntry *entry);
void gst_props_remove_entry_by_name (GstProps *props, const gchar *name); void gst_props_remove_entry_by_name (GstProps *props, const gchar *name);
/* working with props entries */ /* working with props entries */
GType gst_props_entry_get_type (void);
GstPropsEntry* gst_props_entry_new (const gchar *name, ...); GstPropsEntry* gst_props_entry_new (const gchar *name, ...);
void gst_props_entry_destroy (GstPropsEntry *entry); void gst_props_entry_destroy (GstPropsEntry *entry);
GstPropsEntry* gst_props_entry_copy (const GstPropsEntry *entry); GstPropsEntry* gst_props_entry_copy (const GstPropsEntry *entry);
GstPropsType gst_props_entry_get_type (const GstPropsEntry *entry); GstPropsType gst_props_entry_get_props_type (const GstPropsEntry *entry);
const gchar* gst_props_entry_get_name (const GstPropsEntry *entry); const gchar* gst_props_entry_get_name (const GstPropsEntry *entry);
gboolean gst_props_entry_is_fixed (const GstPropsEntry *entry); gboolean gst_props_entry_is_fixed (const GstPropsEntry *entry);

View file

@ -304,7 +304,7 @@ gst_print_props (GString *buf, gint indent, GList *props, gboolean showname)
string_append_indent (buf, 2 + width - strlen (name)); string_append_indent (buf, 2 + width - strlen (name));
} }
type = gst_props_entry_get_type (prop); type = gst_props_entry_get_props_type (prop);
switch (type) { switch (type) {
case GST_PROPS_INT_TYPE: case GST_PROPS_INT_TYPE:
{ {

View file

@ -1286,7 +1286,7 @@ gst_xml_registry_save_props_func (GstPropsEntry *entry,
name = gst_props_entry_get_name (entry); name = gst_props_entry_get_name (entry);
switch (gst_props_entry_get_type (entry)) { switch (gst_props_entry_get_props_type (entry)) {
case GST_PROPS_INT_TYPE: case GST_PROPS_INT_TYPE:
{ {
gint value; gint value;
@ -1338,7 +1338,7 @@ gst_xml_registry_save_props_func (GstPropsEntry *entry,
break; break;
} }
default: default:
g_warning ("trying to save unknown property type %d", gst_props_entry_get_type (entry)); g_warning ("trying to save unknown property type %d", gst_props_entry_get_props_type (entry));
return FALSE; return FALSE;
} }
return TRUE; return TRUE;
@ -1354,7 +1354,7 @@ gst_xml_registry_save_props (GstXMLRegistry *xmlregistry, GstProps *props)
while (proplist) { while (proplist) {
GstPropsEntry *entry = (GstPropsEntry *) proplist->data; GstPropsEntry *entry = (GstPropsEntry *) proplist->data;
switch (gst_props_entry_get_type (entry)) { switch (gst_props_entry_get_props_type (entry)) {
case GST_PROPS_LIST_TYPE: case GST_PROPS_LIST_TYPE:
{ {
const GList *list; const GList *list;

View file

@ -2,8 +2,8 @@
#include <gst/control/control.h> #include <gst/control/control.h>
#include <string.h> #include <string.h>
static void static void
print_prop (GstPropsEntry *prop, gboolean showname, const gchar *pfx) print_prop (GstPropsEntry *prop, gboolean showname, const gchar *pfx)
{ {
GstPropsType type; GstPropsType type;
@ -12,7 +12,7 @@ print_prop (GstPropsEntry *prop, gboolean showname, const gchar *pfx)
else else
g_print(pfx); g_print(pfx);
type = gst_props_entry_get_type (prop); type = gst_props_entry_get_props_type (prop);
switch (type) { switch (type) {
case GST_PROPS_INT_TYPE: case GST_PROPS_INT_TYPE:
@ -62,10 +62,10 @@ print_prop (GstPropsEntry *prop, gboolean showname, const gchar *pfx)
guint32 val; guint32 val;
gst_props_entry_get_fourcc_int (prop, &val); gst_props_entry_get_fourcc_int (prop, &val);
g_print("FourCC: '%c%c%c%c'\n", g_print("FourCC: '%c%c%c%c'\n",
(gchar)( val & 0xff), (gchar)( val & 0xff),
(gchar)((val >> 8) & 0xff), (gchar)((val >> 8) & 0xff),
(gchar)((val >> 16) & 0xff), (gchar)((val >> 16) & 0xff),
(gchar)((val >> 24) & 0xff)); (gchar)((val >> 24) & 0xff));
break; break;
} }
case GST_PROPS_LIST_TYPE: case GST_PROPS_LIST_TYPE:
@ -92,8 +92,8 @@ print_prop (GstPropsEntry *prop, gboolean showname, const gchar *pfx)
} }
} }
static void static void
print_props (GstProps *properties, const gchar *pfx) print_props (GstProps *properties, const gchar *pfx)
{ {
GList *props; GList *props;
GstPropsEntry *prop; GstPropsEntry *prop;
@ -107,8 +107,8 @@ print_props (GstProps *properties, const gchar *pfx)
} }
} }
static void static void
print_caps (const GstCaps *caps, const gchar *pfx) print_caps (const GstCaps *caps, const gchar *pfx)
{ {
while (caps) { while (caps) {
GstType *type; GstType *type;
@ -116,7 +116,7 @@ print_caps (const GstCaps *caps, const gchar *pfx)
g_print ("%s'%s': (%sfixed)\n", pfx, caps->name, (GST_CAPS_IS_FIXED (caps) ? "" : "NOT ")); g_print ("%s'%s': (%sfixed)\n", pfx, caps->name, (GST_CAPS_IS_FIXED (caps) ? "" : "NOT "));
type = gst_type_find_by_id (caps->id); type = gst_type_find_by_id (caps->id);
if (type) if (type)
g_print ("%s MIME type: '%s':\n", pfx, type->mime); g_print ("%s MIME type: '%s':\n", pfx, type->mime);
else else
g_print ("%s MIME type: 'unknown/unknown':\n", pfx); g_print ("%s MIME type: 'unknown/unknown':\n", pfx);
@ -133,8 +133,8 @@ print_caps (const GstCaps *caps, const gchar *pfx)
} }
} }
static void static void
print_formats (const GstFormat *formats) print_formats (const GstFormat *formats)
{ {
while (formats && *formats) { while (formats && *formats) {
const GstFormatDefinition *definition; const GstFormatDefinition *definition;
@ -142,7 +142,7 @@ print_formats (const GstFormat *formats)
definition = gst_format_get_details (*formats); definition = gst_format_get_details (*formats);
if (definition) if (definition)
g_print ("\t\t(%d):\t%s (%s)\n", *formats, g_print ("\t\t(%d):\t%s (%s)\n", *formats,
definition->nick, definition->description); definition->nick, definition->description);
else else
g_print ("\t\t(%d):\tUnknown format\n", *formats); g_print ("\t\t(%d):\tUnknown format\n", *formats);
@ -150,8 +150,8 @@ print_formats (const GstFormat *formats)
} }
} }
static void static void
print_query_types (const GstQueryType *types) print_query_types (const GstQueryType *types)
{ {
while (types && *types) { while (types && *types) {
const GstQueryTypeDefinition *definition; const GstQueryTypeDefinition *definition;
@ -159,7 +159,7 @@ print_query_types (const GstQueryType *types)
definition = gst_query_type_get_details (*types); definition = gst_query_type_get_details (*types);
if (definition) if (definition)
g_print ("\t\t(%d):\t%s (%s)\n", *types, g_print ("\t\t(%d):\t%s (%s)\n", *types,
definition->nick, definition->description); definition->nick, definition->description);
else else
g_print ("\t\t(%d):\tUnknown query format\n", *types); g_print ("\t\t(%d):\tUnknown query format\n", *types);
@ -167,8 +167,8 @@ print_query_types (const GstQueryType *types)
} }
} }
static void static void
print_event_masks (const GstEventMask *masks) print_event_masks (const GstEventMask *masks)
{ {
#ifndef GST_DISABLE_ENUMTYPES #ifndef GST_DISABLE_ENUMTYPES
GType event_type; GType event_type;
@ -186,13 +186,13 @@ print_event_masks (const GstEventMask *masks)
switch (masks->type) { switch (masks->type) {
case GST_EVENT_SEEK: case GST_EVENT_SEEK:
flags = masks->flags; flags = masks->flags;
event_flags = gst_seek_type_get_type (); event_flags = gst_seek_type_get_type ();
flags_class = (GFlagsClass *) g_type_class_ref (event_flags); flags_class = (GFlagsClass *) g_type_class_ref (event_flags);
break; break;
default: default:
break; break;
} }
value = g_enum_get_value (klass, masks->type); value = g_enum_get_value (klass, masks->type);
g_print ("\t\t%s ", value->value_nick); g_print ("\t\t%s ", value->value_nick);
@ -202,16 +202,16 @@ print_event_masks (const GstEventMask *masks)
if (flags & 1) { if (flags & 1) {
value = g_flags_get_first_value (flags_class, 1 << index); value = g_flags_get_first_value (flags_class, 1 << index);
if (value) if (value)
g_print ("| %s ", value->value_nick); g_print ("| %s ", value->value_nick);
else else
g_print ("| ? "); g_print ("| ? ");
} }
flags >>= 1; flags >>= 1;
index++; index++;
} }
g_print ("\n"); g_print ("\n");
masks++; masks++;
} }
#endif #endif
@ -230,28 +230,28 @@ output_hierarchy (GType type, gint level, gint *maxlevel)
if (parent) if (parent)
output_hierarchy (parent, level, maxlevel); output_hierarchy (parent, level, maxlevel);
for (i=1; i<*maxlevel-level; i++) for (i=1; i<*maxlevel-level; i++)
g_print (" "); g_print (" ");
if (*maxlevel-level) if (*maxlevel-level)
g_print (" +----"); g_print (" +----");
g_print ("%s\n", g_type_name (type)); g_print ("%s\n", g_type_name (type));
if (level == 1) if (level == 1)
g_print ("\n"); g_print ("\n");
} }
static void static void
print_element_properties (GstElement *element) print_element_properties (GstElement *element)
{ {
GParamSpec **property_specs; GParamSpec **property_specs;
gint num_properties,i; gint num_properties,i;
gboolean readable; gboolean readable;
property_specs = g_object_class_list_properties
(G_OBJECT_GET_CLASS (element), &num_properties); property_specs = g_object_class_list_properties
(G_OBJECT_GET_CLASS (element), &num_properties);
g_print("\nElement Arguments:\n"); g_print("\nElement Arguments:\n");
for (i = 0; i < num_properties; i++) { for (i = 0; i < num_properties; i++) {
@ -266,173 +266,175 @@ print_element_properties (GstElement *element)
} }
g_print(" %-20s: %s\n", g_param_spec_get_name (param), g_print(" %-20s: %s\n", g_param_spec_get_name (param),
g_param_spec_get_blurb (param)); g_param_spec_get_blurb (param));
switch (G_VALUE_TYPE (&value)) { switch (G_VALUE_TYPE (&value)) {
case G_TYPE_STRING: case G_TYPE_STRING:
g_print ("%-23.23s String. ", ""); g_print ("%-23.23s String. ", "");
if (readable) g_print ("(Default \"%s\")", g_value_get_string (&value)); if (readable) g_print ("(Default \"%s\")", g_value_get_string (&value));
break; break;
case G_TYPE_BOOLEAN: case G_TYPE_BOOLEAN:
g_print ("%-23.23s Boolean. ", ""); g_print ("%-23.23s Boolean. ", "");
if (readable) g_print ("(Default %s)", (g_value_get_boolean (&value) ? "true" : "false")); if (readable) g_print ("(Default %s)", (g_value_get_boolean (&value) ? "true" : "false"));
break; break;
case G_TYPE_ULONG: case G_TYPE_ULONG:
{ {
GParamSpecULong *pulong = G_PARAM_SPEC_ULONG (param); GParamSpecULong *pulong = G_PARAM_SPEC_ULONG (param);
g_print("%-23.23s Unsigned Long. ", ""); g_print("%-23.23s Unsigned Long. ", "");
if (readable) g_print("Range: %lu - %lu (Default %lu)", if (readable) g_print("Range: %lu - %lu (Default %lu)",
pulong->minimum, pulong->maximum, g_value_get_ulong (&value)); pulong->minimum, pulong->maximum, g_value_get_ulong (&value));
break; break;
} }
case G_TYPE_LONG: case G_TYPE_LONG:
{ {
GParamSpecLong *plong = G_PARAM_SPEC_LONG (param); GParamSpecLong *plong = G_PARAM_SPEC_LONG (param);
g_print("%-23.23s Long. ", ""); g_print("%-23.23s Long. ", "");
if (readable) g_print("Range: %ld - %ld (Default %ld)", if (readable) g_print("Range: %ld - %ld (Default %ld)",
plong->minimum, plong->maximum, g_value_get_long (&value)); plong->minimum, plong->maximum, g_value_get_long (&value));
break; break;
} }
case G_TYPE_UINT: case G_TYPE_UINT:
{ {
GParamSpecUInt *puint = G_PARAM_SPEC_UINT (param); GParamSpecUInt *puint = G_PARAM_SPEC_UINT (param);
g_print("%-23.23s Unsigned Integer. ", ""); g_print("%-23.23s Unsigned Integer. ", "");
if (readable) g_print("Range: %u - %u (Default %u)", if (readable) g_print("Range: %u - %u (Default %u)",
puint->minimum, puint->maximum, g_value_get_uint (&value)); puint->minimum, puint->maximum, g_value_get_uint (&value));
break; break;
} }
case G_TYPE_INT: case G_TYPE_INT:
{ {
GParamSpecInt *pint = G_PARAM_SPEC_INT (param); GParamSpecInt *pint = G_PARAM_SPEC_INT (param);
g_print("%-23.23s Integer. ", ""); g_print("%-23.23s Integer. ", "");
if (readable) g_print("Range: %d - %d (Default %d)", if (readable) g_print("Range: %d - %d (Default %d)",
pint->minimum, pint->maximum, g_value_get_int (&value)); pint->minimum, pint->maximum, g_value_get_int (&value));
break; break;
} }
case G_TYPE_UINT64: case G_TYPE_UINT64:
{ {
GParamSpecUInt64 *puint64 = G_PARAM_SPEC_UINT64 (param); GParamSpecUInt64 *puint64 = G_PARAM_SPEC_UINT64 (param);
g_print("%-23.23s Unsigned Integer64. ", ""); g_print("%-23.23s Unsigned Integer64. ", "");
if (readable) g_print("Range: %" G_GUINT64_FORMAT " - %" G_GUINT64_FORMAT " (Default %" G_GUINT64_FORMAT ")", if (readable) g_print("Range: %" G_GUINT64_FORMAT " - %"
puint64->minimum, puint64->maximum, g_value_get_uint64 (&value)); G_GUINT64_FORMAT " (Default %" G_GUINT64_FORMAT ")",
break; puint64->minimum, puint64->maximum,
g_value_get_uint64 (&value));
break;
} }
case G_TYPE_INT64: case G_TYPE_INT64:
{ {
GParamSpecInt64 *pint64 = G_PARAM_SPEC_INT64 (param); GParamSpecInt64 *pint64 = G_PARAM_SPEC_INT64 (param);
g_print("%-23.23s Integer64. ", ""); g_print("%-23.23s Integer64. ", "");
if (readable) g_print("Range: %" G_GINT64_FORMAT " - %" G_GINT64_FORMAT " (Default %" G_GINT64_FORMAT ")", if (readable) g_print("Range: %" G_GINT64_FORMAT " - %" G_GINT64_FORMAT " (Default %" G_GINT64_FORMAT ")", pint64->minimum,
pint64->minimum, pint64->maximum, g_value_get_int64 (&value)); pint64->maximum, g_value_get_int64 (&value));
break; break;
} }
case G_TYPE_FLOAT: case G_TYPE_FLOAT:
{ {
GParamSpecFloat *pfloat = G_PARAM_SPEC_FLOAT (param); GParamSpecFloat *pfloat = G_PARAM_SPEC_FLOAT (param);
g_print("%-23.23s Float. Default: %-8.8s %15.7g\n", "", "", g_print("%-23.23s Float. Default: %-8.8s %15.7g\n", "", "",
g_value_get_float (&value)); g_value_get_float (&value));
g_print("%-23.23s Range: %15.7g - %15.7g", "", g_print("%-23.23s Range: %15.7g - %15.7g", "",
pfloat->minimum, pfloat->maximum); pfloat->minimum, pfloat->maximum);
break; break;
} }
case G_TYPE_DOUBLE: case G_TYPE_DOUBLE:
{ {
GParamSpecDouble *pdouble = G_PARAM_SPEC_DOUBLE (param); GParamSpecDouble *pdouble = G_PARAM_SPEC_DOUBLE (param);
g_print("%-23.23s Double. Default: %-8.8s %15.7g\n", "", "", g_print("%-23.23s Double. Default: %-8.8s %15.7g\n", "", "",
g_value_get_double (&value)); g_value_get_double (&value));
g_print("%-23.23s Range: %15.7g - %15.7g", "", g_print("%-23.23s Range: %15.7g - %15.7g", "",
pdouble->minimum, pdouble->maximum); pdouble->minimum, pdouble->maximum);
break; break;
} }
default: default:
if (param->value_type == GST_TYPE_URI) { if (param->value_type == GST_TYPE_URI) {
g_print("%-23.23s URI", ""); g_print("%-23.23s URI", "");
} }
if (param->value_type == GST_TYPE_CAPS) { if (param->value_type == GST_TYPE_CAPS) {
GstCaps *caps = g_value_peek_pointer (&value); GstCaps *caps = g_value_peek_pointer (&value);
if (!caps) if (!caps)
g_print("%-23.23s Caps (NULL)", ""); g_print("%-23.23s Caps (NULL)", "");
else { else {
print_caps (caps, " "); print_caps (caps, " ");
} }
} }
else if (G_IS_PARAM_SPEC_ENUM (param)) { else if (G_IS_PARAM_SPEC_ENUM (param)) {
GEnumValue *values; GEnumValue *values;
guint j = 0; guint j = 0;
gint enum_value; gint enum_value;
values = G_ENUM_CLASS (g_type_class_ref (param->value_type))->values; values = G_ENUM_CLASS (g_type_class_ref (param->value_type))->values;
enum_value = g_value_get_enum (&value); enum_value = g_value_get_enum (&value);
while (values[j].value_name) { while (values[j].value_name) {
if (values[j].value == enum_value) if (values[j].value == enum_value)
break; break;
j++; j++;
} }
g_print ("%-23.23s Enum \"%s\" (default %d, \"%s\")", "", g_print ("%-23.23s Enum \"%s\" (default %d, \"%s\")", "",
g_type_name (G_VALUE_TYPE (&value)), g_type_name (G_VALUE_TYPE (&value)),
enum_value, values[j].value_nick); enum_value, values[j].value_nick);
j = 0; j = 0;
while (values[j].value_name) { while (values[j].value_name) {
g_print("\n%-23.23s (%d): \t%s", "", g_print("\n%-23.23s (%d): \t%s", "",
values[j].value, values[j].value_nick); values[j].value, values[j].value_nick);
j++; j++;
} }
/* g_type_class_unref (ec); */ /* g_type_class_unref (ec); */
} }
else if (G_IS_PARAM_SPEC_FLAGS (param)) { else if (G_IS_PARAM_SPEC_FLAGS (param)) {
GFlagsValue *values; GFlagsValue *values;
guint j = 0; guint j = 0;
gint flags_value; gint flags_value;
GString *flags = NULL; GString *flags = NULL;
values = G_FLAGS_CLASS (g_type_class_ref (param->value_type))->values; values = G_FLAGS_CLASS (g_type_class_ref (param->value_type))->values;
flags_value = g_value_get_flags (&value); flags_value = g_value_get_flags (&value);
while (values[j].value_name) { while (values[j].value_name) {
if (values[j].value & flags_value) { if (values[j].value & flags_value) {
if (flags) { if (flags) {
g_string_append_printf (flags, " | %s", values[j].value_nick); g_string_append_printf (flags, " | %s", values[j].value_nick);
} }
else { else {
flags = g_string_new (values[j].value_nick); flags = g_string_new (values[j].value_nick);
} }
} }
j++; j++;
} }
g_print ("%-23.23s Flags \"%s\" (default %d, \"%s\")", "", g_print("%-23.23s Flags \"%s\" (default %d, \"%s\")", "",
g_type_name (G_VALUE_TYPE (&value)), g_type_name (G_VALUE_TYPE (&value)),
flags_value, (flags ? flags->str : "(none)")); flags_value, (flags ? flags->str : "(none)"));
j = 0; j = 0;
while (values[j].value_name) { while (values[j].value_name) {
g_print("\n%-23.23s (%d): \t%s", "", g_print("\n%-23.23s (%d): \t%s", "",
values[j].value, values[j].value_nick); values[j].value, values[j].value_nick);
j++; j++;
} }
if (flags) if (flags)
g_string_free (flags, TRUE); g_string_free (flags, TRUE);
} }
else if (G_IS_PARAM_SPEC_OBJECT (param)) { else if (G_IS_PARAM_SPEC_OBJECT (param)) {
g_print("%-23.23s Object of type \"%s\"", "", g_print("%-23.23s Object of type \"%s\"", "",
g_type_name(param->value_type)); g_type_name(param->value_type));
}
else {
g_print ("%-23.23s Unknown type %ld \"%s\"", "", param->value_type,
g_type_name(param->value_type));
} }
else {
g_print ("%-23.23s Unknown type %ld \"%s\"", "",param->value_type,
g_type_name(param->value_type));
}
break; break;
} }
if (!readable) if (!readable)
g_print (" Write only\n"); g_print (" Write only\n");
else else
g_print ("\n"); g_print ("\n");
} }
if (num_properties == 0) if (num_properties == 0)
g_print (" none\n"); g_print (" none\n");
} }
@ -500,7 +502,7 @@ print_element_info (GstElementFactory *factory)
if (padtemplate->caps) { if (padtemplate->caps) {
g_print (" Capabilities:\n"); g_print (" Capabilities:\n");
print_caps (padtemplate->caps, " "); print_caps (padtemplate->caps, " ");
} }
g_print ("\n"); g_print ("\n");
@ -554,7 +556,7 @@ print_element_info (GstElementFactory *factory)
if (element->loopfunc) if (element->loopfunc)
g_print (" loopfunc()-based element: %s\n", g_print (" loopfunc()-based element: %s\n",
GST_DEBUG_FUNCPTR_NAME (element->loopfunc)); GST_DEBUG_FUNCPTR_NAME (element->loopfunc));
else else
g_print (" No loopfunc(), must be chain-based or not configured yet\n"); g_print (" No loopfunc(), must be chain-based or not configured yet\n");
@ -622,47 +624,47 @@ print_element_info (GstElementFactory *factory)
g_print (" Implementation:\n"); g_print (" Implementation:\n");
if (realpad->chainfunc) if (realpad->chainfunc)
g_print (" Has chainfunc(): %s\n", g_print (" Has chainfunc(): %s\n",
GST_DEBUG_FUNCPTR_NAME (realpad->chainfunc)); GST_DEBUG_FUNCPTR_NAME (realpad->chainfunc));
if (realpad->getfunc) if (realpad->getfunc)
g_print (" Has getfunc(): %s\n", g_print (" Has getfunc(): %s\n",
GST_DEBUG_FUNCPTR_NAME (realpad->getfunc)); GST_DEBUG_FUNCPTR_NAME (realpad->getfunc));
if (realpad->formatsfunc != gst_pad_get_formats_default) { if (realpad->formatsfunc != gst_pad_get_formats_default) {
g_print (" Supports seeking/conversion/query formats:\n"); g_print (" 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)
g_print (" Has custom convertfunc(): %s\n", g_print (" Has custom convertfunc(): %s\n",
GST_DEBUG_FUNCPTR_NAME (realpad->convertfunc)); GST_DEBUG_FUNCPTR_NAME (realpad->convertfunc));
if (realpad->eventfunc != gst_pad_event_default) if (realpad->eventfunc != gst_pad_event_default)
g_print (" Has custom eventfunc(): %s\n", g_print (" Has custom eventfunc(): %s\n",
GST_DEBUG_FUNCPTR_NAME (realpad->eventfunc)); GST_DEBUG_FUNCPTR_NAME (realpad->eventfunc));
if (realpad->eventmaskfunc != gst_pad_get_event_masks_default) { if (realpad->eventmaskfunc != gst_pad_get_event_masks_default) {
g_print (" Provides event masks:\n"); g_print (" 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)
g_print (" Has custom queryfunc(): %s\n", g_print (" Has custom queryfunc(): %s\n",
GST_DEBUG_FUNCPTR_NAME (realpad->queryfunc)); GST_DEBUG_FUNCPTR_NAME (realpad->queryfunc));
if (realpad->querytypefunc != gst_pad_get_query_types_default) { if (realpad->querytypefunc != gst_pad_get_query_types_default) {
g_print (" Provides query types:\n"); g_print (" 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->intlinkfunc != gst_pad_get_internal_links_default) if (realpad->intlinkfunc != gst_pad_get_internal_links_default)
g_print (" Has custom intconnfunc(): %s\n", g_print (" Has custom intconnfunc(): %s\n",
GST_DEBUG_FUNCPTR_NAME(realpad->intlinkfunc)); GST_DEBUG_FUNCPTR_NAME(realpad->intlinkfunc));
if (realpad->bufferpoolfunc) if (realpad->bufferpoolfunc)
g_print (" Has bufferpoolfunc(): %s\n", g_print (" Has bufferpoolfunc(): %s\n",
GST_DEBUG_FUNCPTR_NAME(realpad->bufferpoolfunc)); GST_DEBUG_FUNCPTR_NAME(realpad->bufferpoolfunc));
if (pad->padtemplate) if (pad->padtemplate)
g_print (" Pad Template: '%s'\n", g_print (" Pad Template: '%s'\n",
pad->padtemplate->name_template); pad->padtemplate->name_template);
if (realpad->caps) { if (realpad->caps) {
g_print (" Capabilities:\n"); g_print (" Capabilities:\n");
print_caps (realpad->caps, " "); print_caps (realpad->caps, " ");
} }
} }
} else } else
@ -675,7 +677,7 @@ print_element_info (GstElementFactory *factory)
GstDParamManager* dpman; GstDParamManager* dpman;
GParamSpec** specs; GParamSpec** specs;
gint x; gint x;
g_print ("\nDynamic Parameters:\n"); g_print ("\nDynamic Parameters:\n");
if((dpman = gst_dpman_get_manager (element))) { if((dpman = gst_dpman_get_manager (element))) {
specs = gst_dpman_list_dparam_specs (dpman); specs = gst_dpman_list_dparam_specs (dpman);
@ -683,23 +685,24 @@ print_element_info (GstElementFactory *factory)
g_print (" %-20.20s: ", g_param_spec_get_name (specs[x])); g_print (" %-20.20s: ", g_param_spec_get_name (specs[x]));
switch (G_PARAM_SPEC_VALUE_TYPE (specs[x])) { switch (G_PARAM_SPEC_VALUE_TYPE (specs[x])) {
case G_TYPE_INT64: case G_TYPE_INT64:
g_print ("64 Bit Integer (Default %" G_GINT64_FORMAT ", Range %" G_GINT64_FORMAT " -> %" G_GINT64_FORMAT ")", g_print ("64 Bit Integer (Default %" G_GINT64_FORMAT ", Range %"
G_GINT64_FORMAT " -> %" G_GINT64_FORMAT ")",
((GParamSpecInt64 *) specs[x])->default_value, ((GParamSpecInt64 *) specs[x])->default_value,
((GParamSpecInt64 *) specs[x])->minimum, ((GParamSpecInt64 *) specs[x])->minimum,
((GParamSpecInt64 *) specs[x])->maximum); ((GParamSpecInt64 *) specs[x])->maximum);
break; break;
case G_TYPE_INT: case G_TYPE_INT:
g_print ("Integer (Default %d, Range %d -> %d)", g_print ("Integer (Default %d, Range %d -> %d)",
((GParamSpecInt *) specs[x])->default_value, ((GParamSpecInt *) specs[x])->default_value,
((GParamSpecInt *) specs[x])->minimum, ((GParamSpecInt *) specs[x])->minimum,
((GParamSpecInt *) specs[x])->maximum); ((GParamSpecInt *) specs[x])->maximum);
break; break;
case G_TYPE_FLOAT: case G_TYPE_FLOAT:
g_print ("Float. Default: %-8.8s %15.7g\n", "", g_print ("Float. Default: %-8.8s %15.7g\n", "",
((GParamSpecFloat *) specs[x])->default_value); ((GParamSpecFloat *) specs[x])->default_value);
g_print ("%-23.23s Range: %15.7g - %15.7g", "", g_print ("%-23.23s Range: %15.7g - %15.7g", "",
((GParamSpecFloat *) specs[x])->minimum, ((GParamSpecFloat *) specs[x])->minimum,
((GParamSpecFloat *) specs[x])->maximum); ((GParamSpecFloat *) specs[x])->maximum);
break; break;
default: g_print ("unknown %ld", G_PARAM_SPEC_VALUE_TYPE (specs[x])); default: g_print ("unknown %ld", G_PARAM_SPEC_VALUE_TYPE (specs[x]));
@ -713,13 +716,13 @@ print_element_info (GstElementFactory *factory)
} }
} }
/* Signals/Actions Block */ /* Signals/Actions Block */
{ {
guint *signals; guint *signals;
guint nsignals; guint nsignals;
gint i, k; gint i, k;
GSignalQuery *query; GSignalQuery *query;
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++) { for (k = 0; k < 2; k++) {
gint counted = 0; gint counted = 0;
@ -734,43 +737,42 @@ print_element_info (GstElementFactory *factory)
GType return_type; GType return_type;
const GType *param_types; const GType *param_types;
gint j; gint j;
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)) || if ((k == 0 && !(query->signal_flags & G_SIGNAL_ACTION)) ||
(k == 1 && (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;
g_print (" \"%s\" :\t %s user_function (%s* object", g_print (" \"%s\" :\t %s user_function (%s* object",
query->signal_name, g_type_name (return_type), 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++) {
g_print (",\n \t\t\t\t%s arg%d", g_type_name (param_types[j]), j); g_print (",\n \t\t\t\t%s arg%d", g_type_name(param_types[j]), j);
} }
if (k == 0) if (k == 0)
g_print (",\n \t\t\t\tgpointer user_data);\n"); g_print (",\n \t\t\t\tgpointer user_data);\n");
else else
g_print (");\n"); g_print (");\n");
counted++; counted++;
} }
g_free (query); g_free (query);
} }
if (counted == 0) g_print (" none\n"); if (counted == 0) g_print (" none\n");
} }
} }
/* for compound elements */ /* for compound elements */
if (GST_IS_BIN (element)) { if (GST_IS_BIN (element)) {
g_print ("\nChildren:\n"); g_print ("\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"); g_print (" none\n");
else { else {
while (children) { while (children) {
@ -785,8 +787,8 @@ print_element_info (GstElementFactory *factory)
return 0; return 0;
} }
static void static void
print_element_list (void) print_element_list (void)
{ {
GList *plugins; GList *plugins;
@ -794,7 +796,7 @@ print_element_list (void)
while (plugins) { while (plugins) {
GList *features; GList *features;
GstPlugin *plugin; GstPlugin *plugin;
plugin = (GstPlugin*)(plugins->data); plugin = (GstPlugin*)(plugins->data);
plugins = g_list_next (plugins); plugins = g_list_next (plugins);
@ -808,16 +810,16 @@ print_element_list (void)
GstElementFactory *factory; GstElementFactory *factory;
factory = GST_ELEMENT_FACTORY (feature); factory = GST_ELEMENT_FACTORY (feature);
g_print ("%s: %s: %s\n", plugin->name, g_print ("%s: %s: %s\n", plugin->name,
GST_PLUGIN_FEATURE_NAME (factory) ,factory->details->longname); GST_PLUGIN_FEATURE_NAME (factory) ,factory->details->longname);
} }
#ifndef GST_DISABLE_AUTOPLUG #ifndef GST_DISABLE_AUTOPLUG
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);
g_print ("%s: %s: %s\n", plugin->name, g_print ("%s: %s: %s\n", plugin->name,
GST_PLUGIN_FEATURE_NAME (factory), factory->longdesc); GST_PLUGIN_FEATURE_NAME (factory), factory->longdesc);
} }
#endif #endif
#ifndef GST_DISABLE_INDEX #ifndef GST_DISABLE_INDEX
@ -825,42 +827,42 @@ print_element_list (void)
GstIndexFactory *factory; GstIndexFactory *factory;
factory = GST_INDEX_FACTORY (feature); factory = GST_INDEX_FACTORY (feature);
g_print ("%s: %s: %s\n", plugin->name, g_print ("%s: %s: %s\n", plugin->name,
GST_PLUGIN_FEATURE_NAME (factory), factory->longdesc); GST_PLUGIN_FEATURE_NAME (factory), factory->longdesc);
} }
#endif #endif
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);
g_print ("%s type: %s: %s\n", plugin->name, g_print ("%s type: %s: %s\n", plugin->name,
factory->mime, factory->exts); factory->mime, factory->exts);
if (factory->typefindfunc) if (factory->typefindfunc)
g_print (" Has typefind function: %s\n", g_print (" Has typefind function: %s\n",
GST_DEBUG_FUNCPTR_NAME (factory->typefindfunc)); 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);
g_print ("%s: %s: %s\n", plugin->name, g_print ("%s: %s: %s\n", plugin->name,
GST_PLUGIN_FEATURE_NAME (factory), factory->longdesc); GST_PLUGIN_FEATURE_NAME (factory), factory->longdesc);
} }
#ifndef GST_DISABLE_URI #ifndef GST_DISABLE_URI
else if (GST_IS_URI_HANDLER (feature)) { else if (GST_IS_URI_HANDLER (feature)) {
GstURIHandler *handler; GstURIHandler *handler;
handler = GST_URI_HANDLER (feature); handler = GST_URI_HANDLER (feature);
g_print ("%s: %s: \"%s\" (%s) element \"%s\" property \"%s\"\n", plugin->name, g_print ("%s: %s: \"%s\" (%s) element \"%s\" property \"%s\"\n",
GST_PLUGIN_FEATURE_NAME (handler), handler->uri, handler->longdesc, plugin->name, GST_PLUGIN_FEATURE_NAME (handler), handler->uri,
handler->element, handler->property); handler->longdesc, handler->element, handler->property);
} }
#endif #endif
else { else {
g_print ("%s: %s (%s)\n", plugin->name, g_print ("%s: %s (%s)\n", plugin->name,
GST_PLUGIN_FEATURE_NAME (feature), GST_PLUGIN_FEATURE_NAME (feature),
g_type_name (G_OBJECT_TYPE (feature))); g_type_name (G_OBJECT_TYPE (feature)));
} }
features = g_list_next (features); features = g_list_next (features);
@ -879,7 +881,7 @@ print_plugin_info (GstPlugin *plugin)
gint num_schedulers = 0; gint num_schedulers = 0;
gint num_indexes = 0; gint num_indexes = 0;
gint num_other = 0; gint num_other = 0;
g_print ("Plugin Details:\n"); g_print ("Plugin Details:\n");
g_print (" Name:\t\t%s\n", plugin->name); g_print (" Name:\t\t%s\n", plugin->name);
g_print (" Long Name:\t%s\n", plugin->longname); g_print (" Long Name:\t%s\n", plugin->longname);
@ -898,7 +900,7 @@ print_plugin_info (GstPlugin *plugin)
factory = GST_ELEMENT_FACTORY (feature); factory = GST_ELEMENT_FACTORY (feature);
g_print (" %s: %s\n", GST_OBJECT_NAME (factory), g_print (" %s: %s\n", GST_OBJECT_NAME (factory),
factory->details->longname); factory->details->longname);
num_elements++; num_elements++;
} }
#ifndef GST_DISABLE_AUTOPLUG #ifndef GST_DISABLE_AUTOPLUG
@ -926,8 +928,8 @@ print_plugin_info (GstPlugin *plugin)
g_print (" %s: %s\n", factory->mime, factory->exts); g_print (" %s: %s\n", factory->mime, factory->exts);
if (factory->typefindfunc) if (factory->typefindfunc)
g_print (" Has typefind function: %s\n", g_print (" Has typefind function: %s\n",
GST_DEBUG_FUNCPTR_NAME (factory->typefindfunc)); GST_DEBUG_FUNCPTR_NAME (factory->typefindfunc));
num_types++; num_types++;
} }
else if (GST_IS_SCHEDULER_FACTORY (feature)) { else if (GST_IS_SCHEDULER_FACTORY (feature)) {
@ -938,8 +940,8 @@ print_plugin_info (GstPlugin *plugin)
num_schedulers++; num_schedulers++;
} }
else { else {
g_print (" %s (%s)\n", gst_object_get_name (GST_OBJECT (feature)), g_print (" %s (%s)\n", gst_object_get_name (GST_OBJECT (feature)),
g_type_name (G_OBJECT_TYPE (feature))); g_type_name (G_OBJECT_TYPE (feature)));
num_other++; num_other++;
} }
num_features++; num_features++;
@ -958,28 +960,27 @@ print_plugin_info (GstPlugin *plugin)
g_print (" +-- %d indexes\n", num_indexes); g_print (" +-- %d indexes\n", num_indexes);
if (num_other > 0) if (num_other > 0)
g_print (" +-- %d other objects\n", num_other); g_print (" +-- %d other objects\n", num_other);
g_print ("\n"); g_print ("\n");
} }
int
int main (int argc, char *argv[])
main (int argc, char *argv[])
{ {
GstElementFactory *factory; GstElementFactory *factory;
GstPlugin *plugin; GstPlugin *plugin;
gchar *so; gchar *so;
struct poptOption options[] = { struct poptOption options[] = {
{"gst-inspect-plugin", 'p', POPT_ARG_STRING|POPT_ARGFLAG_STRIP, NULL, 0, {"gst-inspect-plugin", 'p', POPT_ARG_STRING|POPT_ARGFLAG_STRIP, NULL, 0,
"Show plugin details", NULL}, "Show plugin details", NULL},
{"gst-inspect-scheduler", 's', POPT_ARG_STRING|POPT_ARGFLAG_STRIP, NULL, 0, {"gst-inspect-scheduler", 's', POPT_ARG_STRING|POPT_ARGFLAG_STRIP, NULL, 0,
"Show scheduler details", NULL}, "Show scheduler details", NULL},
POPT_TABLEEND POPT_TABLEEND
}; };
gst_init_with_popt_table (&argc, &argv, options); gst_init_with_popt_table (&argc, &argv, options);
gst_control_init (&argc, &argv); gst_control_init (&argc, &argv);
/* if no arguments, print out list of elements */ /* if no arguments, print out list of elements */
if (argc == 1) { if (argc == 1) {
print_element_list(); print_element_list();
@ -991,7 +992,7 @@ main (int argc, char *argv[])
g_print ("Usage: %s\t\t\tList all registered elements\n",argv[0]); g_print ("Usage: %s\t\t\tList all registered elements\n",argv[0]);
g_print (" %s element-name\tShow element details\n",argv[0]); g_print (" %s element-name\tShow element details\n",argv[0]);
g_print (" %s plugin-name[.so]\tShow information about plugin\n", g_print (" %s plugin-name[.so]\tShow information about plugin\n",
argv[0]); argv[0]);
return 0; return 0;
} }
@ -1003,39 +1004,44 @@ main (int argc, char *argv[])
if (factory) if (factory)
return print_element_info (factory); return print_element_info (factory);
else { else {
GstPluginFeature* feature; GstPluginFeature* feature;
/* FIXME implement other pretty print function for these */ /* FIXME implement other pretty print function for these */
feature = gst_registry_pool_find_feature (argv[1], GST_TYPE_SCHEDULER_FACTORY); feature = gst_registry_pool_find_feature (argv[1],
if (feature) { GST_TYPE_SCHEDULER_FACTORY);
if (feature) {
g_print ("%s: a scheduler\n", argv[1]); g_print ("%s: a scheduler\n", argv[1]);
return 0; return 0;
} }
#ifndef GST_DISABLE_INDEX #ifndef GST_DISABLE_INDEX
feature = gst_registry_pool_find_feature (argv[1], GST_TYPE_INDEX_FACTORY); feature = gst_registry_pool_find_feature (argv[1],
if (feature) { GST_TYPE_INDEX_FACTORY);
if (feature) {
g_print ("%s: an index\n", argv[1]); g_print ("%s: an index\n", argv[1]);
return 0; return 0;
} }
#endif #endif
#ifndef GST_DISABLE_AUTOPLUG #ifndef GST_DISABLE_AUTOPLUG
feature = gst_registry_pool_find_feature (argv[1], GST_TYPE_AUTOPLUG_FACTORY); feature = gst_registry_pool_find_feature (argv[1],
if (feature) { GST_TYPE_AUTOPLUG_FACTORY);
if (feature) {
g_print ("%s: an autoplugger\n", argv[1]); g_print ("%s: an autoplugger\n", argv[1]);
return 0; return 0;
} }
#endif #endif
feature = gst_registry_pool_find_feature (argv[1], GST_TYPE_TYPE_FACTORY); feature = gst_registry_pool_find_feature (argv[1],
if (feature) { GST_TYPE_TYPE_FACTORY);
if (feature) {
g_print ("%s: an type\n", argv[1]); g_print ("%s: an type\n", argv[1]);
return 0; return 0;
} }
#ifndef GST_DISABLE_URI #ifndef GST_DISABLE_URI
feature = gst_registry_pool_find_feature (argv[1], GST_TYPE_URI_HANDLER); feature = gst_registry_pool_find_feature (argv[1],
if (feature) { GST_TYPE_URI_HANDLER);
if (feature) {
g_print ("%s: an uri handler\n", argv[1]); g_print ("%s: an uri handler\n", argv[1]);
return 0; return 0;
} }
#endif #endif
} }
} else { } else {

File diff suppressed because it is too large Load diff