# GstCaps

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:

      GstCaps *caps = gst_caps_new_simple ("video/x-raw",
         "format", G_TYPE_STRING, "I420",
         "framerate", GST_TYPE_FRACTION, 25, 1,
         "pixel-aspect-ratio", GST_TYPE_FRACTION, 1, 1,
         "width", G_TYPE_INT, 320,
         "height", G_TYPE_INT, 240,
         NULL);

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.

## GstCaps

Object describing media types.

### Members

`mini_object` (GstMiniObject) –

the parent type

## Gst.Caps

Object describing media types.

### Members

`mini_object` (Gst.MiniObject) –

the parent type

## Gst.Caps

Object describing media types.

### Members

`mini_object` (Gst.MiniObject) –

the parent type

### Constructors

#### gst_caps_new_any

    GstCaps *
    gst_caps_new_any ()

Creates a new GstCaps that indicates that it is compatible with any media format.

Returns ( [transfer: full]) –

the new GstCaps

#### Gst.Caps.prototype.new_any

    function Gst.Caps.prototype.new_any(): {
        // javascript wrapper for 'gst_caps_new_any'
    }

Creates a new Gst.Caps that indicates that it is compatible with any media format.

Returns (Gst.Caps) –

the new Gst.Caps

#### Gst.Caps.new_any

    def Gst.Caps.new_any ():
        #python wrapper for 'gst_caps_new_any'

Creates a new Gst.Caps that indicates that it is compatible with any media format.

Returns (Gst.Caps) –

the new Gst.Caps

#### gst_caps_new_empty

    GstCaps *
    gst_caps_new_empty ()

Creates a new GstCaps that is empty. That is, the returned GstCaps contains no media formats. The GstCaps is guaranteed to be writable.

Returns ( [transfer: full]) –

the new GstCaps

#### Gst.Caps.prototype.new_empty

    function Gst.Caps.prototype.new_empty(): {
        // javascript wrapper for 'gst_caps_new_empty'
    }

Creates a new Gst.Caps that is empty. That is, the returned Gst.Caps contains no media formats. The Gst.Caps is guaranteed to be writable.

Returns (Gst.Caps) –

the new Gst.Caps

#### Gst.Caps.new_empty

    def Gst.Caps.new_empty ():
        #python wrapper for 'gst_caps_new_empty'

Creates a new Gst.Caps that is empty. That is, the returned Gst.Caps contains no media formats. The Gst.Caps is guaranteed to be writable.

Returns (Gst.Caps) –

the new Gst.Caps

#### gst_caps_new_empty_simple

    GstCaps *
    gst_caps_new_empty_simple (const char* media_type)

Creates a new GstCaps that contains one GstStructure with name media_type.

Parameters:

`media_type` –

the media type of the structure

Returns ( [transfer: full]) –

the new GstCaps

#### Gst.Caps.prototype.new_empty_simple

    function Gst.Caps.prototype.new_empty_simple(media_type: String): {
        // javascript wrapper for 'gst_caps_new_empty_simple'
    }

Creates a new Gst.Caps that contains one Gst.Structure with name media_type.

Parameters:

`media_type` (String) –

the media type of the structure

Returns (Gst.Caps) –

the new Gst.Caps

#### Gst.Caps.new_empty_simple

    def Gst.Caps.new_empty_simple (media_type):
        #python wrapper for 'gst_caps_new_empty_simple'

Creates a new Gst.Caps that contains one Gst.Structure with name media_type.

Parameters:

`media_type` (str) –

the media type of the structure

Returns (Gst.Caps) –

the new Gst.Caps

#### gst_caps_new_full

    GstCaps *
    gst_caps_new_full (GstStructure * struct1,
                       ... ...)

Creates a new GstCaps and adds all the structures listed as arguments. The list must be NULL-terminated. The structures are not copied; the returned GstCaps owns the structures.

Parameters:

`struct1` ( [transfer: full]) –

the first structure to add

`...` –

additional structures to add

Returns ( [transfer: full]) –

the new GstCaps

#### gst_caps_new_full_valist

    GstCaps *
    gst_caps_new_full_valist (GstStructure * structure,
                              va_list var_args)

Creates a new GstCaps and adds all the structures listed as arguments. The list must be NULL-terminated. The structures are not copied; the returned GstCaps owns the structures.

Parameters:

`structure` ( [transfer: full]) –

the first structure to add

`var_args` –

additional structures to add

Returns ( [transfer: full]) –

the new GstCaps

#### gst_caps_new_id_str_empty_simple

    GstCaps *
    gst_caps_new_id_str_empty_simple (const GstIdStr * media_type)

Creates a new GstCaps that contains one GstStructure with name media_type.

Parameters:

`media_type` –

the media type of the structure

Returns ( [transfer: full]) –

the new GstCaps

Since : 1.26

#### Gst.Caps.prototype.new_id_str_empty_simple

    function Gst.Caps.prototype.new_id_str_empty_simple(media_type: Gst.IdStr): {
        // javascript wrapper for 'gst_caps_new_id_str_empty_simple'
    }

Creates a new Gst.Caps that contains one Gst.Structure with name media_type.

Parameters:

`media_type` (Gst.IdStr) –

the media type of the structure

Returns (Gst.Caps) –

the new Gst.Caps

Since : 1.26

#### Gst.Caps.new_id_str_empty_simple

    def Gst.Caps.new_id_str_empty_simple (media_type):
        #python wrapper for 'gst_caps_new_id_str_empty_simple'

Creates a new Gst.Caps that contains one Gst.Structure with name media_type.

Parameters:

`media_type` (Gst.IdStr) –

the media type of the structure

Returns (Gst.Caps) –

the new Gst.Caps

Since : 1.26

#### gst_caps_new_id_str_simple

    GstCaps *
    gst_caps_new_id_str_simple (const GstIdStr * media_type,
                                const GstIdStr * fieldname,
                                ... ...)

Creates a new GstCaps that contains one GstStructure. The structure is defined by the arguments, which have the same format as gst_structure_new.

Parameters:

`media_type` –

the media type of the structure

`fieldname` –

first field to set

`...` –

additional arguments

Returns ( [transfer: full]) –

the new GstCaps

Since : 1.26

#### gst_caps_new_simple

    GstCaps *
    gst_caps_new_simple (const char* media_type,
                         const char* fieldname,
                         ... ...)

Creates a new GstCaps that contains one GstStructure. The structure is defined by the arguments, which have the same format as gst_structure_new.

Parameters:

`media_type` –

the media type of the structure

`fieldname` –

first field to set

`...` –

additional arguments

Returns ( [transfer: full]) –

the new GstCaps

#### gst_caps_new_static_str_empty_simple

    GstCaps *
    gst_caps_new_static_str_empty_simple (const char* media_type)

Creates a new GstCaps that contains one GstStructure with name media_type.

media_type needs to be valid for the remaining lifetime of the process, e.g. has to be a static string.

Parameters:

`media_type` –

the media type of the structure

Returns ( [transfer: full]) –

the new GstCaps

Since : 1.26

#### Gst.Caps.prototype.new_static_str_empty_simple

    function Gst.Caps.prototype.new_static_str_empty_simple(media_type: String): {
        // javascript wrapper for 'gst_caps_new_static_str_empty_simple'
    }

Creates a new Gst.Caps that contains one Gst.Structure with name media_type.

media_type needs to be valid for the remaining lifetime of the process, e.g. has to be a static string.

Parameters:

`media_type` (String) –

the media type of the structure

Returns (Gst.Caps) –

the new Gst.Caps

Since : 1.26

#### Gst.Caps.new_static_str_empty_simple

    def Gst.Caps.new_static_str_empty_simple (media_type):
        #python wrapper for 'gst_caps_new_static_str_empty_simple'

Creates a new Gst.Caps that contains one Gst.Structure with name media_type.

media_type needs to be valid for the remaining lifetime of the process, e.g. has to be a static string.

Parameters:

`media_type` (str) –

the media type of the structure

Returns (Gst.Caps) –

the new Gst.Caps

Since : 1.26

#### gst_caps_new_static_str_simple

    GstCaps *
    gst_caps_new_static_str_simple (const char* media_type,
                                    const char* fieldname,
                                    ... ...)

Creates a new GstCaps that contains one GstStructure. The structure is defined by the arguments, which have the same format as gst_structure_new.

media_type, fieldname and all other fieldnames need to be valid for the remaining lifetime of the process, e.g. have to be static strings.

Parameters:

`media_type` –

the media type of the structure

`fieldname` –

first field to set

`...` –

additional arguments

Returns ( [transfer: full]) –

the new GstCaps

Since : 1.26

### Methods

#### gst_caps_append

    gst_caps_append (GstCaps * caps1,
                     GstCaps * caps2)

Appends the structures contained in caps2 to caps1. The structures in caps2 are not copied -- they are transferred to caps1, and then caps2 is freed. If either caps is ANY, the resulting caps will be ANY.

Parameters:

`caps1` –

the GstCaps that will be appended to

`caps2` ( [transfer: full]) –

the GstCaps to append

#### Gst.Caps.prototype.append

    function Gst.Caps.prototype.append(caps2: Gst.Caps): {
        // javascript wrapper for 'gst_caps_append'
    }

Appends the structures contained in caps2 to caps1. The structures in caps2 are not copied -- they are transferred to caps1, and then caps2 is freed. If either caps is ANY, the resulting caps will be ANY.

Parameters:

`caps1` (Gst.Caps) –

the Gst.Caps that will be appended to

`caps2` (Gst.Caps) –

the Gst.Caps to append

#### Gst.Caps.append

    def Gst.Caps.append (self, caps2):
        #python wrapper for 'gst_caps_append'

Appends the structures contained in caps2 to caps1. The structures in caps2 are not copied -- they are transferred to caps1, and then caps2 is freed. If either caps is ANY, the resulting caps will be ANY.

Parameters:

`caps1` (Gst.Caps) –

the Gst.Caps that will be appended to

`caps2` (Gst.Caps) –

the Gst.Caps to append

#### gst_caps_append_structure

    gst_caps_append_structure (GstCaps * caps,
                               GstStructure * structure)

Appends structure to caps. The structure is not copied; caps becomes the owner of structure.

Parameters:

`caps` –

the GstCaps that will be appended to

`structure` ( [transfer: full]) –

the GstStructure to append

#### Gst.Caps.prototype.append_structure

    function Gst.Caps.prototype.append_structure(structure: Gst.Structure): {
        // javascript wrapper for 'gst_caps_append_structure'
    }

Appends structure to caps. The structure is not copied; caps becomes the owner of structure.

Parameters:

`caps` (Gst.Caps) –

the Gst.Caps that will be appended to

`structure` (Gst.Structure) –

the Gst.Structure to append

