1 <!-- ##### SECTION Title ##### -->
4 <!-- ##### SECTION Short_Description ##### -->
7 <!-- ##### SECTION Long_Description ##### -->
9 GstCaps is used to attach capabilities to a pad. Capabilities are made of
10 a mime-type and a set of properties. GstCaps can be named and chained into
11 a list, which is then a GstCaps on its own.
14 GstCaps are created with gst_caps_new(), which takes a name, a mime type and
15 a pointer to a #GstProps. A convenience macro with a cleaner syntax is
16 available to create a caps with GST_CAPS_NEW(). The following example shows how
22 "my_caps", /* capability name */
23 "audio/raw", /* mime type */
24 gst_props_new ( /* properties */
25 "format", GST_PROPS_STRING ("float"),
26 "layout", GST_PROPS_INT (5),
30 The following code example is equivalent to the above example:
35 "my_caps", /* capability name */
36 "audio/raw", /* mime type */
37 "format", GST_PROPS_STRING ("float"),
38 "channels", GST_PROPS_INT (5)
43 GstCaps are refcounted with gst_caps_ref() and gst_caps_unref().
46 GstCaps can be chained with the gst_caps_append(), gst_caps_prepend() and
47 gst_caps_chain() functions. Use gst_caps_get_by_name() to get a named caps
48 structure from a chained list.
51 To get the properties of a caps structure the functions
52 gst_caps_get_boolean(), gst_caps_get_fourcc_int(), gst_caps_get_int(),
53 gst_caps_get_string(), which all take a property name as an argument.
56 The properties of the caps structure can be modified with gst_caps_set, which
57 takes a list of key value pairs in the #GstProps syntax as shown by this example:
63 gst_caps_set (caps, "format", GST_PROPS_STRING ("int"), NULL);
64 gst_caps_set (caps, "channels", GST_PROPS_INT (20), NULL);
69 before modifying a GstCaps, it is a good idea to make a copy if it first with
70 gst_caps_copy_on_write(). This will copy the GstCaps if the refcount is >1.
73 <!-- ##### SECTION See_Also ##### -->
78 <!-- ##### MACRO GST_CAPS_LOCK ##### -->
80 Lock the caps structure
83 @caps: The caps structure to lock
86 <!-- ##### MACRO GST_CAPS_TRYLOCK ##### -->
88 Try to lock the caps structure
91 @caps: The caps structure to try to lock
94 <!-- ##### MACRO GST_CAPS_UNLOCK ##### -->
96 Unlock the caps structure
99 @caps: The caps structure to unlock
102 <!-- ##### MACRO GST_CAPS_NEW ##### -->
104 A convenience macro to create a new GstCaps structure.
107 @name: the name of the caps structure
108 @type: the mime type of the caps structure
109 @a...: the properties of this caps stucture.
112 <!-- ##### MACRO GST_CAPS_FACTORY ##### -->
114 A convenience macro to create a GstCaps factory.
117 @factoryname: the name of the factory
118 @a...: the caps to create with this factory, usualy specified
122 <!-- ##### MACRO GST_CAPS_GET ##### -->
124 A convenience macro to get a GstCaps from the given capsfactory.
127 @fact: the factory to use.
130 <!-- ##### STRUCT GstCaps ##### -->
135 @name: the name of the capability, for the application
136 @id: the typeid of the capability
137 @refcount: a refcounter for this caps structure
138 @lock: the lock for this caps structure
139 @properties: the properties of the capability
140 @next: a pointer to the next caps.
142 <!-- ##### FUNCTION gst_caps_new ##### -->
153 <!-- ##### FUNCTION gst_caps_destroy ##### -->
161 <!-- ##### FUNCTION gst_caps_ref ##### -->
170 <!-- ##### FUNCTION gst_caps_unref ##### -->
179 <!-- ##### FUNCTION gst_caps_copy ##### -->
188 <!-- ##### FUNCTION gst_caps_copy_on_write ##### -->
197 <!-- ##### FUNCTION gst_caps_chain ##### -->
207 <!-- ##### FUNCTION gst_caps_append ##### -->
217 <!-- ##### FUNCTION gst_caps_prepend ##### -->
227 <!-- ##### FUNCTION gst_caps_set_name ##### -->
236 <!-- ##### FUNCTION gst_caps_get_name ##### -->
245 <!-- ##### FUNCTION gst_caps_set_type_id ##### -->
252 <!-- # Unused Parameters # -->
257 <!-- ##### FUNCTION gst_caps_get_type_id ##### -->
266 <!-- ##### FUNCTION gst_caps_set_mime ##### -->
275 <!-- ##### FUNCTION gst_caps_get_mime ##### -->
284 <!-- ##### FUNCTION gst_caps_set_props ##### -->
294 <!-- ##### FUNCTION gst_caps_get_props ##### -->
303 <!-- ##### FUNCTION gst_caps_check_compatibility ##### -->
313 <!-- ##### MACRO gst_caps_set ##### -->
315 Set a property of a caps structure.
318 @caps: the caps structure to modify
319 @name: the name of the property to change
320 @args...: the new value of the property
323 <!-- ##### MACRO gst_caps_get_boolean ##### -->
325 Get the value of the named property as a boolean.
328 @caps: the caps to query
329 @name: the name of the property to get
332 <!-- ##### FUNCTION gst_caps_get_by_name ##### -->
342 <!-- ##### MACRO gst_caps_get_fourcc_int ##### -->
344 Get the value of the named property as a fourcc.
347 @caps: the caps to query
348 @name: the name of the property to get
351 <!-- ##### MACRO gst_caps_get_int ##### -->
353 Get the value of the named property as an int.
356 @caps: the caps to query
357 @name: the name of the property to get
360 <!-- ##### MACRO gst_caps_get_string ##### -->
362 Get the value of the named property as a string.
365 @caps: the caps to query
366 @name: the name of the property to get
369 <!-- ##### MACRO gst_caps_get_float ##### -->
371 Get the value of the named property as a float.
374 @caps: the caps to query
375 @name: the name of the property to get
378 <!-- ##### FUNCTION gst_caps_save_thyself ##### -->
388 <!-- ##### FUNCTION gst_caps_load_thyself ##### -->