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 "channels", 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(), gst_caps_get_float(), 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 If you need a unique instance of a GstCaps you can use the convenient
74 GST_CAPS_FACTORY() macro as shown below.
76 GST_CAPS_FACTORY (my_caps,
80 "format", GST_PROPS_STRING ("float"),
81 "channels", GST_PROPS_INT (5)
86 "format", GST_PROPS_STRING ("int"),
87 "channels", GST_PROPS_INT (5)
94 GstCaps *caps = GST_CAPS_GET (my_caps);
101 If you want to check if a link between source and destination caps
102 is always possible, use gst_caps_is_always_compatible(), which returns
104 If you want to check if a link between source and destination caps
105 might be possible, use gst_caps_intersect(), which returns an intersection
109 <!-- ##### SECTION See_Also ##### -->
114 <!-- ##### MACRO GST_TYPE_CAPS ##### -->
116 The GType of the caps boxed type, for use in GValues.
121 <!-- ##### STRUCT GstCaps ##### -->
123 The gstcaps structure
130 <!-- ##### FUNCTION gst_caps_copy ##### -->
139 <!-- ##### FUNCTION gst_caps_copy_1 ##### -->
148 <!-- ##### FUNCTION gst_caps_append ##### -->
155 <!-- # Unused Parameters # -->
161 <!-- ##### FUNCTION gst_caps_replace ##### -->
168 <!-- # Unused Parameters # -->
172 <!-- ##### FUNCTION gst_caps_is_always_compatible ##### -->
180 <!-- # Unused Parameters # -->
185 <!-- ##### FUNCTION gst_caps_normalize ##### -->
194 <!-- ##### FUNCTION gst_caps_intersect ##### -->
204 <!-- ##### FUNCTION gst_caps_save_thyself ##### -->
214 <!-- ##### FUNCTION gst_caps_load_thyself ##### -->
223 <!-- ##### FUNCTION gst_caps_union ##### -->