#### Gst.Caps.append_structure

    def Gst.Caps.append_structure (self, structure):
        #python wrapper for 'gst_caps_append_structure'

Appends structure to caps. The structure is not copied; caps becomes the owner of structure.

Parameters:

`caps` (Gst.Caps) –

the Gst.Caps that will be appended to

`structure` (Gst.Structure) –

the Gst.Structure to append

#### gst_caps_append_structure_full

    gst_caps_append_structure_full (GstCaps * caps,
                                    GstStructure * structure,
                                    GstCapsFeatures * features)

Appends structure with features to caps. The structure is not copied; caps becomes the owner of structure.

Parameters:

`caps` –

the GstCaps that will be appended to

`structure` ( [transfer: full]) –

the GstStructure to append

`features` ( [transfer: full][allow-none]) –

the GstCapsFeatures to append

Since : 1.2

#### Gst.Caps.prototype.append_structure_full

    function Gst.Caps.prototype.append_structure_full(structure: Gst.Structure, features: Gst.CapsFeatures): {
        // javascript wrapper for 'gst_caps_append_structure_full'
    }

Appends structure with features to caps. The structure is not copied; caps becomes the owner of structure.

Parameters:

`caps` (Gst.Caps) –

the Gst.Caps that will be appended to

`structure` (Gst.Structure) –

the Gst.Structure to append

`features` (Gst.CapsFeatures) –

the Gst.CapsFeatures to append

Since : 1.2

#### Gst.Caps.append_structure_full

    def Gst.Caps.append_structure_full (self, structure, features):
        #python wrapper for 'gst_caps_append_structure_full'

Appends structure with features to caps. The structure is not copied; caps becomes the owner of structure.

Parameters:

`caps` (Gst.Caps) –

the Gst.Caps that will be appended to

`structure` (Gst.Structure) –

the Gst.Structure to append

`features` (Gst.CapsFeatures) –

the Gst.CapsFeatures to append

Since : 1.2

#### gst_caps_can_intersect

    gboolean
    gst_caps_can_intersect (const GstCaps * caps1,
                            const GstCaps * caps2)

Tries intersecting caps1 and caps2 and reports whether the result would not be empty

Parameters:

`caps1` –

a GstCaps to intersect

`caps2` –

a GstCaps to intersect

Returns –

TRUE if intersection would be not empty

#### Gst.Caps.prototype.can_intersect

    function Gst.Caps.prototype.can_intersect(caps2: Gst.Caps): {
        // javascript wrapper for 'gst_caps_can_intersect'
    }

Tries intersecting caps1 and caps2 and reports whether the result would not be empty

Parameters:

`caps1` (Gst.Caps) –

a Gst.Caps to intersect

`caps2` (Gst.Caps) –

a Gst.Caps to intersect

Returns (Number) –

true if intersection would be not empty

#### Gst.Caps.can_intersect

    def Gst.Caps.can_intersect (self, caps2):
        #python wrapper for 'gst_caps_can_intersect'

Tries intersecting caps1 and caps2 and reports whether the result would not be empty

Parameters:

`caps1` (Gst.Caps) –

a Gst.Caps to intersect

`caps2` (Gst.Caps) –

a Gst.Caps to intersect

Returns (bool) –

True if intersection would be not empty

#### gst_caps_copy

    GstCaps *
    gst_caps_copy (const GstCaps * caps)

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.

Parameters:

`caps` –

a GstCaps.

Returns ( [transfer: full]) –

the new GstCaps

#### Gst.Caps.prototype.copy

    function Gst.Caps.prototype.copy(): {
        // javascript wrapper for 'gst_caps_copy'
    }

Creates a new Gst.Caps 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 (not introspectable) followed by a Gst.Caps.prototype.make_writable. If you only want to hold on to a reference to the data, you should use gst_caps_ref (not introspectable).

Parameters:

`caps` (Gst.Caps) –

a Gst.Caps.

Returns (Gst.Caps) –

the new Gst.Caps

#### Gst.Caps.copy

    def Gst.Caps.copy (self):
        #python wrapper for 'gst_caps_copy'

Creates a new Gst.Caps 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 (not introspectable) 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 (not introspectable).

Parameters:

`caps` (Gst.Caps) –

a Gst.Caps.

Returns (Gst.Caps) –

the new Gst.Caps

#### gst_caps_copy_nth

    GstCaps *
    gst_caps_copy_nth (const GstCaps * caps,
                       guint nth)

Creates a new GstCaps and appends a copy of the nth structure contained in caps.

Parameters:

`caps` –

the GstCaps to copy

`nth` –

the nth structure to copy

Returns ( [transfer: full]) –

the new GstCaps

Since : 1.16

#### Gst.Caps.prototype.copy_nth

    function Gst.Caps.prototype.copy_nth(nth: Number): {
        // javascript wrapper for 'gst_caps_copy_nth'
    }

Creates a new Gst.Caps and appends a copy of the nth structure contained in caps.

Parameters:

`caps` (Gst.Caps) –

the Gst.Caps to copy

`nth` (Number) –

the nth structure to copy

Returns (Gst.Caps) –

the new Gst.Caps

Since : 1.16

#### Gst.Caps.copy_nth

    def Gst.Caps.copy_nth (self, nth):
        #python wrapper for 'gst_caps_copy_nth'

Creates a new Gst.Caps and appends a copy of the nth structure contained in caps.

Parameters:

`caps` (Gst.Caps) –

the Gst.Caps to copy

`nth` (int) –

the nth structure to copy

Returns (Gst.Caps) –

the new Gst.Caps

Since : 1.16

#### gst_caps_filter_and_map_in_place

    gst_caps_filter_and_map_in_place (GstCaps * caps,
                                      GstCapsFilterMapFunc func,
                                      gpointer user_data)

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_map_in_place, the structure and features are removed from the caps if FALSE is returned from the function. The caps must be mutable.

Parameters:

`caps` –

a GstCaps

`func` ( [scope call][closure]) –

a function to call for each field

`user_data` –

private data

Since : 1.6

#### Gst.Caps.prototype.filter_and_map_in_place

    function Gst.Caps.prototype.filter_and_map_in_place(func: Gst.CapsFilterMapFunc, user_data: Object): {
        // javascript wrapper for 'gst_caps_filter_and_map_in_place'
    }

Calls the provided function once for each structure and caps feature in the Gst.Caps. In contrast to Gst.Caps.prototype.foreach, the function may modify the structure and features. In contrast to Gst.Caps.prototype.map_in_place, the structure and features are removed from the caps if false is returned from the function. The caps must be mutable.

Parameters:

`caps` (Gst.Caps) –

a Gst.Caps

`func` (Gst.CapsFilterMapFunc) –

a function to call for each field

`user_data` (Object) –

private data

Since : 1.6

#### Gst.Caps.filter_and_map_in_place

    def Gst.Caps.filter_and_map_in_place (self, func, *user_data):
        #python wrapper for 'gst_caps_filter_and_map_in_place'

Calls the provided function once for each structure and caps feature in the Gst.Caps. In contrast to Gst.Caps.foreach, the function may modify the structure and features. In contrast to Gst.Caps.map_in_place, the structure and features are removed from the caps if False is returned from the function. The caps must be mutable.

Parameters:

`caps` (Gst.Caps) –

a Gst.Caps

`func` (Gst.CapsFilterMapFunc) –

a function to call for each field

`user_data` (variadic) –

private data

Since : 1.6

#### gst_caps_fixate

    GstCaps *
    gst_caps_fixate (GstCaps * caps)

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.

Parameters:

`caps` ( [transfer: full]) –

a GstCaps to fixate

Returns ( [transfer: full]) –

the fixated caps

#### Gst.Caps.prototype.fixate

    function Gst.Caps.prototype.fixate(): {
        // javascript wrapper for 'gst_caps_fixate'
    }

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.prototype.fixate.

This function takes ownership of caps and will call Gst.Caps.prototype.make_writable on it so you must not use caps afterwards unless you keep an additional reference to it with gst_caps_ref (not introspectable).

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.

Parameters:

`caps` (Gst.Caps) –

a Gst.Caps to fixate

Returns (Gst.Caps) –

the fixated caps

#### Gst.Caps.fixate

    def Gst.Caps.fixate (self):
        #python wrapper for 'gst_caps_fixate'

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 (not introspectable).

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.

Parameters:

`caps` (Gst.Caps) –

a Gst.Caps to fixate

Returns (Gst.Caps) –

the fixated caps

#### gst_caps_foreach

    gboolean
    gst_caps_foreach (const GstCaps * caps,
                      GstCapsForeachFunc func,
                      gpointer user_data)

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.

Parameters:

`caps` –

a GstCaps

`func` ( [scope call][closure]) –

a function to call for each field

`user_data` –

private data

Returns –

TRUE if the supplied function returns TRUE for each call, FALSE otherwise.

Since : 1.6

#### Gst.Caps.prototype.foreach

    function Gst.Caps.prototype.foreach(func: Gst.CapsForeachFunc, user_data: Object): {
        // javascript wrapper for 'gst_caps_foreach'
    }

Calls the provided function once for each structure and caps feature in the Gst.Caps. The function must not modify the fields. Also see Gst.Caps.prototype.map_in_place and Gst.Caps.prototype.filter_and_map_in_place.

Parameters:

`caps` (Gst.Caps) –

a Gst.Caps

`func` (Gst.CapsForeachFunc) –

a function to call for each field

`user_data` (Object) –

private data

Returns (Number) –

true if the supplied function returns true for each call, false otherwise.

Since : 1.6

#### Gst.Caps.foreach

    def Gst.Caps.foreach (self, func, *user_data):
        #python wrapper for 'gst_caps_foreach'

Calls the provided function once for each structure and caps feature in the Gst.Caps. The function must not modify the fields. Also see Gst.Caps.map_in_place and Gst.Caps.filter_and_map_in_place.

Parameters:

`caps` (Gst.Caps) –

a Gst.Caps

`func` (Gst.CapsForeachFunc) –

a function to call for each field

`user_data` (variadic) –

private data

Returns (bool) –

True if the supplied function returns True for each call, False otherwise.

Since : 1.6

#### gst_caps_get_features

    GstCapsFeatures *
    gst_caps_get_features (const GstCaps * caps,
                           guint index)

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.

Parameters:

`caps` –

a GstCaps

`index` –

the index of the structure

Returns ( [transfer: none][nullable]) –

a pointer to the GstCapsFeatures corresponding to index

Since : 1.2

#### Gst.Caps.prototype.get_features

    function Gst.Caps.prototype.get_features(index: Number): {
        // javascript wrapper for 'gst_caps_get_features'
    }

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 Gst.Caps 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.prototype.make_writable, you may modify the features returned in the usual way, e.g. with functions like Gst.CapsFeatures.prototype.add.

