2000-12-30 16:13:17 +00:00
|
|
|
<!-- ##### SECTION Title ##### -->
|
|
|
|
GstCaps
|
|
|
|
|
|
|
|
<!-- ##### SECTION Short_Description ##### -->
|
|
|
|
Capabilities of pads
|
|
|
|
|
|
|
|
<!-- ##### SECTION Long_Description ##### -->
|
|
|
|
<para>
|
|
|
|
GstCaps is used to attach capabilities to a pad. Capabilities are made of
|
2001-04-19 22:25:04 +00:00
|
|
|
a mime-type and a set of properties. GstCaps can be named and chained into
|
|
|
|
a list, which is then a GstCaps on its own.
|
|
|
|
</para>
|
|
|
|
<para>
|
|
|
|
GstCaps are created with gst_caps_new(), which takes a name, a mime type and
|
|
|
|
a pointer to a #GstProps. A convenience macro with a cleaner syntax is
|
|
|
|
available to create a caps with GST_CAPS_NEW(). The following example shows how
|
|
|
|
to create a GstCaps.
|
|
|
|
<programlisting>
|
|
|
|
GstCaps *caps;
|
|
|
|
|
|
|
|
caps = gst_caps_new (
|
|
|
|
"my_caps", /* capability name */
|
|
|
|
"audio/raw", /* mime type */
|
|
|
|
gst_props_new ( /* properties */
|
|
|
|
"format", GST_PROPS_STRING ("float"),
|
|
|
|
"layout", GST_PROPS_INT (5),
|
|
|
|
NULL));
|
|
|
|
</programlisting>
|
|
|
|
|
|
|
|
The following code example is equivalent to the above example:
|
|
|
|
<programlisting>
|
|
|
|
GstCaps *caps;
|
|
|
|
|
|
|
|
caps = GST_CAPS_NEW (
|
|
|
|
"my_caps", /* capability name */
|
|
|
|
"audio/raw", /* mime type */
|
|
|
|
"format", GST_PROPS_STRING ("float"),
|
|
|
|
"channels", GST_PROPS_INT (5)
|
|
|
|
);
|
|
|
|
</programlisting>
|
|
|
|
</para>
|
|
|
|
<para>
|
|
|
|
GstCaps are refcounted with gst_caps_ref() and gst_caps_unref().
|
|
|
|
</para>
|
|
|
|
<para>
|
|
|
|
GstCaps can be chained with the gst_caps_append(), gst_caps_prepend() and
|
|
|
|
gst_caps_chain() functions. Use gst_caps_get_by_name() to get a named caps
|
|
|
|
structure from a chained list.
|
|
|
|
</para>
|
|
|
|
<para>
|
|
|
|
To get the properties of a caps structure the functions
|
|
|
|
gst_caps_get_boolean(), gst_caps_get_fourcc_int(), gst_caps_get_int(),
|
|
|
|
gst_caps_get_string(), which all take a property name as an argument.
|
|
|
|
</para>
|
|
|
|
<para>
|
|
|
|
The properties of the caps structure can be modified with gst_caps_set, which
|
|
|
|
takes a list of key value pairs in the #GstProps syntax as shown by this example:
|
|
|
|
|
|
|
|
<programlisting>
|
|
|
|
GstCaps *caps;
|
|
|
|
....
|
|
|
|
|
|
|
|
gst_caps_set (caps, "format", GST_PROPS_STRING ("int"), NULL);
|
|
|
|
gst_caps_set (caps, "channels", GST_PROPS_INT (20), NULL);
|
|
|
|
|
|
|
|
</programlisting>
|
|
|
|
</para>
|
|
|
|
<para>
|
|
|
|
before modifying a GstCaps, it is a good idea to make a copy if it first with
|
|
|
|
gst_caps_copy_on_write(). This will copy thr GstCaps if the refcount is >1.
|
2000-12-30 16:13:17 +00:00
|
|
|
</para>
|
|
|
|
|
|
|
|
<!-- ##### SECTION See_Also ##### -->
|
|
|
|
<para>
|
2001-04-18 20:16:53 +00:00
|
|
|
#GstProps, #GstPad
|
2000-12-30 16:13:17 +00:00
|
|
|
</para>
|
|
|
|
|
2001-03-27 17:34:39 +00:00
|
|
|
<!-- ##### MACRO GST_CAPS_LOCK ##### -->
|
|
|
|
<para>
|
|
|
|
Lock the caps structure
|
|
|
|
</para>
|
|
|
|
|
|
|
|
@caps: The caps structure to lock
|
|
|
|
|
|
|
|
|
|
|
|
<!-- ##### MACRO GST_CAPS_TRYLOCK ##### -->
|
|
|
|
<para>
|
|
|
|
Try to lock the caps structure
|
|
|
|
</para>
|
|
|
|
|
|
|
|
@caps: The caps structure to try to lock
|
|
|
|
|
|
|
|
|
|
|
|
<!-- ##### MACRO GST_CAPS_UNLOCK ##### -->
|
|
|
|
<para>
|
|
|
|
Unlock the caps structure
|
|
|
|
</para>
|
|
|
|
|
|
|
|
@caps: The caps structure to unlock
|
|
|
|
|
|
|
|
|
2001-04-17 21:14:55 +00:00
|
|
|
<!-- ##### MACRO GST_CAPS_NEW ##### -->
|
|
|
|
<para>
|
|
|
|
A convenience macro to create a new GstCaps structure.
|
|
|
|
</para>
|
|
|
|
|
|
|
|
@name: the name of the caps structure
|
|
|
|
@type: the mime type of the caps structure
|
|
|
|
@a...: the properties of this caps stucture.
|
|
|
|
|
|
|
|
|
|
|
|
<!-- ##### MACRO GST_CAPS_FACTORY ##### -->
|
|
|
|
<para>
|
|
|
|
A convenience macro to create a GstCaps factory.
|
|
|
|
</para>
|
|
|
|
|
|
|
|
@factoryname: the name of the factory
|
|
|
|
@a...: the caps to create with this factory, usualy specified
|
|
|
|
with GST_CAPS_NEW()
|
|
|
|
|
|
|
|
|
|
|
|
<!-- ##### MACRO GST_CAPS_GET ##### -->
|
|
|
|
<para>
|
|
|
|
A convenience macro to get a GstCaps from the given capsfactory.
|
|
|
|
</para>
|
|
|
|
|
|
|
|
@fact: the factory to use.
|
|
|
|
|
|
|
|
|
2000-12-30 16:13:17 +00:00
|
|
|
<!-- ##### STRUCT GstCaps ##### -->
|
|
|
|
<para>
|
|
|
|
|
|
|
|
</para>
|
|
|
|
|
2001-01-06 22:05:15 +00:00
|
|
|
@name: the name of the capability, for the application
|
2000-12-30 16:13:17 +00:00
|
|
|
@id: the typeid of the capability
|
2001-03-27 17:34:39 +00:00
|
|
|
@refcount: a refcounter for this caps structure
|
|
|
|
@lock: the lock for this caps structure
|
2000-12-30 16:13:17 +00:00
|
|
|
@properties: the properties of the capability
|
2001-03-27 17:34:39 +00:00
|
|
|
@next: a pointer to the next caps.
|
2001-03-21 21:43:56 +00:00
|
|
|
|
2000-12-30 16:13:17 +00:00
|
|
|
<!-- ##### FUNCTION gst_caps_new ##### -->
|
|
|
|
<para>
|
|
|
|
|
|
|
|
</para>
|
|
|
|
|
2000-12-31 17:02:47 +00:00
|
|
|
@name:
|
2000-12-30 16:13:17 +00:00
|
|
|
@mime:
|
|
|
|
@props:
|
|
|
|
@Returns:
|
|
|
|
|
|
|
|
|
2001-03-21 21:43:56 +00:00
|
|
|
<!-- ##### FUNCTION gst_caps_destroy ##### -->
|
|
|
|
<para>
|
|
|
|
|
|
|
|
</para>
|
|
|
|
|
|
|
|
@caps:
|
|
|
|
|
|
|
|
|
|
|
|
<!-- ##### FUNCTION gst_caps_ref ##### -->
|
|
|
|
<para>
|
|
|
|
|
|
|
|
</para>
|
|
|
|
|
|
|
|
@caps:
|
2001-04-17 21:14:55 +00:00
|
|
|
@Returns:
|
2001-03-21 21:43:56 +00:00
|
|
|
|
|
|
|
|
|
|
|
<!-- ##### FUNCTION gst_caps_unref ##### -->
|
|
|
|
<para>
|
|
|
|
|
|
|
|
</para>
|
|
|
|
|
|
|
|
@caps:
|
2001-04-17 21:14:55 +00:00
|
|
|
@Returns:
|
2001-03-21 21:43:56 +00:00
|
|
|
|
|
|
|
|
|
|
|
<!-- ##### FUNCTION gst_caps_copy ##### -->
|
2001-01-06 02:35:17 +00:00
|
|
|
<para>
|
|
|
|
|
|
|
|
</para>
|
|
|
|
|
|
|
|
@caps:
|
|
|
|
@Returns:
|
|
|
|
|
|
|
|
|
2001-03-21 21:43:56 +00:00
|
|
|
<!-- ##### FUNCTION gst_caps_copy_on_write ##### -->
|
2001-01-06 02:35:17 +00:00
|
|
|
<para>
|
|
|
|
|
|
|
|
</para>
|
|
|
|
|
|
|
|
@caps:
|
2001-03-21 21:43:56 +00:00
|
|
|
@Returns:
|
|
|
|
|
|
|
|
|
2001-04-17 21:14:55 +00:00
|
|
|
<!-- ##### FUNCTION gst_caps_chain ##### -->
|
|
|
|
<para>
|
|
|
|
|
|
|
|
</para>
|
|
|
|
|
|
|
|
@caps:
|
|
|
|
@Varargs:
|
|
|
|
@Returns:
|
|
|
|
|
|
|
|
|
2001-03-21 21:43:56 +00:00
|
|
|
<!-- ##### FUNCTION gst_caps_append ##### -->
|
|
|
|
<para>
|
|
|
|
|
|
|
|
</para>
|
|
|
|
|
|
|
|
@caps:
|
|
|
|
@capstoadd:
|
|
|
|
@Returns:
|
|
|
|
|
|
|
|
|
|
|
|
<!-- ##### FUNCTION gst_caps_prepend ##### -->
|
|
|
|
<para>
|
|
|
|
|
|
|
|
</para>
|
|
|
|
|
|
|
|
@caps:
|
|
|
|
@capstoadd:
|
|
|
|
@Returns:
|
|
|
|
|
|
|
|
|
|
|
|
<!-- ##### FUNCTION gst_caps_set_name ##### -->
|
|
|
|
<para>
|
|
|
|
|
|
|
|
</para>
|
|
|
|
|
|
|
|
@caps:
|
|
|
|
@name:
|
|
|
|
|
|
|
|
|
|
|
|
<!-- ##### FUNCTION gst_caps_get_name ##### -->
|
|
|
|
<para>
|
|
|
|
|
|
|
|
</para>
|
|
|
|
|
|
|
|
@caps:
|
|
|
|
@Returns:
|
2001-01-06 02:35:17 +00:00
|
|
|
|
|
|
|
|
|
|
|
<!-- ##### FUNCTION gst_caps_set_type_id ##### -->
|
|
|
|
<para>
|
|
|
|
|
|
|
|
</para>
|
|
|
|
|
|
|
|
@caps:
|
2001-03-21 21:43:56 +00:00
|
|
|
@type_id:
|
2001-02-27 00:05:15 +00:00
|
|
|
<!-- # Unused Parameters # -->
|
2001-03-21 21:43:56 +00:00
|
|
|
@Param2:
|
2001-01-06 02:35:17 +00:00
|
|
|
@typeid:
|
|
|
|
|
|
|
|
|
|
|
|
<!-- ##### FUNCTION gst_caps_get_type_id ##### -->
|
|
|
|
<para>
|
|
|
|
|
|
|
|
</para>
|
|
|
|
|
|
|
|
@caps:
|
|
|
|
@Returns:
|
|
|
|
|
|
|
|
|
2001-03-21 21:43:56 +00:00
|
|
|
<!-- ##### FUNCTION gst_caps_set_mime ##### -->
|
2001-01-06 02:35:17 +00:00
|
|
|
<para>
|
|
|
|
|
|
|
|
</para>
|
|
|
|
|
|
|
|
@caps:
|
2001-03-21 21:43:56 +00:00
|
|
|
@mime:
|
2001-01-06 02:35:17 +00:00
|
|
|
|
|
|
|
|
2001-03-21 21:43:56 +00:00
|
|
|
<!-- ##### FUNCTION gst_caps_get_mime ##### -->
|
2001-01-06 02:35:17 +00:00
|
|
|
<para>
|
|
|
|
|
|
|
|
</para>
|
|
|
|
|
|
|
|
@caps:
|
2001-03-21 21:43:56 +00:00
|
|
|
@Returns:
|
2001-01-06 02:35:17 +00:00
|
|
|
|
|
|
|
|
2000-12-30 16:13:17 +00:00
|
|
|
<!-- ##### FUNCTION gst_caps_set_props ##### -->
|
|
|
|
<para>
|
|
|
|
|
|
|
|
</para>
|
|
|
|
|
|
|
|
@caps:
|
|
|
|
@props:
|
|
|
|
@Returns:
|
|
|
|
|
|
|
|
|
|
|
|
<!-- ##### FUNCTION gst_caps_get_props ##### -->
|
|
|
|
<para>
|
|
|
|
|
|
|
|
</para>
|
|
|
|
|
|
|
|
@caps:
|
|
|
|
@Returns:
|
|
|
|
|
|
|
|
|
|
|
|
<!-- ##### FUNCTION gst_caps_check_compatibility ##### -->
|
|
|
|
<para>
|
|
|
|
|
|
|
|
</para>
|
|
|
|
|
|
|
|
@fromcaps:
|
|
|
|
@tocaps:
|
|
|
|
@Returns:
|
|
|
|
|
|
|
|
|
2001-03-21 21:43:56 +00:00
|
|
|
<!-- ##### MACRO gst_caps_set ##### -->
|
2000-12-31 17:02:47 +00:00
|
|
|
<para>
|
2001-04-17 21:14:55 +00:00
|
|
|
Set a property of a caps structure.
|
2000-12-31 17:02:47 +00:00
|
|
|
</para>
|
|
|
|
|
2001-04-17 21:14:55 +00:00
|
|
|
@caps: the caps structure to modify
|
|
|
|
@name: the name of the property to change
|
|
|
|
@args...: the new value of the property
|
2001-03-21 21:43:56 +00:00
|
|
|
|
|
|
|
|
|
|
|
<!-- ##### MACRO gst_caps_get_boolean ##### -->
|
|
|
|
<para>
|
2001-04-17 21:14:55 +00:00
|
|
|
Get the value of the named property as a boolean.
|
2001-03-21 21:43:56 +00:00
|
|
|
</para>
|
|
|
|
|
2001-04-17 21:14:55 +00:00
|
|
|
@caps: the caps to query
|
|
|
|
@name: the name of the property to get
|
2001-03-21 21:43:56 +00:00
|
|
|
|
|
|
|
|
|
|
|
<!-- ##### FUNCTION gst_caps_get_by_name ##### -->
|
|
|
|
<para>
|
|
|
|
|
|
|
|
</para>
|
|
|
|
|
|
|
|
@caps:
|
|
|
|
@name:
|
2000-12-31 17:02:47 +00:00
|
|
|
@Returns:
|
|
|
|
|
|
|
|
|
2001-03-21 21:43:56 +00:00
|
|
|
<!-- ##### MACRO gst_caps_get_fourcc_int ##### -->
|
|
|
|
<para>
|
2001-04-17 21:14:55 +00:00
|
|
|
Get the value of the named property as a fourcc.
|
2001-03-21 21:43:56 +00:00
|
|
|
</para>
|
|
|
|
|
2001-04-17 21:14:55 +00:00
|
|
|
@caps: the caps to query
|
|
|
|
@name: the name of the property to get
|
2001-03-21 21:43:56 +00:00
|
|
|
|
|
|
|
|
|
|
|
<!-- ##### MACRO gst_caps_get_int ##### -->
|
|
|
|
<para>
|
2001-04-17 21:14:55 +00:00
|
|
|
Get the value of the named property as an int.
|
2001-03-21 21:43:56 +00:00
|
|
|
</para>
|
|
|
|
|
2001-04-17 21:14:55 +00:00
|
|
|
@caps: the caps to query
|
|
|
|
@name: the name of the property to get
|
2001-03-21 21:43:56 +00:00
|
|
|
|
|
|
|
|
2001-04-10 19:46:23 +00:00
|
|
|
<!-- ##### MACRO gst_caps_get_string ##### -->
|
|
|
|
<para>
|
2001-04-17 21:14:55 +00:00
|
|
|
Get the value of the named property as a string.
|
2001-04-10 19:46:23 +00:00
|
|
|
</para>
|
|
|
|
|
2001-04-17 21:14:55 +00:00
|
|
|
@caps: the caps to query
|
|
|
|
@name: the name of the property to get
|
2001-04-10 19:46:23 +00:00
|
|
|
|
|
|
|
|
2001-05-03 20:06:18 +00:00
|
|
|
<!-- ##### MACRO gst_caps_get_float ##### -->
|
|
|
|
<para>
|
|
|
|
Get the value of the named property as a float.
|
|
|
|
</para>
|
|
|
|
|
|
|
|
@caps: the caps to query
|
|
|
|
@name: the name of the property to get
|
|
|
|
|
|
|
|
|
2000-12-30 16:13:17 +00:00
|
|
|
<!-- ##### FUNCTION gst_caps_save_thyself ##### -->
|
|
|
|
<para>
|
|
|
|
|
|
|
|
</para>
|
|
|
|
|
|
|
|
@caps:
|
|
|
|
@parent:
|
|
|
|
@Returns:
|
|
|
|
|
|
|
|
|
|
|
|
<!-- ##### FUNCTION gst_caps_load_thyself ##### -->
|
|
|
|
<para>
|
|
|
|
|
|
|
|
</para>
|
|
|
|
|
|
|
|
@parent:
|
|
|
|
@Returns:
|
|
|
|
|
|
|
|
|