the parent type
Appends structure
with features
to caps
. The structure is not copied; caps
becomes the owner of structure
.
the #GstStructure to append
the #GstCapsFeatures to append
Creates a new #GstCaps as a copy of the old caps
. The new caps will have a
refcount of 1, owned by the caller. The structures are copied as well.
Note that this function is the semantic equivalent of a gst_caps_ref() followed by a gst_caps_make_writable(). If you only want to hold on to a reference to the data, you should use gst_caps_ref().
Calls the provided function once for each structure and caps feature in the #GstCaps. In contrast to gst_caps_foreach(), the function may modify the structure and features. In contrast to gst_caps_filter_and_map_in_place(), the structure and features are removed from the caps if %FALSE is returned from the function. The caps must be mutable.
a function to call for each field
Modifies the given caps
into a representation with only fixed
values. First the caps will be truncated and then the first structure will be
fixated with gst_structure_fixate().
This function takes ownership of caps
and will call gst_caps_make_writable()
on it so you must not use caps
afterwards unless you keep an additional
reference to it with gst_caps_ref().
Note that it is not guaranteed that the returned caps have exactly one
structure. If caps
are empty caps then the returned caps will be
the empty too and contain no structure at all.
Calling this function with ANY caps is not allowed.
Calls the provided function once for each structure and caps feature in the #GstCaps. The function must not modify the fields. Also see gst_caps_map_in_place() and gst_caps_filter_and_map_in_place().
a function to call for each field
Finds the features in caps
at index,
and returns it.
WARNING: This function takes a const GstCaps *
, but returns a
non-const GstCapsFeatures *
. This is for programming convenience --
the caller should be aware that features inside a constant
#GstCaps should not be modified. However, if you know the caps
are writable, either because you have just copied them or made
them writable with gst_caps_make_writable(), you may modify the
features returned in the usual way, e.g. with functions like
gst_caps_features_add().
the index of the structure
Gets the number of structures contained in caps
.
Finds the structure in caps
at index,
and returns it.
WARNING: This function takes a const GstCaps *
, but returns a
non-const GstStructure *
. This is for programming convenience --
the caller should be aware that structures inside a constant
#GstCaps should not be modified. However, if you know the caps
are writable, either because you have just copied them or made
them writable with gst_caps_make_writable(), you may modify the
structure returned in the usual way, e.g. with functions like
gst_structure_set().
the index of the structure
Creates a new #GstCaps that contains all the formats that are common
to both caps1
and caps2
, the order is defined by the #GstCapsIntersectMode
used.
a #GstCaps to intersect
The intersection algorithm/mode to use
Determines if caps
represents any media format.
Determines if caps
represents no media formats.
Fixed #GstCaps describe exactly one format, that is, they have exactly one structure, and each field in the structure describes a fixed type. Examples of non-fixed types are GST_TYPE_INT_RANGE and GST_TYPE_LIST.
Checks if structure
is a subset of caps
. See gst_caps_is_subset()
for more information.
a potential #GstStructure subset of caps
a #GstCapsFeatures for structure
Calls the provided function once for each structure and caps feature in the #GstCaps. In contrast to gst_caps_foreach(), the function may modify but not delete the structures and features. The caps must be mutable.
a function to call for each field
Appends structure
with features
to caps
if its not already expressed by caps
.
the #GstStructure to merge
the #GstCapsFeatures to merge
Returns a #GstCaps that represents the same set of formats as
caps,
but contains no lists. Each list is expanded into separate
#GstStructure.
This function takes ownership of caps
and will call gst_caps_make_writable()
on it so you must not use caps
afterwards unless you keep an additional
reference to it with gst_caps_ref().
Removes the structure with the given index from the list of structures
contained in caps
.
Index of the structure to remove
Converts caps
to a string representation. This string representation can be
converted back to a #GstCaps by gst_caps_from_string().
This prints the caps in human readable form.
This version of the caps serialization function introduces support for nested
structures and caps but the resulting strings won't be parsable with
GStreamer prior to 1.20 unless #GST_SERIALIZE_FLAG_BACKWARD_COMPAT is passed
as flag
.
a #GstSerializeFlags
Sets the features
for the structure at index
.
the index of the structure
the #GstCapsFeatures to set
Sets the features
for all the structures of caps
.
the #GstCapsFeatures to set
Sets the given field
on all structures of caps
to the given value
.
This is a convenience function for calling gst_structure_set_value() on
all structures of caps
.
name of the field to set
value to set the field to
Converts the given caps
into a representation that represents the
same set of formats, but in a simpler form. Component structures that are
identical are merged. Component structures that have values that can be
merged are also merged.
This function takes ownership of caps
and will call gst_caps_make_writable()
on it if necessary, so you must not use caps
afterwards unless you keep an
additional reference to it with gst_caps_ref().
This method does not preserve the original order of caps
.
Converts caps
to a string representation. This string representation
can be converted back to a #GstCaps by gst_caps_from_string().
For debugging purposes its easier to do something like this:
GST_LOG ("caps are %" GST_PTR_FORMAT, caps);
This prints the caps in human readable form.
The implementation of serialization up to 1.20 would lead to unexpected results when there were nested #GstCaps / #GstStructure deeper than one level.
Discards all but the first structure from caps
. Useful when
fixating.
This function takes ownership of caps
and will call gst_caps_make_writable()
on it if necessary, so you must not use caps
afterwards unless you keep an
additional reference to it with gst_caps_ref().
Note that it is not guaranteed that the returned caps have exactly one
structure. If caps
is any or empty caps then the returned caps will be
the same and contain no structure at all.
Caps (capabilities) are lightweight refcounted objects describing media types. They are composed of an array of #GstStructure.
Caps are exposed on #GstPadTemplate to describe all possible types a given pad can handle. They are also stored in the #GstRegistry along with a description of the #GstElement.
Caps are exposed on the element pads using the gst_pad_query_caps() pad function. This function describes the possible types that the pad can handle or produce at runtime.
A #GstCaps can be constructed with the following code fragment:
A #GstCaps is fixed when it has no fields with ranges or lists. Use gst_caps_is_fixed() to test for fixed caps. Fixed caps can be used in a caps event to notify downstream elements of the current media type.
Various methods exist to work with the media types such as subtracting or intersecting.
Be aware that until 1.20 the #GstCaps / #GstStructure serialization into string had limited support for nested #GstCaps / #GstStructure fields. It could only support one level of nesting. Using more levels would lead to unexpected behavior when using serialization features, such as gst_caps_to_string() or gst_value_serialize() and their counterparts.