Parameters:

`caps` (Gst.Caps) –

a Gst.Caps

`index` (Number) –

the index of the structure

Returns (Gst.CapsFeatures) –

a pointer to the Gst.CapsFeatures corresponding to index

Since : 1.2

#### Gst.Caps.get_features

    def Gst.Caps.get_features (self, index):
        #python wrapper for 'gst_caps_get_features'

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 Gst.Caps 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.CapsFeatures.add.

Parameters:

`caps` (Gst.Caps) –

a Gst.Caps

`index` (int) –

the index of the structure

Returns (Gst.CapsFeatures) –

a pointer to the Gst.CapsFeatures corresponding to index

Since : 1.2

#### gst_caps_get_size

    guint
    gst_caps_get_size (const GstCaps * caps)

Gets the number of structures contained in caps.

Parameters:

`caps` –

a GstCaps

Returns –

the number of structures that caps contains

#### Gst.Caps.prototype.get_size

    function Gst.Caps.prototype.get_size(): {
        // javascript wrapper for 'gst_caps_get_size'
    }

Gets the number of structures contained in caps.

Parameters:

`caps` (Gst.Caps) –

a Gst.Caps

Returns (Number) –

the number of structures that caps contains

#### Gst.Caps.get_size

    def Gst.Caps.get_size (self):
        #python wrapper for 'gst_caps_get_size'

Gets the number of structures contained in caps.

Parameters:

`caps` (Gst.Caps) –

a Gst.Caps

Returns (int) –

the number of structures that caps contains

#### gst_caps_get_structure

    GstStructure *
    gst_caps_get_structure (const GstCaps * caps,
                            guint index)

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.

Parameters:

`caps` –

a GstCaps

`index` –

the index of the structure

Returns ( [transfer: none]) –

a pointer to the GstStructure corresponding to index

#### Gst.Caps.prototype.get_structure

    function Gst.Caps.prototype.get_structure(index: Number): {
        // javascript wrapper for 'gst_caps_get_structure'
    }

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 Gst.Caps 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.prototype.make_writable, you may modify the structure returned in the usual way, e.g. with functions like gst_structure_set (not introspectable).

Parameters:

`caps` (Gst.Caps) –

a Gst.Caps

`index` (Number) –

the index of the structure

Returns (Gst.Structure) –

a pointer to the Gst.Structure corresponding to index

#### Gst.Caps.get_structure

    def Gst.Caps.get_structure (self, index):
        #python wrapper for 'gst_caps_get_structure'

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 Gst.Caps 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 (not introspectable).

Parameters:

`caps` (Gst.Caps) –

a Gst.Caps

`index` (int) –

the index of the structure

Returns (Gst.Structure) –

a pointer to the Gst.Structure corresponding to index

#### gst_caps_id_str_set_simple

    gst_caps_id_str_set_simple (GstCaps * caps,
                                const GstIdStr * field,
                                ... ...)

Sets fields in a GstCaps. The arguments must be passed in the same manner as gst_structure_id_str_set, and be NULL-terminated.

Parameters:

`caps` –

the GstCaps to set

`field` –

first field to set

`...` –

additional parameters

Since : 1.26

#### gst_caps_id_str_set_simple_valist

    gst_caps_id_str_set_simple_valist (GstCaps * caps,
                                       const GstIdStr * field,
                                       va_list varargs)

Sets fields in a GstCaps. The arguments must be passed in the same manner as gst_structure_id_str_set, and be NULL-terminated.

Parameters:

`caps` –

the GstCaps to set

`field` –

first field to set

`varargs` –

additional parameters

Since : 1.26

#### gst_caps_id_str_set_value

    gst_caps_id_str_set_value (GstCaps * caps,
                               const GstIdStr * field,
                               const GValue * value)

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.

Parameters:

`caps` –

a writable caps

`field` –

name of the field to set

`value` –

value to set the field to

Since : 1.26

#### Gst.Caps.prototype.id_str_set_value

    function Gst.Caps.prototype.id_str_set_value(field: Gst.IdStr, value: GObject.Value): {
        // javascript wrapper for 'gst_caps_id_str_set_value'
    }

Sets the given field on all structures of caps to the given value. This is a convenience function for calling Gst.Structure.prototype.set_value on all structures of caps.

Parameters:

`caps` (Gst.Caps) –

a writable caps

`field` (Gst.IdStr) –

name of the field to set

`value` (GObject.Value) –

value to set the field to

Since : 1.26

#### Gst.Caps.id_str_set_value

    def Gst.Caps.id_str_set_value (self, field, value):
        #python wrapper for 'gst_caps_id_str_set_value'

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.

Parameters:

`caps` (Gst.Caps) –

a writable caps

`field` (Gst.IdStr) –

name of the field to set

`value` (GObject.Value) –

value to set the field to

Since : 1.26

#### gst_caps_intersect

    GstCaps *
    gst_caps_intersect (GstCaps * caps1,
                        GstCaps * caps2)

Creates a new GstCaps that contains all the formats that are common to both caps1 and caps2. Defaults to GST_CAPS_INTERSECT_ZIG_ZAG mode.

Parameters:

`caps1` –

a GstCaps to intersect

`caps2` –

a GstCaps to intersect

Returns ( [transfer: full]) –

the new GstCaps

#### Gst.Caps.prototype.intersect

    function Gst.Caps.prototype.intersect(caps2: Gst.Caps): {
        // javascript wrapper for 'gst_caps_intersect'
    }

Creates a new Gst.Caps that contains all the formats that are common to both caps1 and caps2. Defaults to Gst.CapsIntersectMode.ZIG_ZAG mode.

Parameters:

`caps1` (Gst.Caps) –

a Gst.Caps to intersect

`caps2` (Gst.Caps) –

a Gst.Caps to intersect

Returns (Gst.Caps) –

the new Gst.Caps

#### Gst.Caps.intersect

    def Gst.Caps.intersect (self, caps2):
        #python wrapper for 'gst_caps_intersect'

Creates a new Gst.Caps that contains all the formats that are common to both caps1 and caps2. Defaults to Gst.CapsIntersectMode.ZIG_ZAG mode.

Parameters:

`caps1` (Gst.Caps) –

a Gst.Caps to intersect

`caps2` (Gst.Caps) –

a Gst.Caps to intersect

Returns (Gst.Caps) –

the new Gst.Caps

#### gst_caps_intersect_full

    GstCaps *
    gst_caps_intersect_full (GstCaps * caps1,
                             GstCaps * caps2,
                             GstCapsIntersectMode mode)

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.

Parameters:

`caps1` –

a GstCaps to intersect

`caps2` –

a GstCaps to intersect

`mode` –

The intersection algorithm/mode to use

Returns ( [transfer: full]) –

the new GstCaps

#### Gst.Caps.prototype.intersect_full

    function Gst.Caps.prototype.intersect_full(caps2: Gst.Caps, mode: Gst.CapsIntersectMode): {
        // javascript wrapper for 'gst_caps_intersect_full'
    }

Creates a new Gst.Caps that contains all the formats that are common to both caps1 and caps2, the order is defined by the Gst.CapsIntersectMode used.

Parameters:

`caps1` (Gst.Caps) –

a Gst.Caps to intersect

`caps2` (Gst.Caps) –

a Gst.Caps to intersect

`mode` (Gst.CapsIntersectMode) –

The intersection algorithm/mode to use

Returns (Gst.Caps) –

the new Gst.Caps

#### Gst.Caps.intersect_full

    def Gst.Caps.intersect_full (self, caps2, mode):
        #python wrapper for 'gst_caps_intersect_full'

Creates a new Gst.Caps that contains all the formats that are common to both caps1 and caps2, the order is defined by the Gst.CapsIntersectMode used.

Parameters:

`caps1` (Gst.Caps) –

a Gst.Caps to intersect

`caps2` (Gst.Caps) –

a Gst.Caps to intersect

`mode` (Gst.CapsIntersectMode) –

The intersection algorithm/mode to use

Returns (Gst.Caps) –

the new Gst.Caps

#### gst_caps_is_always_compatible

    gboolean
    gst_caps_is_always_compatible (const GstCaps * caps1,
                                   const GstCaps * caps2)

A given GstCaps structure is always compatible with another if every media format that is in the first is also contained in the second. That is, caps1 is a subset of caps2.

Parameters:

`caps1` –

the GstCaps to test

`caps2` –

the GstCaps to test

Returns –

TRUE if caps1 is a subset of caps2.

#### Gst.Caps.prototype.is_always_compatible

    function Gst.Caps.prototype.is_always_compatible(caps2: Gst.Caps): {
        // javascript wrapper for 'gst_caps_is_always_compatible'
    }

A given Gst.Caps structure is always compatible with another if every media format that is in the first is also contained in the second. That is, caps1 is a subset of caps2.

Parameters:

`caps1` (Gst.Caps) –

the Gst.Caps to test

`caps2` (Gst.Caps) –

the Gst.Caps to test

Returns (Number) –

true if caps1 is a subset of caps2.

#### Gst.Caps.is_always_compatible

    def Gst.Caps.is_always_compatible (self, caps2):
        #python wrapper for 'gst_caps_is_always_compatible'

A given Gst.Caps structure is always compatible with another if every media format that is in the first is also contained in the second. That is, caps1 is a subset of caps2.

Parameters:

`caps1` (Gst.Caps) –

the Gst.Caps to test

`caps2` (Gst.Caps) –

the Gst.Caps to test

Returns (bool) –

True if caps1 is a subset of caps2.

#### gst_caps_is_any

    gboolean
    gst_caps_is_any (const GstCaps * caps)

Determines if caps represents any media format.

Parameters:

`caps` –

the GstCaps to test

Returns –

TRUE if caps represents any format.

#### Gst.Caps.prototype.is_any

    function Gst.Caps.prototype.is_any(): {
        // javascript wrapper for 'gst_caps_is_any'
    }

Determines if caps represents any media format.

Parameters:

`caps` (Gst.Caps) –

the Gst.Caps to test

Returns (Number) –

true if caps represents any format.

#### Gst.Caps.is_any

    def Gst.Caps.is_any (self):
        #python wrapper for 'gst_caps_is_any'

Determines if caps represents any media format.

Parameters:

`caps` (Gst.Caps) –

the Gst.Caps to test

Returns (bool) –

True if caps represents any format.

#### gst_caps_is_empty

    gboolean
    gst_caps_is_empty (const GstCaps * caps)

Determines if caps represents no media formats.

Parameters:

`caps` –

the GstCaps to test

Returns –

TRUE if caps represents no formats.

#### Gst.Caps.prototype.is_empty

    function Gst.Caps.prototype.is_empty(): {
        // javascript wrapper for 'gst_caps_is_empty'
    }

