CapsFeatures#
Added in version 1.2.
- class CapsFeatures(*args, **kwargs)#
CapsFeatures can optionally be set on a Caps to add requirements
for additional features for a specific 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 CapsFeatures are equivalent with the CapsFeatures that only
contain GST_CAPS_FEATURE_MEMORY_SYSTEM_MEMORY. ANY CapsFeatures as
created by new_any() are equal to any other CapsFeatures
and can be used to specify that any CapsFeatures would be supported, e.g.
for elements that don’t touch buffer memory. Caps with ANY CapsFeatures
are considered non-fixed and during negotiation some CapsFeatures have
to be selected.
Examples for caps features would be the requirement of a specific Memory
types or the requirement of having a specific Meta on the buffer. Features
are given as a string of the format memory:GstMemoryTypeName or
meta:GstMetaAPIName.
Constructors#
- class CapsFeatures
- classmethod new_any() CapsFeatures#
Creates a new, ANY
CapsFeatures. This will be equal to any otherCapsFeaturesbut caps with these are unfixed.Added in version 1.2.
- classmethod new_empty() CapsFeatures#
Creates a new, empty
CapsFeatures.Added in version 1.2.
- classmethod new_single(feature: str) CapsFeatures#
Creates a new
CapsFeatureswith a single feature.Added in version 1.20.
- Parameters:
feature – The feature
- classmethod new_single_static_str(feature: str) CapsFeatures#
Creates a new
CapsFeatureswith a single feature.featureneeds to be valid for the remaining lifetime of the process, e.g. has to be a static string.Added in version 1.26.
- Parameters:
feature – The feature
Methods#
- class CapsFeatures
- add(feature: str) None#
Adds
featuretofeatures.Added in version 1.2.
- Parameters:
feature – a feature.
- add_id(feature: int) None#
Adds
featuretofeatures.Added in version 1.2.
Deprecated since version 1.26: Use
add_id_str().- Parameters:
feature – a feature.
- add_id_str(feature: IdStr) None#
Adds
featuretofeatures.Added in version 1.26.
- Parameters:
feature – a feature.
- add_static_str(feature: str) None#
Adds
featuretofeatures.featureneeds to be valid for the remaining lifetime of the process, e.g. has to be a static string.Added in version 1.26.
- Parameters:
feature – a feature.
- contains(feature: str) bool#
Checks if
featurescontainsfeature.Added in version 1.2.
- Parameters:
feature – a feature
- contains_id(feature: int) bool#
Checks if
featurescontainsfeature.Added in version 1.2.
Deprecated since version 1.26: Use
contains_id_str().- Parameters:
feature – a feature
- contains_id_str(feature: IdStr) bool#
Checks if
featurescontainsfeature.Added in version 1.26.
- Parameters:
feature – a feature
- free() None#
Frees a
CapsFeaturesand all its values. The caps features must not have a parent when this function is called.Added in version 1.2.
- classmethod from_string(features: str) CapsFeatures | None#
Creates a
CapsFeaturesfrom a string representation.Added in version 1.2.
- Parameters:
features – a string representation of a
CapsFeatures.
- get_nth(i: int) str | None#
Returns the
i-th feature offeatures.Added in version 1.2.
- Parameters:
i – index of the feature
- get_nth_id(i: int) int#
Returns the
i-th feature offeatures.Added in version 1.2.
Deprecated since version 1.26: Use
get_nth_id_str().- Parameters:
i – index of the feature
- get_nth_id_str(i: int) IdStr#
Returns the
i-th feature offeatures.Added in version 1.26.
- Parameters:
i – index of the feature
- is_equal(features2: CapsFeatures) bool#
Checks if
features1andfeatures2are equal.Added in version 1.2.
- Parameters:
features2 – a
CapsFeatures.
- remove(feature: str) None#
Removes
featurefromfeatures.Added in version 1.2.
- Parameters:
feature – a feature.
- remove_id(feature: int) None#
Removes
featurefromfeatures.Added in version 1.2.
Deprecated since version 1.26: Use
remove_id_str().- Parameters:
feature – a feature.