Implement gst_caps_has_property*() as functions instead of macro's - this prevents failed assertions when calling the...

Original commit message from CVS:
Implement gst_caps_has_property*() as functions instead of macro's - this prevents failed assertions when calling them in some specific cases. See #115886
This commit is contained in:
Ronald S. Bultje 2003-07-29 12:00:38 +00:00
parent 7b38bc69a3
commit 3770896368
3 changed files with 64 additions and 4 deletions

2
common

@ -1 +1 @@
Subproject commit 87e71f9961881079d1d146dcbd08136e3e54d680
Subproject commit 8b323f41bfaccb8f30bddfc6ff8bd6a4be04a3e1

View file

@ -660,6 +660,66 @@ gst_caps_get_props (GstCaps *caps)
return caps->properties;
}
/**
* gst_caps_has_property:
* @caps: the caps to query
* @name: the name of the property to search for
*
* Figure out whether this caps contains the requested property.
*
* Returns: true if the caps contains the property.
*/
gboolean
gst_caps_has_property (GstCaps *caps, const gchar *name)
{
GstProps *props = gst_caps_get_props (caps);
return (props != NULL &&
gst_props_has_property (props, name));
}
/**
* gst_caps_has_property_typed:
* @caps: the caps to query
* @name: the name of the property to search for
* @type: the type of the property to search for
*
* Figure out whether this caps contains the requested property,
* and whether this property is of the requested type.
*
* Returns: true if the caps contains the typed property.
*/
gboolean
gst_caps_has_property_typed (GstCaps *caps, const gchar *name, GstPropsType type)
{
GstProps *props = gst_caps_get_props (caps);
return (props != NULL &&
gst_props_has_property_typed (props, name, type));
}
/**
* gst_caps_has_fixed_property
* @caps: the caps to query
* @name: the name of the property to search for
*
* Figure out whether this caps contains the requested property,
* and whether this property is fixed.
*
* Returns: true if the caps contains the fixed property.
*/
gboolean
gst_caps_has_fixed_property (GstCaps *caps, const gchar *name)
{
GstProps *props = gst_caps_get_props (caps);
return (props != NULL &&
gst_props_has_fixed_property (props, name));
}
/**
* gst_caps_next:
* @caps: the caps to query

View file

@ -167,9 +167,9 @@ GstProps* gst_caps_get_props (GstCaps *caps);
#define gst_caps_get_boolean(caps,name,res) gst_props_entry_get_boolean(gst_props_get_entry((caps)->properties,name),res)
#define gst_caps_get_string(caps,name,res) gst_props_entry_get_string(gst_props_get_entry((caps)->properties,name),res)
#define gst_caps_has_property(caps, name) gst_props_has_property ((caps)->properties, name)
#define gst_caps_has_property_typed(caps, name, type) gst_props_has_property_typed ((caps)->properties, name, type)
#define gst_caps_has_fixed_property(caps, name) gst_props_has_fixed_property ((caps)->properties, name)
gboolean gst_caps_has_property (GstCaps *caps, const gchar *name);
gboolean gst_caps_has_property_typed (GstCaps *caps, const gchar *name, GstPropsType type);
gboolean gst_caps_has_fixed_property (GstCaps *caps, const gchar *name);
GstCaps* gst_caps_get_by_name (GstCaps *caps, const gchar *name);