Determines if caps represents no media formats.

Parameters:

`caps` (Gst.Caps) –

the Gst.Caps to test

Returns (Number) –

true if caps represents no formats.

#### Gst.Caps.is_empty

    def Gst.Caps.is_empty (self):
        #python wrapper for 'gst_caps_is_empty'

Determines if caps represents no media formats.

Parameters:

`caps` (Gst.Caps) –

the Gst.Caps to test

Returns (bool) –

True if caps represents no formats.

#### gst_caps_is_equal

    gboolean
    gst_caps_is_equal (const GstCaps * caps1,
                       const GstCaps * caps2)

Checks if the given caps represent the same set of caps.

Parameters:

`caps1` –

a GstCaps

`caps2` –

another GstCaps

Returns –

TRUE if both caps are equal.

#### Gst.Caps.prototype.is_equal

    function Gst.Caps.prototype.is_equal(caps2: Gst.Caps): {
        // javascript wrapper for 'gst_caps_is_equal'
    }

Checks if the given caps represent the same set of caps.

Parameters:

`caps1` (Gst.Caps) –

a Gst.Caps

`caps2` (Gst.Caps) –

another Gst.Caps

Returns (Number) –

true if both caps are equal.

#### Gst.Caps.is_equal

    def Gst.Caps.is_equal (self, caps2):
        #python wrapper for 'gst_caps_is_equal'

Checks if the given caps represent the same set of caps.

Parameters:

`caps1` (Gst.Caps) –

a Gst.Caps

`caps2` (Gst.Caps) –

another Gst.Caps

Returns (bool) –

True if both caps are equal.

#### gst_caps_is_equal_fixed

    gboolean
    gst_caps_is_equal_fixed (const GstCaps * caps1,
                             const GstCaps * caps2)

Tests if two GstCaps are equal. This function only works on fixed GstCaps.

Parameters:

`caps1` –

the GstCaps to test

`caps2` –

the GstCaps to test

Returns –

TRUE if the arguments represent the same format

#### Gst.Caps.prototype.is_equal_fixed

    function Gst.Caps.prototype.is_equal_fixed(caps2: Gst.Caps): {
        // javascript wrapper for 'gst_caps_is_equal_fixed'
    }

Tests if two Gst.Caps are equal. This function only works on fixed Gst.Caps.

Parameters:

`caps1` (Gst.Caps) –

the Gst.Caps to test

`caps2` (Gst.Caps) –

the Gst.Caps to test

Returns (Number) –

true if the arguments represent the same format

#### Gst.Caps.is_equal_fixed

    def Gst.Caps.is_equal_fixed (self, caps2):
        #python wrapper for 'gst_caps_is_equal_fixed'

Tests if two Gst.Caps are equal. This function only works on fixed Gst.Caps.

Parameters:

`caps1` (Gst.Caps) –

the Gst.Caps to test

`caps2` (Gst.Caps) –

the Gst.Caps to test

Returns (bool) –

True if the arguments represent the same format

#### gst_caps_is_fixed

    gboolean
    gst_caps_is_fixed (const GstCaps * caps)

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.

Parameters:

`caps` –

the GstCaps to test

Returns –

TRUE if caps is fixed

#### Gst.Caps.prototype.is_fixed

    function Gst.Caps.prototype.is_fixed(): {
        // javascript wrapper for 'gst_caps_is_fixed'
    }

Fixed Gst.Caps 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.

Parameters:

`caps` (Gst.Caps) –

the Gst.Caps to test

Returns (Number) –

true if caps is fixed

#### Gst.Caps.is_fixed

    def Gst.Caps.is_fixed (self):
        #python wrapper for 'gst_caps_is_fixed'

Fixed Gst.Caps 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.

Parameters:

`caps` (Gst.Caps) –

the Gst.Caps to test

Returns (bool) –

True if caps is fixed

#### gst_caps_is_strictly_equal

    gboolean
    gst_caps_is_strictly_equal (const GstCaps * caps1,
                                const GstCaps * caps2)

Checks if the given caps are exactly the same set of caps.

Parameters:

`caps1` –

a GstCaps

`caps2` –

another GstCaps

Returns –

TRUE if both caps are strictly equal.

#### Gst.Caps.prototype.is_strictly_equal

    function Gst.Caps.prototype.is_strictly_equal(caps2: Gst.Caps): {
        // javascript wrapper for 'gst_caps_is_strictly_equal'
    }

Checks if the given caps are exactly the same set of caps.

Parameters:

`caps1` (Gst.Caps) –

a Gst.Caps

`caps2` (Gst.Caps) –

another Gst.Caps

Returns (Number) –

true if both caps are strictly equal.

#### Gst.Caps.is_strictly_equal

    def Gst.Caps.is_strictly_equal (self, caps2):
        #python wrapper for 'gst_caps_is_strictly_equal'

Checks if the given caps are exactly the same set of caps.

Parameters:

`caps1` (Gst.Caps) –

a Gst.Caps

`caps2` (Gst.Caps) –

another Gst.Caps

Returns (bool) –

True if both caps are strictly equal.

#### gst_caps_is_subset

    gboolean
    gst_caps_is_subset (const GstCaps * subset,
                        const GstCaps * superset)

Checks if all caps represented by subset are also represented by superset.

Parameters:

`subset` –

a GstCaps

`superset` –

a potentially greater GstCaps

Returns –

TRUE if subset is a subset of superset

#### Gst.Caps.prototype.is_subset

    function Gst.Caps.prototype.is_subset(superset: Gst.Caps): {
        // javascript wrapper for 'gst_caps_is_subset'
    }

Checks if all caps represented by subset are also represented by superset.

Parameters:

`subset` (Gst.Caps) –

a Gst.Caps

`superset` (Gst.Caps) –

a potentially greater Gst.Caps

Returns (Number) –

true if subset is a subset of superset

#### Gst.Caps.is_subset

    def Gst.Caps.is_subset (self, superset):
        #python wrapper for 'gst_caps_is_subset'

Checks if all caps represented by subset are also represented by superset.

Parameters:

`subset` (Gst.Caps) –

a Gst.Caps

`superset` (Gst.Caps) –

a potentially greater Gst.Caps

Returns (bool) –

True if subset is a subset of superset

#### gst_caps_is_subset_structure

    gboolean
    gst_caps_is_subset_structure (const GstCaps * caps,
                                  const GstStructure * structure)

Checks if structure is a subset of caps. See gst_caps_is_subset for more information.

Parameters:

`caps` –

a GstCaps

`structure` –

a potential GstStructure subset of caps

Returns –

TRUE if structure is a subset of caps

#### Gst.Caps.prototype.is_subset_structure

    function Gst.Caps.prototype.is_subset_structure(structure: Gst.Structure): {
        // javascript wrapper for 'gst_caps_is_subset_structure'
    }

Checks if structure is a subset of caps. See Gst.Caps.prototype.is_subset for more information.

Parameters:

`caps` (Gst.Caps) –

a Gst.Caps

`structure` (Gst.Structure) –

a potential Gst.Structure subset of caps

Returns (Number) –

true if structure is a subset of caps

#### Gst.Caps.is_subset_structure

    def Gst.Caps.is_subset_structure (self, structure):
        #python wrapper for 'gst_caps_is_subset_structure'

Checks if structure is a subset of caps. See Gst.Caps.is_subset for more information.

Parameters:

`caps` (Gst.Caps) –

a Gst.Caps

`structure` (Gst.Structure) –

a potential Gst.Structure subset of caps

Returns (bool) –

True if structure is a subset of caps

#### gst_caps_is_subset_structure_full

    gboolean
    gst_caps_is_subset_structure_full (const GstCaps * caps,
                                       const GstStructure * structure,
                                       const GstCapsFeatures * features)

Checks if structure is a subset of caps. See gst_caps_is_subset for more information.

Parameters:

`caps` –

a GstCaps

`structure` –

a potential GstStructure subset of caps

`features` ( [allow-none]) –

a GstCapsFeatures for structure

Returns –

TRUE if structure is a subset of caps

Since : 1.2

#### Gst.Caps.prototype.is_subset_structure_full

    function Gst.Caps.prototype.is_subset_structure_full(structure: Gst.Structure, features: Gst.CapsFeatures): {
        // javascript wrapper for 'gst_caps_is_subset_structure_full'
    }

Checks if structure is a subset of caps. See Gst.Caps.prototype.is_subset for more information.

Parameters:

`caps` (Gst.Caps) –

a Gst.Caps

`structure` (Gst.Structure) –

a potential Gst.Structure subset of caps

`features` (Gst.CapsFeatures) –

a Gst.CapsFeatures for structure

Returns (Number) –

true if structure is a subset of caps

Since : 1.2

#### Gst.Caps.is_subset_structure_full

    def Gst.Caps.is_subset_structure_full (self, structure, features):
        #python wrapper for 'gst_caps_is_subset_structure_full'

Checks if structure is a subset of caps. See Gst.Caps.is_subset for more information.

Parameters:

`caps` (Gst.Caps) –

a Gst.Caps

`structure` (Gst.Structure) –

a potential Gst.Structure subset of caps

`features` (Gst.CapsFeatures) –

a Gst.CapsFeatures for structure

Returns (bool) –

True if structure is a subset of caps

Since : 1.2

#### gst_caps_is_writable

    gboolean
    gst_caps_is_writable (const GstCaps * caps)

Tests if you can safely modify caps. It is only safe to modify caps when there is only one owner of the caps - ie, the object is writable.

Parameters:

`caps` –

a GstCaps

Returns –
No description available

#### Gst.Caps.prototype.is_writable

    function Gst.Caps.prototype.is_writable(): {
        // javascript wrapper for 'gst_caps_is_writable'
    }

Tests if you can safely modify caps. It is only safe to modify caps when there is only one owner of the caps - ie, the object is writable.

Parameters:

`caps` (Gst.Caps) –

a Gst.Caps

Returns (Number) –
No description available

#### Gst.Caps.is_writable

    def Gst.Caps.is_writable (self):
        #python wrapper for 'gst_caps_is_writable'

Tests if you can safely modify caps. It is only safe to modify caps when there is only one owner of the caps - ie, the object is writable.

Parameters:

`caps` (Gst.Caps) –

a Gst.Caps

Returns (bool) –
No description available

#### gst_caps_make_writable

    GstCaps *
    gst_caps_make_writable (GstCaps * caps)

Returns a writable copy of caps.

If there is only one reference count on caps, the caller must be the owner, and so this function will return the caps object unchanged. If on the other hand there is more than one reference on the object, a new caps object will be returned. The caller's reference on caps will be removed, and instead the caller will own a reference to the returned object.

