Class CapsFeatures
- All Implemented Interfaces:
Proxy
GstCapsFeatures can optionally be set on a GstCaps to add requirements
for additional features for a specific GstStructure. 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 GstCapsFeatures are equivalent with the GstCapsFeatures that only
contain GST_CAPS_FEATURE_MEMORY_SYSTEM_MEMORY. ANY GstCapsFeatures as
created by gst_caps_features_new_any() are equal to any other GstCapsFeatures
and can be used to specify that any GstCapsFeatures would be supported, e.g.
for elements that don't touch buffer memory. GstCaps with ANY GstCapsFeatures
are considered non-fixed and during negotiation some GstCapsFeatures have
to be selected.
Examples for caps features would be the requirement of a specific GstMemory
types or the requirement of having a specific GstMeta on the buffer. Features
are given as a string of the format memory:GstMemoryTypeName or
meta:GstMetaAPIName.
- Since:
- 1.2
-
Constructor Summary
ConstructorsConstructorDescriptionCapsFeatures(MemorySegment address) Create a CapsFeatures proxy instance for the provided memory address.CapsFeatures(String feature1, Object... varargs) Creates a newGstCapsFeatureswith the given features. -
Method Summary
Modifier and TypeMethodDescriptionvoidAddsfeaturetofeatures.voidDeprecated.Use gst_caps_features_add_id_str().voidAddsfeaturetofeatures.voidaddStaticStr(String feature) Addsfeaturetofeatures.static CapsFeaturesany()Creates a new, ANYGstCapsFeatures.booleanChecks if this CapsFeatures containsfeature.booleancontainsId(Quark feature) Deprecated.Use gst_caps_features_contains_id_str().booleancontainsIdStr(IdStr feature) Checks if this CapsFeatures containsfeature.copy()Duplicates aGstCapsFeaturesand all its values.static CapsFeaturesempty()Creates a new, emptyGstCapsFeatures.voidfree()Frees aGstCapsFeaturesand all its values.static @Nullable CapsFeaturesfromString(String features) Creates aGstCapsFeaturesfrom a string representation.@Nullable StringgetNth(int i) Returns theiThfeature offeatures.getNthId(int i) Deprecated.Use gst_caps_features_get_nth_id_str().getNthIdStr(int i) Returns theiThfeature offeatures.intgetSize()Returns the number of features infeatures.static @Nullable TypegetType()Get the GType of the CapsFeatures classstatic CapsFeaturesDeprecated.Use gst_caps_features_new_id_str().static CapsFeaturesCreates a newGstCapsFeatureswith the given features.booleanisAny()Checks if this CapsFeatures isGST_CAPS_FEATURES_ANY.booleanisEqual(CapsFeatures features2) Checks if this CapsFeatures andfeatures2are equal.voidRemovesfeaturefromfeatures.voidDeprecated.Use gst_caps_features_remove_id_str().voidremoveIdStr(IdStr feature) Removesfeaturefromfeatures.booleansetParentRefcount(MemorySegment refcount) Sets the parent_refcount field ofGstCapsFeatures.static CapsFeaturesCreates a newGstCapsFeatureswith a single feature.static CapsFeaturessingleStaticStr(String feature) Creates a newGstCapsFeatureswith a single feature.static CapsFeaturesCreates a newGstCapsFeatureswith the given features.toString()Converts this CapsFeatures to a human-readable string representation.Methods inherited from class org.javagi.base.ProxyInstance
equals, handle, hashCode
-
Constructor Details
-
CapsFeatures
Create a CapsFeatures proxy instance for the provided memory address.- Parameters:
address- the memory address of the native object
-
CapsFeatures
-
-
Method Details
-
getType
-
any
Creates a new, ANYGstCapsFeatures. This will be equal to any otherGstCapsFeaturesbut caps with these are unfixed.- Returns:
- a new, ANY
GstCapsFeatures - Since:
- 1.2
-
empty
Creates a new, emptyGstCapsFeatures.- Returns:
- a new, empty
GstCapsFeatures - Since:
- 1.2
-
id
Deprecated.Use gst_caps_features_new_id_str().Creates a newGstCapsFeatureswith the given features. The last argument must be 0.- Parameters:
feature1- name of first feature to setvarargs- additional features- Returns:
- a new, empty
GstCapsFeatures - Since:
- 1.2
-
idStr
Creates a newGstCapsFeatureswith the given features. The last argument must be 0.- Parameters:
feature1- name of first feature to setvarargs- additional features- Returns:
- a new, empty
GstCapsFeatures - Since:
- 1.26
-
single
Creates a newGstCapsFeatureswith a single feature.- Parameters:
feature- The feature- Returns:
- a new
GstCapsFeatures - Since:
- 1.20
-
singleStaticStr
Creates a newGstCapsFeatureswith a single feature.featureneeds to be valid for the remaining lifetime of the process, e.g. has to be a static string.- Parameters:
feature- The feature- Returns:
- a new
GstCapsFeatures - Since:
- 1.26
-
staticStr
Creates a newGstCapsFeatureswith the given features. The last argument must benull.feature1and all other features need to be valid for the remaining lifetime of the process, e.g. have to be a static string.- Parameters:
feature1- name of first feature to setvarargs- additional features- Returns:
- a new, empty
GstCapsFeatures - Since:
- 1.26
-
fromString
Creates aGstCapsFeaturesfrom a string representation.- Parameters:
features- a string representation of aGstCapsFeatures.- Returns:
- a new
GstCapsFeaturesornullwhen the string could not be parsed. - Since:
- 1.2
-
add
Addsfeaturetofeatures.- Parameters:
feature- a feature.- Since:
- 1.2
-
addId
Deprecated.Use gst_caps_features_add_id_str().Addsfeaturetofeatures.- Parameters:
feature- a feature.- Since:
- 1.2
-
addIdStr
Addsfeaturetofeatures.- Parameters:
feature- a feature.- Since:
- 1.26
-
addStaticStr
Addsfeaturetofeatures.featureneeds to be valid for the remaining lifetime of the process, e.g. has to be a static string.- Parameters:
feature- a feature.- Since:
- 1.26
-
contains
Checks if this CapsFeatures containsfeature.- Parameters:
feature- a feature- Returns:
trueif this CapsFeatures containsfeature.- Since:
- 1.2
-
containsId
Deprecated.Use gst_caps_features_contains_id_str().Checks if this CapsFeatures containsfeature.- Parameters:
feature- a feature- Returns:
trueif this CapsFeatures containsfeature.- Since:
- 1.2
-
containsIdStr
Checks if this CapsFeatures containsfeature.- Parameters:
feature- a feature- Returns:
trueif this CapsFeatures containsfeature.- Since:
- 1.26
-
copy
Duplicates aGstCapsFeaturesand all its values.- Returns:
- a new
GstCapsFeatures. - Since:
- 1.2
-
free
public void free()Frees aGstCapsFeaturesand all its values. The caps features must not have a parent when this function is called.- Since:
- 1.2
-
getNth
Returns theiThfeature offeatures.- Parameters:
i- index of the feature- Returns:
- The
iThfeature offeatures. - Since:
- 1.2
-
getNthId
Deprecated.Use gst_caps_features_get_nth_id_str().Returns theiThfeature offeatures.- Parameters:
i- index of the feature- Returns:
- The
iThfeature offeatures. - Since:
- 1.2
-
getNthIdStr
Returns theiThfeature offeatures.- Parameters:
i- index of the feature- Returns:
- The
iThfeature offeatures. - Since:
- 1.26
-
getSize
public int getSize()Returns the number of features infeatures.- Returns:
- The number of features in
features. - Since:
- 1.2
-
isAny
public boolean isAny()Checks if this CapsFeatures isGST_CAPS_FEATURES_ANY.- Returns:
trueif this CapsFeatures isGST_CAPS_FEATURES_ANY.- Since:
- 1.2
-
isEqual
Checks if this CapsFeatures andfeatures2are equal.- Parameters:
features2- aGstCapsFeatures.- Returns:
trueif this CapsFeatures andfeatures2are equal.- Since:
- 1.2
-
remove
Removesfeaturefromfeatures.- Parameters:
feature- a feature.- Since:
- 1.2
-
removeId
Deprecated.Use gst_caps_features_remove_id_str().Removesfeaturefromfeatures.- Parameters:
feature- a feature.- Since:
- 1.2
-
removeIdStr
Removesfeaturefromfeatures.- Parameters:
feature- a feature.- Since:
- 1.26
-
setParentRefcount
Sets the parent_refcount field ofGstCapsFeatures. 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 ofGstCapsFeatures, as described in the MT refcounting design document.- Parameters:
refcount- a pointer to the parent's refcount- Returns:
trueif the parent refcount could be set.- Since:
- 1.2
-
toString
Converts this CapsFeatures to a human-readable string representation.For debugging purposes its easier to do something like this:
GST_LOG ("features is %" GST_PTR_FORMAT, features);This prints the features in human readable form.
-