Gst.CapsFeatures

Fields

None

Methods

class

from_string (features)

class

new_any ()

class

new_empty ()

class

new_single (feature)

add (feature)

add_id (feature)

contains (feature)

contains_id (feature)

copy ()

free ()

get_nth (i)

get_nth_id (i)

get_size ()

is_any ()

is_equal (features2)

remove (feature)

remove_id (feature)

set_parent_refcount (refcount)

to_string ()

Details

class Gst.CapsFeatures

Gst.CapsFeatures can optionally be set on a Gst.Caps to add requirements for additional features for a specific Gst.Structure. Caps structures with the same name but with a non-equal set of caps features are not compatible. If a pad supports multiple sets of features it has to add multiple equal structures with different feature sets to the caps.

Empty Gst.CapsFeatures are equivalent with the Gst.CapsFeatures that only contain Gst.CAPS_FEATURE_MEMORY_SYSTEM_MEMORY. ANY Gst.CapsFeatures as created by Gst.CapsFeatures.new_any() are equal to any other Gst.CapsFeatures and can be used to specify that any Gst.CapsFeatures would be supported, e.g. for elements that don’t touch buffer memory. Gst.Caps with ANY Gst.CapsFeatures are considered non-fixed and during negotiation some Gst.CapsFeatures have to be selected.

Examples for caps features would be the requirement of a specific Gst.Memory types or the requirement of having a specific Gst.Meta on the buffer. Features are given as a string of the format memory:GstMemoryTypeName or meta:GstMetaAPIName.

New in version 1.2.

classmethod from_string(features)[source]
Parameters:

features (str) – a string representation of a Gst.CapsFeatures.

Returns:

a new Gst.CapsFeatures or None when the string could not be parsed.

Return type:

Gst.CapsFeatures or None

Creates a Gst.CapsFeatures from a string representation.

New in version 1.2.

classmethod new_any()[source]
Returns:

a new, ANY Gst.CapsFeatures

Return type:

Gst.CapsFeatures

Creates a new, ANY Gst.CapsFeatures. This will be equal to any other Gst.CapsFeatures but caps with these are unfixed.

New in version 1.2.

classmethod new_empty()[source]
Returns:

a new, empty Gst.CapsFeatures

Return type:

Gst.CapsFeatures

Creates a new, empty Gst.CapsFeatures.

New in version 1.2.

classmethod new_single(feature)[source]
Parameters:

feature (str) – The feature

Returns:

a new Gst.CapsFeatures

Return type:

Gst.CapsFeatures

Creates a new Gst.CapsFeatures with a single feature.

New in version 1.20.

add(feature)[source]
Parameters:

feature (str) – a feature.

Adds feature to self.

New in version 1.2.

add_id(feature)[source]
Parameters:

feature (int) – a feature.

Adds feature to self.

New in version 1.2.

contains(feature)[source]
Parameters:

feature (str) – a feature

Returns:

True if self contains feature.

Return type:

bool

Checks if self contains feature.

New in version 1.2.

contains_id(feature)[source]
Parameters:

feature (int) – a feature

Returns:

True if self contains feature.

Return type:

bool

Checks if self contains feature.

New in version 1.2.

copy()[source]
Returns:

a new Gst.CapsFeatures.

Return type:

Gst.CapsFeatures

Duplicates a Gst.CapsFeatures and all its values.

New in version 1.2.

free()[source]

Frees a Gst.CapsFeatures and all its values. The caps features must not have a parent when this function is called.

New in version 1.2.

get_nth(i)[source]
Parameters:

i (int) – index of the feature

Returns:

The i-th feature of self.

Return type:

str or None

Returns the i-th feature of self.

New in version 1.2.

get_nth_id(i)[source]
Parameters:

i (int) – index of the feature

Returns:

The i-th feature of self.

Return type:

int

Returns the i-th feature of self.

New in version 1.2.

get_size()[source]
Returns:

The number of features in self.

Return type:

int

Returns the number of features in self.

New in version 1.2.

is_any()[source]
Returns:

True if self is %GST_CAPS_FEATURES_ANY.

Return type:

bool

Checks if self is %GST_CAPS_FEATURES_ANY.

New in version 1.2.

is_equal(features2)[source]
Parameters:

features2 (Gst.CapsFeatures) – a Gst.CapsFeatures.

Returns:

True if self and features2 are equal.

Return type:

bool

Checks if self and features2 are equal.

New in version 1.2.

remove(feature)[source]
Parameters:

feature (str) – a feature.

Removes feature from self.

New in version 1.2.

remove_id(feature)[source]
Parameters:

feature (int) – a feature.

Removes feature from self.

New in version 1.2.

set_parent_refcount(refcount)[source]
Parameters:

refcount (int) – a pointer to the parent’s refcount

Returns:

True if the parent refcount could be set.

Return type:

bool

Sets the parent_refcount field of Gst.CapsFeatures. This field is used to determine whether a caps features is mutable or not. This function should only be called by code implementing parent objects of Gst.CapsFeatures, as described in the MT refcounting design document.

New in version 1.2.

to_string()[source]
Returns:

a pointer to string allocated by GLib.malloc().

Return type:

str

Converts self to a human-readable string representation.

For debugging purposes its easier to do something like this:

`` C GST_LOG (“features is %” GST_PTR_FORMAT, features); ``

This prints the features in human readable form.

New in version 1.2.