In short, this function unrefs the caps in the argument and refs the caps that it returns. Don't access the argument after calling this function. See also: gst_caps_ref.

Parameters:

`caps` ( [transfer: full]) –

a GstCaps

Returns ( [transfer: full]) –

a writable caps which may or may not be the same as caps

#### Gst.Caps.prototype.make_writable

    function Gst.Caps.prototype.make_writable(): {
        // javascript wrapper for 'gst_caps_make_writable'
    }

Returns a writable copy of caps.

If there is only one reference count on caps, the caller must be the owner, and so this function will return the caps object unchanged. If on the other hand there is more than one reference on the object, a new caps object will be returned. The caller's reference on caps will be removed, and instead the caller will own a reference to the returned object.

In short, this function unrefs the caps in the argument and refs the caps that it returns. Don't access the argument after calling this function. See also: gst_caps_ref (not introspectable).

Parameters:

`caps` (Gst.Caps) –

a Gst.Caps

Returns (Gst.Caps) –

a writable caps which may or may not be the same as caps

#### Gst.Caps.make_writable

    def Gst.Caps.make_writable (self):
        #python wrapper for 'gst_caps_make_writable'

Returns a writable copy of caps.

If there is only one reference count on caps, the caller must be the owner, and so this function will return the caps object unchanged. If on the other hand there is more than one reference on the object, a new caps object will be returned. The caller's reference on caps will be removed, and instead the caller will own a reference to the returned object.

In short, this function unrefs the caps in the argument and refs the caps that it returns. Don't access the argument after calling this function. See also: gst_caps_ref (not introspectable).

Parameters:

`caps` (Gst.Caps) –

a Gst.Caps

Returns (Gst.Caps) –

a writable caps which may or may not be the same as caps

#### gst_caps_map_in_place

    gboolean
    gst_caps_map_in_place (GstCaps * caps,
                           GstCapsMapFunc func,
                           gpointer user_data)

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.

Parameters:

`caps` –

a GstCaps

`func` ( [scope call][closure]) –

a function to call for each field

`user_data` –

private data

Returns –

TRUE if the supplied function returns TRUE for each call, FALSE otherwise.

Since : 1.6

#### Gst.Caps.prototype.map_in_place

    function Gst.Caps.prototype.map_in_place(func: Gst.CapsMapFunc, user_data: Object): {
        // javascript wrapper for 'gst_caps_map_in_place'
    }

Calls the provided function once for each structure and caps feature in the Gst.Caps. In contrast to Gst.Caps.prototype.foreach, the function may modify but not delete the structures and features. The caps must be mutable.

Parameters:

`caps` (Gst.Caps) –

a Gst.Caps

`func` (Gst.CapsMapFunc) –

a function to call for each field

`user_data` (Object) –

private data

Returns (Number) –

true if the supplied function returns true for each call, false otherwise.

Since : 1.6

#### Gst.Caps.map_in_place

    def Gst.Caps.map_in_place (self, func, *user_data):
        #python wrapper for 'gst_caps_map_in_place'

Calls the provided function once for each structure and caps feature in the Gst.Caps. In contrast to Gst.Caps.foreach, the function may modify but not delete the structures and features. The caps must be mutable.

Parameters:

`caps` (Gst.Caps) –

a Gst.Caps

`func` (Gst.CapsMapFunc) –

a function to call for each field

`user_data` (variadic) –

private data

Returns (bool) –

True if the supplied function returns True for each call, False otherwise.

Since : 1.6

#### gst_caps_merge

    GstCaps *
    gst_caps_merge (GstCaps * caps1,
                    GstCaps * caps2)

Appends the structures contained in caps2 to caps1 if they are not yet expressed by caps1. The structures in caps2 are not copied -- they are transferred to a writable copy of caps1, and then caps2 is freed. If either caps is ANY, the resulting caps will be ANY.

Parameters:

`caps1` ( [transfer: full]) –

the GstCaps that will take the new entries

`caps2` ( [transfer: full]) –

the GstCaps to merge in

Returns ( [transfer: full]) –

the merged caps.

#### Gst.Caps.prototype.merge

    function Gst.Caps.prototype.merge(caps2: Gst.Caps): {
        // javascript wrapper for 'gst_caps_merge'
    }

Appends the structures contained in caps2 to caps1 if they are not yet expressed by caps1. The structures in caps2 are not copied -- they are transferred to a writable copy of caps1, and then caps2 is freed. If either caps is ANY, the resulting caps will be ANY.

Parameters:

`caps1` (Gst.Caps) –

the Gst.Caps that will take the new entries

`caps2` (Gst.Caps) –

the Gst.Caps to merge in

Returns (Gst.Caps) –

the merged caps.

#### Gst.Caps.merge

    def Gst.Caps.merge (self, caps2):
        #python wrapper for 'gst_caps_merge'

Appends the structures contained in caps2 to caps1 if they are not yet expressed by caps1. The structures in caps2 are not copied -- they are transferred to a writable copy of caps1, and then caps2 is freed. If either caps is ANY, the resulting caps will be ANY.

Parameters:

`caps1` (Gst.Caps) –

the Gst.Caps that will take the new entries

`caps2` (Gst.Caps) –

the Gst.Caps to merge in

Returns (Gst.Caps) –

the merged caps.

#### gst_caps_merge_structure

    GstCaps *
    gst_caps_merge_structure (GstCaps * caps,
                              GstStructure * structure)

Appends structure to caps if it is not already expressed by caps.

Parameters:

`caps` ( [transfer: full]) –

the GstCaps to merge into

`structure` ( [transfer: full]) –

the GstStructure to merge

Returns ( [transfer: full]) –

the merged caps.

#### Gst.Caps.prototype.merge_structure

    function Gst.Caps.prototype.merge_structure(structure: Gst.Structure): {
        // javascript wrapper for 'gst_caps_merge_structure'
    }

Appends structure to caps if it is not already expressed by caps.

Parameters:

`caps` (Gst.Caps) –

the Gst.Caps to merge into

`structure` (Gst.Structure) –

the Gst.Structure to merge

Returns (Gst.Caps) –

the merged caps.

#### Gst.Caps.merge_structure

    def Gst.Caps.merge_structure (self, structure):
        #python wrapper for 'gst_caps_merge_structure'

Appends structure to caps if it is not already expressed by caps.

Parameters:

`caps` (Gst.Caps) –

the Gst.Caps to merge into

`structure` (Gst.Structure) –

the Gst.Structure to merge

Returns (Gst.Caps) –

the merged caps.

#### gst_caps_merge_structure_full

    GstCaps *
    gst_caps_merge_structure_full (GstCaps * caps,
                                   GstStructure * structure,
                                   GstCapsFeatures * features)

Appends structure with features to caps if its not already expressed by caps.

Parameters:

`caps` ( [transfer: full]) –

the GstCaps to merge into

`structure` ( [transfer: full]) –

the GstStructure to merge

`features` ( [transfer: full][allow-none]) –

the GstCapsFeatures to merge

Returns ( [transfer: full]) –

the merged caps.

Since : 1.2

#### Gst.Caps.prototype.merge_structure_full

    function Gst.Caps.prototype.merge_structure_full(structure: Gst.Structure, features: Gst.CapsFeatures): {
        // javascript wrapper for 'gst_caps_merge_structure_full'
    }

Appends structure with features to caps if its not already expressed by caps.

Parameters:

`caps` (Gst.Caps) –

the Gst.Caps to merge into

`structure` (Gst.Structure) –

the Gst.Structure to merge

`features` (Gst.CapsFeatures) –

the Gst.CapsFeatures to merge

Returns (Gst.Caps) –

the merged caps.

Since : 1.2

#### Gst.Caps.merge_structure_full

    def Gst.Caps.merge_structure_full (self, structure, features):
        #python wrapper for 'gst_caps_merge_structure_full'

Appends structure with features to caps if its not already expressed by caps.

Parameters:

`caps` (Gst.Caps) –

the Gst.Caps to merge into

`structure` (Gst.Structure) –

the Gst.Structure to merge

`features` (Gst.CapsFeatures) –

the Gst.CapsFeatures to merge

Returns (Gst.Caps) –

the merged caps.

Since : 1.2

#### gst_caps_normalize

    GstCaps *
    gst_caps_normalize (GstCaps * caps)

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.

Parameters:

`caps` ( [transfer: full]) –

a GstCaps to normalize

Returns ( [transfer: full]) –

the normalized GstCaps

#### Gst.Caps.prototype.normalize

    function Gst.Caps.prototype.normalize(): {
        // javascript wrapper for 'gst_caps_normalize'
    }

Returns a Gst.Caps that represents the same set of formats as caps, but contains no lists. Each list is expanded into separate Gst.Structure.

This function takes ownership of caps and will call Gst.Caps.prototype.make_writable on it so you must not use caps afterwards unless you keep an additional reference to it with gst_caps_ref (not introspectable).

Parameters:

`caps` (Gst.Caps) –

a Gst.Caps to normalize

Returns (Gst.Caps) –

the normalized Gst.Caps

#### Gst.Caps.normalize

    def Gst.Caps.normalize (self):
        #python wrapper for 'gst_caps_normalize'

Returns a Gst.Caps that represents the same set of formats as caps, but contains no lists. Each list is expanded into separate Gst.Structure.

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 (not introspectable).

Parameters:

`caps` (Gst.Caps) –

a Gst.Caps to normalize

Returns (Gst.Caps) –

the normalized Gst.Caps

#### gst_caps_ref

    GstCaps *
    gst_caps_ref (GstCaps * caps)

Adds a reference to a GstCaps object.

From this point on, until the caller calls gst_caps_unref or gst_caps_make_writable, it is guaranteed that the caps object will not change. This means its structures won't change, etc. To use a GstCaps object, you must always have a refcount on it -- either the one made implicitly by e.g. gst_caps_new_simple, or via taking one explicitly with this function.

Parameters:

`caps` –

the GstCaps to reference

Returns –

the same GstCaps object.

#### gst_caps_remove_structure

    gst_caps_remove_structure (GstCaps * caps,
                               guint idx)

Removes the structure with the given index from the list of structures contained in caps.

Parameters:

`caps` –

the GstCaps to remove from

`idx` –

Index of the structure to remove

#### Gst.Caps.prototype.remove_structure

    function Gst.Caps.prototype.remove_structure(idx: Number): {
        // javascript wrapper for 'gst_caps_remove_structure'
    }

Removes the structure with the given index from the list of structures contained in caps.

Parameters:

`caps` (Gst.Caps) –

the Gst.Caps to remove from

`idx` (Number) –

Index of the structure to remove

#### Gst.Caps.remove_structure

    def Gst.Caps.remove_structure (self, idx):
        #python wrapper for 'gst_caps_remove_structure'

Removes the structure with the given index from the list of structures contained in caps.

