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
.
-
Constructor Summary
ConstructorDescriptionCapsFeatures
(MemorySegment address) Create a CapsFeatures proxy instance for the provided memory address.CapsFeatures
(String feature1, Object... varargs) Creates a newGstCapsFeatures
with the given features. -
Method Summary
Modifier and TypeMethodDescriptionvoid
Addsfeature
to this CapsFeatures.void
Addsfeature
to this CapsFeatures.static CapsFeatures
any()
Creates a new, ANYGstCapsFeatures
.boolean
Checks if this CapsFeatures containsfeature
.boolean
containsId
(Quark feature) Checks if this CapsFeatures containsfeature
.copy()
Duplicates aGstCapsFeatures
and all its values.static CapsFeatures
empty()
Creates a new, emptyGstCapsFeatures
.void
free()
Frees aGstCapsFeatures
and all its values.static CapsFeatures
fromString
(String features) Creates aGstCapsFeatures
from a string representation.getNth
(int i) Returns thei
-th feature of this CapsFeatures.getNthId
(int i) Returns thei
-th feature of this CapsFeatures.int
getSize()
Returns the number of features in this CapsFeatures.static Type
getType()
Get the GType of the CapsFeatures classstatic CapsFeatures
Creates a newGstCapsFeatures
with the given features.boolean
isAny()
Checks if this CapsFeatures isGST_CAPS_FEATURES_ANY
.boolean
isEqual
(CapsFeatures features2) Checks if this CapsFeatures andfeatures2
are equal.void
Removesfeature
from this CapsFeatures.void
Removesfeature
from this CapsFeatures.boolean
setParentRefcount
(MemorySegment refcount) Sets the parent_refcount field ofGstCapsFeatures
.static CapsFeatures
Creates a newGstCapsFeatures
with a single feature.toString()
Converts this CapsFeatures to a human-readable string representation.Methods inherited from class io.github.jwharm.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 otherGstCapsFeatures
but caps with these are unfixed.- Returns:
- a new, ANY
GstCapsFeatures
-
empty
Creates a new, emptyGstCapsFeatures
.- Returns:
- a new, empty
GstCapsFeatures
-
id
Creates a newGstCapsFeatures
with the given features. The last argument must be 0.- Parameters:
feature1
- name of first feature to setvarargs
- additional features- Returns:
- a new, empty
GstCapsFeatures
-
single
Creates a newGstCapsFeatures
with a single feature.- Parameters:
feature
- The feature- Returns:
- a new
GstCapsFeatures
-
fromString
Creates aGstCapsFeatures
from a string representation.- Parameters:
features
- a string representation of aGstCapsFeatures
.- Returns:
- a new
GstCapsFeatures
ornull
when the string could not be parsed.
-
add
-
addId
Addsfeature
to this CapsFeatures.- Parameters:
feature
- a feature.
-
contains
Checks if this CapsFeatures containsfeature
.- Parameters:
feature
- a feature- Returns:
true
if this CapsFeatures containsfeature
.
-
containsId
Checks if this CapsFeatures containsfeature
.- Parameters:
feature
- a feature- Returns:
true
if this CapsFeatures containsfeature
.
-
copy
Duplicates aGstCapsFeatures
and all its values.- Returns:
- a new
GstCapsFeatures
.
-
free
public void free()Frees aGstCapsFeatures
and all its values. The caps features must not have a parent when this function is called. -
getNth
Returns thei
-th feature of this CapsFeatures.- Parameters:
i
- index of the feature- Returns:
- The
i
-th feature of this CapsFeatures.
-
getNthId
Returns thei
-th feature of this CapsFeatures.- Parameters:
i
- index of the feature- Returns:
- The
i
-th feature of this CapsFeatures.
-
getSize
public int getSize()Returns the number of features in this CapsFeatures.- Returns:
- The number of features in this CapsFeatures.
-
isAny
public boolean isAny()Checks if this CapsFeatures isGST_CAPS_FEATURES_ANY
.- Returns:
true
if this CapsFeatures isGST_CAPS_FEATURES_ANY
.
-
isEqual
Checks if this CapsFeatures andfeatures2
are equal.- Parameters:
features2
- aGstCapsFeatures
.- Returns:
true
if this CapsFeatures andfeatures2
are equal.
-
remove
Removesfeature
from this CapsFeatures.- Parameters:
feature
- a feature.
-
removeId
Removesfeature
from this CapsFeatures.- Parameters:
feature
- a feature.
-
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:
true
if the parent refcount could be set.
-
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.
-