Class CapsFeatures

java.lang.Object
org.javagi.base.ProxyInstance
org.freedesktop.gstreamer.gst.CapsFeatures
All Implemented Interfaces:
Proxy

@Generated("org.javagi.JavaGI") public class CapsFeatures extends ProxyInstance

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 Details

    • CapsFeatures

      public CapsFeatures(MemorySegment address)
      Create a CapsFeatures proxy instance for the provided memory address.
      Parameters:
      address - the memory address of the native object
    • CapsFeatures

      public CapsFeatures(String feature1, Object... varargs)
      Creates a new GstCapsFeatures with the given features. The last argument must be null.
      Parameters:
      feature1 - name of first feature to set
      varargs - additional features
      Since:
      1.2
  • Method Details

    • getType

      public static @Nullable Type getType()
      Get the GType of the CapsFeatures class.
      Returns:
      the GType
    • getMemoryLayout

      public static MemoryLayout getMemoryLayout()
      The memory layout of the native struct.
      Returns:
      the memory layout
    • any

      public static CapsFeatures any()
      Creates a new, ANY GstCapsFeatures. This will be equal to any other GstCapsFeatures but caps with these are unfixed.
      Returns:
      a new, ANY GstCapsFeatures
      Since:
      1.2
    • empty

      public static CapsFeatures empty()
      Creates a new, empty GstCapsFeatures.
      Returns:
      a new, empty GstCapsFeatures
      Since:
      1.2
    • id

      @Deprecated public static CapsFeatures id(Quark feature1, Object... varargs)
      Deprecated.
      Use gst_caps_features_new_id_str().
      Creates a new GstCapsFeatures with the given features. The last argument must be 0.
      Parameters:
      feature1 - name of first feature to set
      varargs - additional features
      Returns:
      a new, empty GstCapsFeatures
      Since:
      1.2
    • idStr

      public static CapsFeatures idStr(IdStr feature1, Object... varargs)
      Creates a new GstCapsFeatures with the given features. The last argument must be 0.
      Parameters:
      feature1 - name of first feature to set
      varargs - additional features
      Returns:
      a new, empty GstCapsFeatures
      Since:
      1.26
    • single

      public static CapsFeatures single(String feature)
      Creates a new GstCapsFeatures with a single feature.
      Parameters:
      feature - The feature
      Returns:
      a new GstCapsFeatures
      Since:
      1.20
    • singleStaticStr

      public static CapsFeatures singleStaticStr(String feature)

      Creates a new GstCapsFeatures with a single feature.

      feature needs 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

      public static CapsFeatures staticStr(String feature1, Object... varargs)

      Creates a new GstCapsFeatures with the given features. The last argument must be null.

      feature1 and 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 set
      varargs - additional features
      Returns:
      a new, empty GstCapsFeatures
      Since:
      1.26
    • fromString

      public static @Nullable CapsFeatures fromString(String features)
      Creates a GstCapsFeatures from a string representation.
      Parameters:
      features - a string representation of a GstCapsFeatures.
      Returns:
      a new GstCapsFeatures or null when the string could not be parsed.
      Since:
      1.2
    • add

      public void add(String feature)
      Adds feature to features.
      Parameters:
      feature - a feature.
      Since:
      1.2
    • addId

      @Deprecated public void addId(Quark feature)
      Deprecated.
      Use gst_caps_features_add_id_str().
      Adds feature to features.
      Parameters:
      feature - a feature.
      Since:
      1.2
    • addIdStr

      public void addIdStr(IdStr feature)
      Adds feature to features.
      Parameters:
      feature - a feature.
      Since:
      1.26
    • addStaticStr

      public void addStaticStr(String feature)

      Adds feature to features.

      feature needs 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

      public boolean contains(String feature)
      Checks if this CapsFeatures contains feature.
      Parameters:
      feature - a feature
      Returns:
      true if this CapsFeatures contains feature.
      Since:
      1.2
    • containsId

      @Deprecated public boolean containsId(Quark feature)
      Deprecated.
      Use gst_caps_features_contains_id_str().
      Checks if this CapsFeatures contains feature.
      Parameters:
      feature - a feature
      Returns:
      true if this CapsFeatures contains feature.
      Since:
      1.2
    • containsIdStr

      public boolean containsIdStr(IdStr feature)
      Checks if this CapsFeatures contains feature.
      Parameters:
      feature - a feature
      Returns:
      true if this CapsFeatures contains feature.
      Since:
      1.26
    • copy

      public CapsFeatures copy()
      Duplicates a GstCapsFeatures and all its values.
      Returns:
      a new GstCapsFeatures.
      Since:
      1.2
    • free

      public void free()
      Frees a GstCapsFeatures and all its values. The caps features must not have a parent when this function is called.
      Since:
      1.2
    • getNth

      public @Nullable String getNth(int i)
      Returns the iTh feature of features.
      Parameters:
      i - index of the feature
      Returns:
      The iTh feature of features.
      Since:
      1.2
    • getNthId

      @Deprecated public Quark getNthId(int i)
      Deprecated.
      Use gst_caps_features_get_nth_id_str().
      Returns the iTh feature of features.
      Parameters:
      i - index of the feature
      Returns:
      The iTh feature of features.
      Since:
      1.2
    • getNthIdStr

      public IdStr getNthIdStr(int i)
      Returns the iTh feature of features.
      Parameters:
      i - index of the feature
      Returns:
      The iTh feature of features.
      Since:
      1.26
    • getSize

      public int getSize()
      Returns the number of features in features.
      Returns:
      The number of features in features.
      Since:
      1.2
    • isAny

      public boolean isAny()
      Checks if this CapsFeatures is GST_CAPS_FEATURES_ANY.
      Returns:
      true if this CapsFeatures is GST_CAPS_FEATURES_ANY.
      Since:
      1.2
    • isEqual

      public boolean isEqual(CapsFeatures features2)
      Checks if this CapsFeatures and features2 are equal.
      Parameters:
      features2 - a GstCapsFeatures.
      Returns:
      true if this CapsFeatures and features2 are equal.
      Since:
      1.2
    • remove

      public void remove(String feature)
      Removes feature from features.
      Parameters:
      feature - a feature.
      Since:
      1.2
    • removeId

      @Deprecated public void removeId(Quark feature)
      Deprecated.
      Use gst_caps_features_remove_id_str().
      Removes feature from features.
      Parameters:
      feature - a feature.
      Since:
      1.2
    • removeIdStr

      public void removeIdStr(IdStr feature)
      Removes feature from features.
      Parameters:
      feature - a feature.
      Since:
      1.26
    • setParentRefcount

      public boolean setParentRefcount(MemorySegment refcount)
      Sets the parent_refcount field of GstCapsFeatures. 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 GstCapsFeatures, 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.
      Since:
      1.2
    • toString

      public String 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.

      Overrides:
      toString in class Object
      Returns:
      a pointer to string allocated by g_malloc().
      Since:
      1.2