Parameters:

`caps` (Gst.Caps) –

the Gst.Caps to remove from

`idx` (int) –

Index of the structure to remove

#### gst_caps_serialize

    gchar *
    gst_caps_serialize (const GstCaps * caps,
                        GstSerializeFlags flags)

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.

Parameters:

`caps` –

a GstCaps

`flags` –

a GstSerializeFlags

Returns ( [transfer: full]) –

a newly allocated string representing caps.

Since : 1.20

#### Gst.Caps.prototype.serialize

    function Gst.Caps.prototype.serialize(flags: Gst.SerializeFlags): {
        // javascript wrapper for 'gst_caps_serialize'
    }

Converts caps to a string representation. This string representation can be converted back to a Gst.Caps by Gst.prototype.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.SerializeFlags.BACKWARD_COMPAT is passed as flag.

Parameters:

`caps` (Gst.Caps) –

a Gst.Caps

`flags` (Gst.SerializeFlags) –

a Gst.SerializeFlags

Returns (String) –

a newly allocated string representing caps.

Since : 1.20

#### Gst.Caps.serialize

    def Gst.Caps.serialize (self, flags):
        #python wrapper for 'gst_caps_serialize'

Converts caps to a string representation. This string representation can be converted back to a Gst.Caps 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.SerializeFlags.BACKWARD_COMPAT is passed as flag.

Parameters:

`caps` (Gst.Caps) –

a Gst.Caps

`flags` (Gst.SerializeFlags) –

a Gst.SerializeFlags

Returns (str) –

a newly allocated string representing caps.

Since : 1.20

#### gst_caps_set_features

    gst_caps_set_features (GstCaps * caps,
                           guint index,
                           GstCapsFeatures * features)

Sets the features for the structure at index.

Parameters:

`caps` –

a GstCaps

`index` –

the index of the structure

`features` ( [allow-none][transfer: full]) –

the GstCapsFeatures to set

Since : 1.2

#### Gst.Caps.prototype.set_features

    function Gst.Caps.prototype.set_features(index: Number, features: Gst.CapsFeatures): {
        // javascript wrapper for 'gst_caps_set_features'
    }

Sets the features for the structure at index.

Parameters:

`caps` (Gst.Caps) –

a Gst.Caps

`index` (Number) –

the index of the structure

`features` (Gst.CapsFeatures) –

the Gst.CapsFeatures to set

Since : 1.2

#### Gst.Caps.set_features

    def Gst.Caps.set_features (self, index, features):
        #python wrapper for 'gst_caps_set_features'

Sets the features for the structure at index.

Parameters:

`caps` (Gst.Caps) –

a Gst.Caps

`index` (int) –

the index of the structure

`features` (Gst.CapsFeatures) –

the Gst.CapsFeatures to set

Since : 1.2

#### gst_caps_set_features_simple

    gst_caps_set_features_simple (GstCaps * caps,
                                  GstCapsFeatures * features)

Sets the features for all the structures of caps.

Parameters:

`caps` –

a GstCaps

`features` ( [allow-none][transfer: full]) –

the GstCapsFeatures to set

Since : 1.16

#### Gst.Caps.prototype.set_features_simple

    function Gst.Caps.prototype.set_features_simple(features: Gst.CapsFeatures): {
        // javascript wrapper for 'gst_caps_set_features_simple'
    }

Sets the features for all the structures of caps.

Parameters:

`caps` (Gst.Caps) –

a Gst.Caps

`features` (Gst.CapsFeatures) –

the Gst.CapsFeatures to set

Since : 1.16

#### Gst.Caps.set_features_simple

    def Gst.Caps.set_features_simple (self, features):
        #python wrapper for 'gst_caps_set_features_simple'

Sets the features for all the structures of caps.

Parameters:

`caps` (Gst.Caps) –

a Gst.Caps

`features` (Gst.CapsFeatures) –

the Gst.CapsFeatures to set

Since : 1.16

#### gst_caps_set_simple

    gst_caps_set_simple (GstCaps * caps,
                         const char* field,
                         ... ...)

Sets fields in a GstCaps. The arguments must be passed in the same manner as gst_structure_set, and be NULL-terminated.

Parameters:

`caps` –

the GstCaps to set

`field` –

first field to set

`...` –

additional parameters

#### gst_caps_set_simple_static_str

    gst_caps_set_simple_static_str (GstCaps * caps,
                                    const char* field,
                                    ... ...)

Sets fields in a GstCaps. The arguments must be passed in the same manner as gst_structure_set, and be NULL-terminated.

field and all other field names need to be valid for the remaining lifetime of the process, e.g. have to be static strings.

Parameters:

`caps` –

the GstCaps to set

`field` –

first field to set

`...` –

additional parameters

Since : 1.26

#### gst_caps_set_simple_static_str_valist

    gst_caps_set_simple_static_str_valist (GstCaps * caps,
                                           const char* field,
                                           va_list varargs)

Sets fields in a GstCaps. The arguments must be passed in the same manner as gst_structure_set, and be NULL-terminated.

field and all other field names need to be valid for the remaining lifetime of the process, e.g. have to be static strings.

Parameters:

`caps` –

the GstCaps to set

`field` –

first field to set

`varargs` –

additional parameters

Since : 1.26

#### gst_caps_set_simple_valist

    gst_caps_set_simple_valist (GstCaps * caps,
                                const char* field,
                                va_list varargs)

Sets fields in a GstCaps. The arguments must be passed in the same manner as gst_structure_set, and be NULL-terminated.

Parameters:

`caps` –

the GstCaps to set

`field` –

first field to set

`varargs` –

additional parameters

#### gst_caps_set_value

    gst_caps_set_value (GstCaps * caps,
                        const char* field,
                        const GValue * value)

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.

Parameters:

`caps` –

a writable caps

`field` –

name of the field to set

`value` –

value to set the field to

#### Gst.Caps.prototype.set_value

    function Gst.Caps.prototype.set_value(field: String, value: GObject.Value): {
        // javascript wrapper for 'gst_caps_set_value'
    }

Sets the given field on all structures of caps to the given value. This is a convenience function for calling Gst.Structure.prototype.set_value on all structures of caps.

Parameters:

`caps` (Gst.Caps) –

a writable caps

`field` (String) –

name of the field to set

`value` (GObject.Value) –

value to set the field to

#### Gst.Caps.set_value

    def Gst.Caps.set_value (self, field, value):
        #python wrapper for 'gst_caps_set_value'

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.

Parameters:

`caps` (Gst.Caps) –

a writable caps

`field` (str) –

name of the field to set

`value` (GObject.Value) –

value to set the field to

#### gst_caps_set_value_static_str

    gst_caps_set_value_static_str (GstCaps * caps,
                                   const char* field,
                                   const GValue * value)

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.

field needs to be valid for the remaining lifetime of the process, e.g. has to be a static string.

Parameters:

`caps` –

a writable caps

`field` –

name of the field to set

`value` –

value to set the field to

Since : 1.26

#### Gst.Caps.prototype.set_value_static_str

    function Gst.Caps.prototype.set_value_static_str(field: String, value: GObject.Value): {
        // javascript wrapper for 'gst_caps_set_value_static_str'
    }

Sets the given field on all structures of caps to the given value. This is a convenience function for calling Gst.Structure.prototype.set_value on all structures of caps.

field needs to be valid for the remaining lifetime of the process, e.g. has to be a static string.

Parameters:

`caps` (Gst.Caps) –

a writable caps

`field` (String) –

name of the field to set

`value` (GObject.Value) –

value to set the field to

Since : 1.26

#### Gst.Caps.set_value_static_str

    def Gst.Caps.set_value_static_str (self, field, value):
        #python wrapper for 'gst_caps_set_value_static_str'

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.

field needs to be valid for the remaining lifetime of the process, e.g. has to be a static string.

Parameters:

`caps` (Gst.Caps) –

a writable caps

`field` (str) –

name of the field to set

`value` (GObject.Value) –

value to set the field to

Since : 1.26

#### gst_caps_simplify

    GstCaps *
    gst_caps_simplify (GstCaps * caps)

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.

Parameters:

`caps` ( [transfer: full]) –

a GstCaps to simplify

Returns ( [transfer: full]) –

The simplified caps.

#### Gst.Caps.prototype.simplify

    function Gst.Caps.prototype.simplify(): {
        // javascript wrapper for 'gst_caps_simplify'
    }

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.prototype.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 (not introspectable).

This method does not preserve the original order of caps.

Parameters:

`caps` (Gst.Caps) –

a Gst.Caps to simplify

Returns (Gst.Caps) –

The simplified caps.

#### Gst.Caps.simplify

    def Gst.Caps.simplify (self):
        #python wrapper for 'gst_caps_simplify'

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 (not introspectable).

This method does not preserve the original order of caps.

Parameters:

`caps` (Gst.Caps) –

a Gst.Caps to simplify

Returns (Gst.Caps) –

The simplified caps.

#### gst_caps_steal_structure

    GstStructure *
    gst_caps_steal_structure (GstCaps * caps,
                              guint index)

Retrieves the structure with the given index from the list of structures contained in caps. The caller becomes the owner of the returned structure.

Parameters:

`caps` –

the GstCaps to retrieve from

`index` –

Index of the structure to retrieve

Returns ( [transfer: full][nullable]) –

a pointer to the GstStructure corresponding to index.

#### Gst.Caps.prototype.steal_structure

    function Gst.Caps.prototype.steal_structure(index: Number): {
        // javascript wrapper for 'gst_caps_steal_structure'
    }

Retrieves the structure with the given index from the list of structures contained in caps. The caller becomes the owner of the returned structure.

Parameters:

`caps` (Gst.Caps) –

the Gst.Caps to retrieve from

`index` (Number) –

Index of the structure to retrieve

Returns (Gst.Structure) –

a pointer to the Gst.Structure corresponding to index.

#### Gst.Caps.steal_structure

    def Gst.Caps.steal_structure (self, index):
        #python wrapper for 'gst_caps_steal_structure'

Retrieves the structure with the given index from the list of structures contained in caps. The caller becomes the owner of the returned structure.

Parameters:

`caps` (Gst.Caps) –

the Gst.Caps to retrieve from

`index` (int) –

Index of the structure to retrieve

Returns (Gst.Structure) –

a pointer to the Gst.Structure corresponding to index.

#### gst_caps_subtract

    GstCaps *
    gst_caps_subtract (GstCaps * minuend,
                       GstCaps * subtrahend)

Subtracts the subtrahend from the minuend.

> This function does not work reliably if optional properties for caps are included on one caps and omitted on the other.

Parameters:

`minuend` –

GstCaps to subtract from

`subtrahend` –

GstCaps to subtract

Returns ( [transfer: full]) –

the resulting caps

#### Gst.Caps.prototype.subtract

    function Gst.Caps.prototype.subtract(subtrahend: Gst.Caps): {
        // javascript wrapper for 'gst_caps_subtract'
    }

Subtracts the subtrahend from the minuend.

> This function does not work reliably if optional properties for caps are included on one caps and omitted on the other.

Parameters:

`minuend` (Gst.Caps) –

Gst.Caps to subtract from

`subtrahend` (Gst.Caps) –

Gst.Caps to subtract

Returns (Gst.Caps) –

the resulting caps

#### Gst.Caps.subtract

    def Gst.Caps.subtract (self, subtrahend):
        #python wrapper for 'gst_caps_subtract'

Subtracts the subtrahend from the minuend.

> This function does not work reliably if optional properties for caps are included on one caps and omitted on the other.

Parameters:

`minuend` (Gst.Caps) –

Gst.Caps to subtract from

`subtrahend` (Gst.Caps) –

Gst.Caps to subtract

Returns (Gst.Caps) –

the resulting caps

#### gst_caps_to_string

    gchar *
    gst_caps_to_string (const GstCaps * 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.

Parameters:

`caps` –

a GstCaps

Returns ( [transfer: full]) –

a newly allocated string representing caps.

#### Gst.Caps.prototype.to_string

    function Gst.Caps.prototype.to_string(): {
        // javascript wrapper for 'gst_caps_to_string'
    }

Converts caps to a string representation. This string representation can be converted back to a Gst.Caps by Gst.prototype.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 Gst.Caps / Gst.Structure deeper than one level.

Parameters:

`caps` (Gst.Caps) –

a Gst.Caps

Returns (String) –

a newly allocated string representing caps.

#### Gst.Caps.to_string

    def Gst.Caps.to_string (self):
        #python wrapper for 'gst_caps_to_string'

Converts caps to a string representation. This string representation can be converted back to a Gst.Caps 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 Gst.Caps / Gst.Structure deeper than one level.

Parameters:

`caps` (Gst.Caps) –

a Gst.Caps

Returns (str) –

a newly allocated string representing caps.

#### gst_caps_truncate

    GstCaps *
    gst_caps_truncate (GstCaps * caps)

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.

Parameters:

`caps` ( [transfer: full]) –

the GstCaps to truncate

Returns ( [transfer: full]) –

truncated caps

#### Gst.Caps.prototype.truncate

    function Gst.Caps.prototype.truncate(): {
        // javascript wrapper for 'gst_caps_truncate'
    }

Discards all but the first structure from caps. Useful when fixating.

This function takes ownership of caps and will call Gst.Caps.prototype.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 (not introspectable).

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.

Parameters:

`caps` (Gst.Caps) –

the Gst.Caps to truncate

Returns (Gst.Caps) –

truncated caps

#### Gst.Caps.truncate

    def Gst.Caps.truncate (self):
        #python wrapper for 'gst_caps_truncate'

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 (not introspectable).

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.

Parameters:

`caps` (Gst.Caps) –

the Gst.Caps to truncate

Returns (Gst.Caps) –

truncated caps

#### gst_caps_unref

    gst_caps_unref (GstCaps * caps)

Unrefs a GstCaps and frees all its structures and the structures' values when the refcount reaches 0.

Parameters:

`caps` –

a GstCaps.

### Functions

#### gst_caps_from_string

    GstCaps *
    gst_caps_from_string (const gchar * string)

Converts caps from a string representation.

The implementation of serialization up to 1.20 would lead to unexpected results when there were nested GstCaps / GstStructure deeper than one level.

Parameters:

`string` –

a string to convert to GstCaps

Returns ( [transfer: full][nullable]) –

a newly allocated GstCaps

#### Gst.prototype.caps_from_string

    function Gst.prototype.caps_from_string(string: String): {
        // javascript wrapper for 'gst_caps_from_string'
    }

Converts caps from a string representation.

The implementation of serialization up to 1.20 would lead to unexpected results when there were nested Gst.Caps / Gst.Structure deeper than one level.

Parameters:

`string` (String) –

a string to convert to Gst.Caps

Returns (Gst.Caps) –

a newly allocated Gst.Caps

#### Gst.caps_from_string

    def Gst.caps_from_string (string):
        #python wrapper for 'gst_caps_from_string'

Converts caps from a string representation.

The implementation of serialization up to 1.20 would lead to unexpected results when there were nested Gst.Caps / Gst.Structure deeper than one level.

Parameters:

`string` (str) –

a string to convert to Gst.Caps

Returns (Gst.Caps) –

a newly allocated Gst.Caps

#### gst_caps_replace

    gboolean
    gst_caps_replace (GstCaps ** old_caps,
                      GstCaps * new_caps)

Modifies a pointer to a GstCaps to point to a different GstCaps. The modification is done atomically (so this is useful for ensuring thread safety in some cases), and the reference counts are updated appropriately (the old caps is unreffed, the new is reffed).

Either new_caps or the GstCaps pointed to by old_caps may be NULL.

Parameters:

`old_caps` ( [inout][transfer: full][nullable]) –

pointer to a pointer to a GstCaps to be replaced.

`new_caps` ( [transfer: none][allow-none]) –

pointer to a GstCaps that will replace the caps pointed to by old_caps.

Returns –

TRUE if new_caps was different from old_caps

#### gst_caps_steal

    GstCaps *
    gst_caps_steal (GstCaps ** old_caps)

Atomically replace the GstCaps pointed to by old_caps with NULL and return the original caps.

Parameters:

`old_caps` ( [inout][transfer: full][nullable]) –

pointer to a pointer to a GstCaps to be stolen.

Returns –
No description available

Since : 1.28

#### gst_caps_take

    gboolean
    gst_caps_take (GstCaps ** old_caps,
                   GstCaps * new_caps)

Modifies a pointer to a GstCaps to point to a different GstCaps. This function is similar to gst_caps_replace except that it takes ownership of new_caps.

Parameters:

`old_caps` ( [inout][transfer: full]) –

pointer to a pointer to a GstCaps to be replaced.

`new_caps` ( [transfer: full][allow-none]) –

pointer to a GstCaps that will replace the caps pointed to by old_caps.

Returns –

TRUE if new_caps was different from old_caps

## GstStaticCaps

Data structure to initialize GstCaps from a string description usually used in conjunction with GST_STATIC_CAPS and gst_static_caps_get to instantiate a GstCaps.

### Members

`caps` (GstCaps *) –

the cached GstCaps

`string` (const char*) –

a string describing a caps

## Gst.StaticCaps

Data structure to initialize Gst.Caps from a string description usually used in conjunction with GST_STATIC_CAPS (not introspectable) and Gst.StaticCaps.prototype.get to instantiate a Gst.Caps.

### Members

`caps` (Gst.Caps) –

the cached Gst.Caps

`string` (String) –

a string describing a caps

## Gst.StaticCaps

Data structure to initialize Gst.Caps from a string description usually used in conjunction with GST_STATIC_CAPS (not introspectable) and Gst.StaticCaps.get to instantiate a Gst.Caps.

### Members

`caps` (Gst.Caps) –

the cached Gst.Caps

`string` (str) –

a string describing a caps

### Methods

#### gst_static_caps_cleanup

    gst_static_caps_cleanup (GstStaticCaps * static_caps)

Cleans up the cached caps contained in static_caps.

Parameters:

`static_caps` –

the GstStaticCaps to clean

#### Gst.StaticCaps.prototype.cleanup

    function Gst.StaticCaps.prototype.cleanup(): {
        // javascript wrapper for 'gst_static_caps_cleanup'
    }

Cleans up the cached caps contained in static_caps.

Parameters:

`static_caps` (Gst.StaticCaps) –

the Gst.StaticCaps to clean

#### Gst.StaticCaps.cleanup

    def Gst.StaticCaps.cleanup (self):
        #python wrapper for 'gst_static_caps_cleanup'

Cleans up the cached caps contained in static_caps.

Parameters:

`static_caps` (Gst.StaticCaps) –

the Gst.StaticCaps to clean

#### gst_static_caps_get

    GstCaps *
    gst_static_caps_get (GstStaticCaps * static_caps)

Converts a GstStaticCaps to a GstCaps.

Parameters:

`static_caps` –

the GstStaticCaps to convert

Returns ( [transfer: full][nullable]) –

a pointer to the GstCaps. Since the core holds an additional ref to the returned caps, use gst_caps_make_writable on the returned caps to modify it.

#### Gst.StaticCaps.prototype.get

    function Gst.StaticCaps.prototype.get(): {
        // javascript wrapper for 'gst_static_caps_get'
    }

Converts a Gst.StaticCaps to a Gst.Caps.

Parameters:

`static_caps` (Gst.StaticCaps) –

the Gst.StaticCaps to convert

Returns (Gst.Caps) –

a pointer to the Gst.Caps. Since the core holds an additional ref to the returned caps, use Gst.Caps.prototype.make_writable on the returned caps to modify it.

#### Gst.StaticCaps.get

    def Gst.StaticCaps.get (self):
        #python wrapper for 'gst_static_caps_get'

Converts a Gst.StaticCaps to a Gst.Caps.

Parameters:

`static_caps` (Gst.StaticCaps) –

the Gst.StaticCaps to convert

Returns (Gst.Caps) –

a pointer to the Gst.Caps. Since the core holds an additional ref to the returned caps, use Gst.Caps.make_writable on the returned caps to modify it.

## Functions

### gst_clear_caps

    gst_clear_caps (GstCaps ** caps_ptr)

Clears a reference to a GstCaps.

caps_ptr must not be NULL.

If the reference is NULL then this function does nothing. Otherwise, the reference count of the caps is decreased and the pointer is set to NULL.

Parameters:

`caps_ptr` –

a pointer to a GstCaps reference

Since : 1.16

## Function Macros

### GST_CAPS_CAST

    #define GST_CAPS_CAST(obj)        ((GstCaps*)(obj))

### GST_CAPS_FLAGS

    #define GST_CAPS_FLAGS(caps)                    GST_MINI_OBJECT_FLAGS(caps)

Gets a flags word containing GstCapsFlags flags set on this caps.

Parameters:

`caps` –

a GstCaps.

### GST_CAPS_FLAG_IS_SET

    #define GST_CAPS_FLAG_IS_SET(caps,flag)        GST_MINI_OBJECT_FLAG_IS_SET (caps, flag)

Gives the status of a specific flag on a caps.

Parameters:

`caps` –

a GstCaps.

`flag` –

the GstCapsFlags to check.

### GST_CAPS_FLAG_SET

    #define GST_CAPS_FLAG_SET(caps,flag)           GST_MINI_OBJECT_FLAG_SET (caps, flag)

Sets a caps flag on a caps.

Parameters:

`caps` –

a GstCaps.

`flag` –

the GstCapsFlags to set.

### GST_CAPS_FLAG_UNSET

    #define GST_CAPS_FLAG_UNSET(caps,flag)         GST_MINI_OBJECT_FLAG_UNSET (caps, flag)

Clears a caps flag.

Parameters:

`caps` –

a GstCaps.

`flag` –

the GstCapsFlags to clear.

### GST_CAPS_IS_SIMPLE

    #define GST_CAPS_IS_SIMPLE(caps) (gst_caps_get_size(caps) == 1)

Checks if the number of structures in the given caps is exactly one.

Parameters:

`caps` –

the GstCaps instance to check

### GST_CAPS_REFCOUNT

    #define GST_CAPS_REFCOUNT(caps)                 GST_MINI_OBJECT_REFCOUNT(caps)

Gives access to the reference count field of the caps

Parameters:

`caps` –

a GstCaps

### GST_CAPS_REFCOUNT_VALUE

    #define GST_CAPS_REFCOUNT_VALUE(caps)           GST_MINI_OBJECT_REFCOUNT_VALUE(caps)

Gets the reference count value of the caps.

Parameters:

`caps` –

a GstCaps

### GST_STATIC_CAPS

    #define GST_STATIC_CAPS(string) \
    { \
      /* caps */ NULL, \
      /* string */ string, \
      GST_PADDING_INIT \
    }

Creates a new GstCaps static caps from an input string. This can be used in pad templates.

Parameters:

`string` –

the string describing the caps

## Enumerations

### GstCapsFlags

Extra flags for a caps.

##### Members

`GST_CAPS_FLAG_ANY` (16) –

Caps has no specific content, but can contain anything.

### Gst.CapsFlags

Extra flags for a caps.

##### Members

`Gst.CapsFlags.ANY` (16) –

Caps has no specific content, but can contain anything.

### Gst.CapsFlags

Extra flags for a caps.

##### Members

`Gst.CapsFlags.ANY` (16) –

Caps has no specific content, but can contain anything.

### GstCapsIntersectMode

Modes of caps intersection

GST_CAPS_INTERSECT_ZIG_ZAG tries to preserve overall order of both caps by iterating on the caps' structures as the following matrix shows:

             caps1
          +-------------
          | 1  2  4  7
    caps2 | 3  5  8 10
          | 6  9 11 12

Used when there is no explicit precedence of one caps over the other. e.g. tee's sink pad getcaps function, it will probe its src pad peers' for their caps and intersect them with this mode.

GST_CAPS_INTERSECT_FIRST is useful when an element wants to preserve another element's caps priority order when intersecting with its own caps. Example: If caps1 is `[A, B, C]` and caps2 is `[E, B, D, A]`, the result would be `[A, B]`, maintaining the first caps priority on the intersection.

##### Members

`GST_CAPS_INTERSECT_ZIG_ZAG` (0) –

Zig-zags over both caps.

`GST_CAPS_INTERSECT_FIRST` (1) –

Keeps the first caps order.

### Gst.CapsIntersectMode

Modes of caps intersection

Gst.CapsIntersectMode.ZIG_ZAG tries to preserve overall order of both caps by iterating on the caps' structures as the following matrix shows:

             caps1
          +-------------
          | 1  2  4  7
    caps2 | 3  5  8 10
          | 6  9 11 12

Used when there is no explicit precedence of one caps over the other. e.g. tee's sink pad getcaps function, it will probe its src pad peers' for their caps and intersect them with this mode.

Gst.CapsIntersectMode.FIRST is useful when an element wants to preserve another element's caps priority order when intersecting with its own caps. Example: If caps1 is `[A, B, C]` and caps2 is `[E, B, D, A]`, the result would be `[A, B]`, maintaining the first caps priority on the intersection.

##### Members

`Gst.CapsIntersectMode.ZIG_ZAG` (0) –

Zig-zags over both caps.

`Gst.CapsIntersectMode.FIRST` (1) –

Keeps the first caps order.

### Gst.CapsIntersectMode

Modes of caps intersection

Gst.CapsIntersectMode.ZIG_ZAG tries to preserve overall order of both caps by iterating on the caps' structures as the following matrix shows:

             caps1
          +-------------
          | 1  2  4  7
    caps2 | 3  5  8 10
          | 6  9 11 12

Used when there is no explicit precedence of one caps over the other. e.g. tee's sink pad getcaps function, it will probe its src pad peers' for their caps and intersect them with this mode.

Gst.CapsIntersectMode.FIRST is useful when an element wants to preserve another element's caps priority order when intersecting with its own caps. Example: If caps1 is `[A, B, C]` and caps2 is `[E, B, D, A]`, the result would be `[A, B]`, maintaining the first caps priority on the intersection.

##### Members

`Gst.CapsIntersectMode.ZIG_ZAG` (0) –

Zig-zags over both caps.

`Gst.CapsIntersectMode.FIRST` (1) –

Keeps the first caps order.

## Constants

### GST_CAPS_ANY

    #define GST_CAPS_ANY              _gst_caps_any

Means that the element/pad can output 'anything'. Useful for elements that output unknown media, such as filesrc. This macro returns a singleton and should not be unreffed.

### GST_CAPS_NONE

    #define GST_CAPS_NONE             _gst_caps_none

The opposite of GST_CAPS_ANY: it means that the pad/element outputs an undefined media type that can not be detected. This macro returns a singleton and should not be unreffed.

### GST_STATIC_CAPS_ANY

    #define GST_STATIC_CAPS_ANY       GST_STATIC_CAPS("ANY")

Creates a new GstCaps static caps that matches anything. This can be used in pad templates.

### GST_STATIC_CAPS_NONE

    #define GST_STATIC_CAPS_NONE      GST_STATIC_CAPS("NONE")

Creates a new GstCaps static caps that matches nothing. This can be used in pad templates.

## Callbacks

### GstCapsFilterMapFunc

    gboolean
    (*GstCapsFilterMapFunc) (GstCapsFeatures * features,
                             GstStructure * structure,
                             gpointer user_data)

A function that will be called in gst_caps_filter_and_map_in_place. The function may modify features and structure, and both will be removed from the caps if FALSE is returned.

Parameters:

`features` –

the GstCapsFeatures

`structure` –

the GstStructure

`user_data` –

user data

Returns –

TRUE if the features and structure should be preserved, FALSE if it should be removed.

### Gst.CapsFilterMapFunc

    function Gst.CapsFilterMapFunc(features: Gst.CapsFeatures, structure: Gst.Structure, user_data: Object): {
        // javascript wrapper for 'GstCapsFilterMapFunc'
    }

A function that will be called in Gst.Caps.prototype.filter_and_map_in_place. The function may modify features and structure, and both will be removed from the caps if false is returned.

Parameters:

`features` (Gst.CapsFeatures) –

the Gst.CapsFeatures

`structure` (Gst.Structure) –

the Gst.Structure

`user_data` (Object) –

user data

Returns (Number) –

true if the features and structure should be preserved, false if it should be removed.

### Gst.CapsFilterMapFunc

    def Gst.CapsFilterMapFunc (features, structure, *user_data):
        #python wrapper for 'GstCapsFilterMapFunc'

A function that will be called in Gst.Caps.filter_and_map_in_place. The function may modify features and structure, and both will be removed from the caps if False is returned.

Parameters:

`features` (Gst.CapsFeatures) –

the Gst.CapsFeatures

`structure` (Gst.Structure) –

the Gst.Structure

`user_data` (variadic) –

user data

Returns (bool) –

True if the features and structure should be preserved, False if it should be removed.

### GstCapsForeachFunc

    gboolean
    (*GstCapsForeachFunc) (GstCapsFeatures * features,
                           GstStructure * structure,
                           gpointer user_data)

A function that will be called in gst_caps_foreach. The function may not modify features or structure.

Parameters:

`features` –

the GstCapsFeatures

`structure` –

the GstStructure

`user_data` –

user data

Returns –

TRUE if the foreach operation should continue, FALSE if the foreach operation should stop with FALSE.

Since : 1.6

### Gst.CapsForeachFunc

    function Gst.CapsForeachFunc(features: Gst.CapsFeatures, structure: Gst.Structure, user_data: Object): {
        // javascript wrapper for 'GstCapsForeachFunc'
    }

A function that will be called in Gst.Caps.prototype.foreach. The function may not modify features or structure.

Parameters:

`features` (Gst.CapsFeatures) –

the Gst.CapsFeatures

`structure` (Gst.Structure) –

the Gst.Structure

`user_data` (Object) –

user data

Returns (Number) –

true if the foreach operation should continue, false if the foreach operation should stop with false.

Since : 1.6

### Gst.CapsForeachFunc

    def Gst.CapsForeachFunc (features, structure, *user_data):
        #python wrapper for 'GstCapsForeachFunc'

A function that will be called in Gst.Caps.foreach. The function may not modify features or structure.

Parameters:

`features` (Gst.CapsFeatures) –

the Gst.CapsFeatures

`structure` (Gst.Structure) –

the Gst.Structure

`user_data` (variadic) –

user data

Returns (bool) –

True if the foreach operation should continue, False if the foreach operation should stop with False.

Since : 1.6

### GstCapsMapFunc

    gboolean
    (*GstCapsMapFunc) (GstCapsFeatures * features,
                       GstStructure * structure,
                       gpointer user_data)

A function that will be called in gst_caps_map_in_place. The function may modify features and structure.

Parameters:

`features` –

the GstCapsFeatures

`structure` –

the GstStructure

`user_data` –

user data

Returns –

TRUE if the map operation should continue, FALSE if the map operation should stop with FALSE.

### Gst.CapsMapFunc

    function Gst.CapsMapFunc(features: Gst.CapsFeatures, structure: Gst.Structure, user_data: Object): {
        // javascript wrapper for 'GstCapsMapFunc'
    }

A function that will be called in Gst.Caps.prototype.map_in_place. The function may modify features and structure.

Parameters:

`features` (Gst.CapsFeatures) –

the Gst.CapsFeatures

`structure` (Gst.Structure) –

the Gst.Structure

`user_data` (Object) –

user data

Returns (Number) –

true if the map operation should continue, false if the map operation should stop with false.

### Gst.CapsMapFunc

    def Gst.CapsMapFunc (features, structure, *user_data):
        #python wrapper for 'GstCapsMapFunc'

A function that will be called in Gst.Caps.map_in_place. The function may modify features and structure.

Parameters:

`features` (Gst.CapsFeatures) –

the Gst.CapsFeatures

`structure` (Gst.Structure) –

the Gst.Structure

`user_data` (variadic) –

user data

Returns (bool) –

True if the map operation should continue, False if the map operation should stop with False.

The results of the search are