Class TagList

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

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

List of tags and values used to describe media metadata.

Strings in structures must be ASCII or UTF-8 encoded. Other encodings are not allowed. Strings must not be empty or null.

  • Constructor Summary

    Constructors
    Constructor
    Description
    Create a TagList proxy instance for the provided memory address.
    TagList(String tag, Object... varargs)
    Creates a new taglist and appends the values for the given tags.
  • Method Summary

    Modifier and Type
    Method
    Description
    void
    add(TagMergeMode mode, String tag, Object... varargs)
    Sets the values for the given tags using the specified mode.
    void
    addValue(TagMergeMode mode, String tag, Value value)
    Sets the GValue for a given tag using the specified mode.
    void
    addValues(TagMergeMode mode, String tag, Object... varargs)
    Sets the GValues for the given tags using the specified mode.
    Creates a new GstTagList as a copy of the old taglist. The new taglist will have a refcount of 1, owned by the caller, and will be writable as a result.
    static boolean
    copyValue(Value dest, TagList list, String tag)
    Copies the contents for the given tag into the value, merging multiple values into one if multiple values are associated with the tag.
    static TagList
    Creates a new empty GstTagList.
    void
    foreach(@Nullable TagForeachFunc func)
    Calls the given function for each tag inside the tag list.
    static @Nullable TagList
    Deserializes a tag list.
    boolean
    getBoolean(String tag, Out<Boolean> value)
    Copies the contents for the given tag into the value, merging multiple values into one if multiple values are associated with the tag.
    boolean
    getBooleanIndex(String tag, int index, Out<Boolean> value)
    Gets the value that is at the given index for the given tag in the given list.
    boolean
    getDate(String tag, Out<Date> value)
    Copies the first date for the given tag in the taglist into the variable pointed to by value. Free the date with g_date_free() when it is no longer needed.
    boolean
    getDateIndex(String tag, int index, Out<Date> value)
    Gets the date that is at the given index for the given tag in the given list and copies it into the variable pointed to by value. Free the date with g_date_free() when it is no longer needed.
    boolean
    Copies the first datetime for the given tag in the taglist into the variable pointed to by value. Unref the date with gst_date_time_unref() when it is no longer needed.
    boolean
    getDateTimeIndex(String tag, int index, Out<DateTime> value)
    Gets the datetime that is at the given index for the given tag in the given list and copies it into the variable pointed to by value. Unref the datetime with gst_date_time_unref() when it is no longer needed.
    boolean
    getDouble(String tag, Out<Double> value)
    Copies the contents for the given tag into the value, merging multiple values into one if multiple values are associated with the tag.
    boolean
    getDoubleIndex(String tag, int index, Out<Double> value)
    Gets the value that is at the given index for the given tag in the given list.
    boolean
    getFloat(String tag, Out<Float> value)
    Copies the contents for the given tag into the value, merging multiple values into one if multiple values are associated with the tag.
    boolean
    getFloatIndex(String tag, int index, Out<Float> value)
    Gets the value that is at the given index for the given tag in the given list.
    boolean
    getInt(String tag, Out<Integer> value)
    Copies the contents for the given tag into the value, merging multiple values into one if multiple values are associated with the tag.
    boolean
    getInt64(String tag, Out<Long> value)
    Copies the contents for the given tag into the value, merging multiple values into one if multiple values are associated with the tag.
    boolean
    getInt64Index(String tag, int index, Out<Long> value)
    Gets the value that is at the given index for the given tag in the given list.
    boolean
    getIntIndex(String tag, int index, Out<Integer> value)
    Gets the value that is at the given index for the given tag in the given list.
    The memory layout of the native struct.
    boolean
    getPointer(String tag, @Nullable Out<MemorySegment> value)
    Copies the contents for the given tag into the value, merging multiple values into one if multiple values are associated with the tag.
    boolean
    getPointerIndex(String tag, int index, @Nullable Out<MemorySegment> value)
    Gets the value that is at the given index for the given tag in the given list.
    boolean
    getSample(String tag, Out<Sample> sample)
    Copies the first sample for the given tag in the taglist into the variable pointed to by sample. Free the sample with gst_sample_unref() when it is no longer needed.
    boolean
    getSampleIndex(String tag, int index, Out<Sample> sample)
    Gets the sample that is at the given index for the given tag in the given list and copies it into the variable pointed to by sample. Free the sample with gst_sample_unref() when it is no longer needed.
    Gets the scope of list.
    boolean
    getString(String tag, Out<String> value)
    Copies the contents for the given tag into the value, possibly merging multiple values into one if multiple values are associated with the tag.
    boolean
    getStringIndex(String tag, int index, Out<String> value)
    Gets the value that is at the given index for the given tag in the given list.
    int
    Checks how many value are stored in this tag list for the given tag.
    static @Nullable Type
    Get the GType of the TagList class.
    boolean
    getUint(String tag, Out<Integer> value)
    Copies the contents for the given tag into the value, merging multiple values into one if multiple values are associated with the tag.
    boolean
    getUint64(String tag, Out<Long> value)
    Copies the contents for the given tag into the value, merging multiple values into one if multiple values are associated with the tag.
    boolean
    getUint64Index(String tag, int index, Out<Long> value)
    Gets the value that is at the given index for the given tag in the given list.
    boolean
    getUintIndex(String tag, int index, Out<Integer> value)
    Gets the value that is at the given index for the given tag in the given list.
    @Nullable Value
    getValueIndex(String tag, int index)
    Gets the value that is at the given index for the given tag in the given list.
    void
    Inserts the tags of the from list into the first list using the given mode.
    boolean
    Checks if the given taglist is empty.
    boolean
    Checks if the two given taglists are equal.
    @Nullable TagList
    merge(@Nullable TagList list2, TagMergeMode mode)
    Merges the two given lists into a new list.
    int
    Get the number of tags in list.
    nthTagName(int index)
    Get the name of the tag in this TagList at index.
    boolean
    peekStringIndex(String tag, int index, Out<String> value)
    Peeks at the value that is at the given index for the given tag in the given list.
    @Nullable MiniObject
    Read the value of the field mini_object.
    ref()
    Add a reference to a GstTagList mini object.
    void
    Removes the given tag from the taglist.
    static boolean
    replace(@Nullable Out<TagList> oldTaglist, @Nullable TagList newTaglist)
    Modifies a pointer to a GstTagList to point to a different GstTagList.
    void
    Sets the scope of this TagList to scope. By default the scope of a taglist is stream scope.
    static boolean
    take(Out<TagList> oldTaglist, @Nullable TagList newTaglist)
    Modifies a pointer to a GstTagList to point to a different GstTagList.
    Serializes a tag list to a string.
    void
    Unref a GstTagList, and and free all its memory when the refcount reaches 0.
    void
    writeMiniObject(@Nullable MiniObject miniObject)
    Write a value in the field mini_object.

    Methods inherited from class ProxyInstance

    equals, handle, hashCode

    Methods inherited from class Object

    clone, finalize, getClass, notify, notifyAll, wait, wait, wait
  • Constructor Details

    • TagList

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

      public TagList(String tag, Object... varargs)

      Creates a new taglist and appends the values for the given tags. It expects tag-value pairs like gst_tag_list_add(), and a null terminator after the last pair. The type of the values is implicit and is documented in the API reference, but can also be queried at runtime with gst_tag_get_type(). It is an error to pass a value of a type not matching the tag type into this function. The tag list will make copies of any arguments passed (e.g. strings, buffers).

      After creation you might also want to set a GstTagScope on the returned taglist to signal if the contained tags are global or stream tags. By default stream scope is assumes. See gst_tag_list_set_scope().

      Free-function: gst_tag_list_unref

      Parameters:
      tag - tag
      varargs - null-terminated list of values to set
  • Method Details

    • getType

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

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

      public @Nullable MiniObject readMiniObject()
      Read the value of the field mini_object.
      Returns:
      The value of the field mini_object
    • writeMiniObject

      public void writeMiniObject(@Nullable MiniObject miniObject)
      Write a value in the field mini_object.
      Parameters:
      miniObject - The new value for the field mini_object
    • empty

      public static TagList empty()

      Creates a new empty GstTagList.

      Free-function: gst_tag_list_unref

      Returns:
      An empty tag list
    • fromString

      public static @Nullable TagList fromString(String str)
      Deserializes a tag list.
      Parameters:
      str - a string created with gst_tag_list_to_string()
      Returns:
      a new GstTagList, or null in case of an error.
    • copyValue

      public static boolean copyValue(Value dest, TagList list, String tag)
      Copies the contents for the given tag into the value, merging multiple values into one if multiple values are associated with the tag. You must g_value_unset() the value after use.
      Parameters:
      dest - uninitialized GValue to copy into
      list - list to get the tag from
      tag - tag to read out
      Returns:
      true, if a value was copied, false if the tag didn't exist in the given list.
    • replace

      public static boolean replace(@Nullable Out<TagList> oldTaglist, @Nullable TagList newTaglist)

      Modifies a pointer to a GstTagList to point to a different GstTagList. The modification is done atomically (so this is useful for ensuring thread safety in some cases), and the reference counts are updated appropriately (the old tag list is unreffed, the new is reffed).

      Either newTaglist or the GstTagList pointed to by oldTaglist may be null.

      Parameters:
      oldTaglist - pointer to a pointer to a GstTagList to be replaced.
      newTaglist - pointer to a GstTagList that will replace the tag list pointed to by oldTaglist.
      Returns:
      true if newTaglist was different from oldTaglist
      Since:
      1.16
    • take

      public static boolean take(Out<TagList> oldTaglist, @Nullable TagList newTaglist)
      Modifies a pointer to a GstTagList to point to a different GstTagList. This function is similar to gst_tag_list_replace() except that it takes ownership of newTaglist.
      Parameters:
      oldTaglist - pointer to a pointer to a GstTagList to be replaced.
      newTaglist - pointer to a GstTagList that will replace the taglist pointed to by oldTaglist.
      Returns:
      true if newTaglist was different from oldTaglist
      Since:
      1.16
    • add

      public void add(TagMergeMode mode, String tag, Object... varargs)
      Sets the values for the given tags using the specified mode.
      Parameters:
      mode - the mode to use
      tag - tag
      varargs - null-terminated list of values to set
    • addValue

      public void addValue(TagMergeMode mode, String tag, Value value)
      Sets the GValue for a given tag using the specified mode.
      Parameters:
      mode - the mode to use
      tag - tag
      value - GValue for this tag
    • addValues

      public void addValues(TagMergeMode mode, String tag, Object... varargs)
      Sets the GValues for the given tags using the specified mode.
      Parameters:
      mode - the mode to use
      tag - tag
      varargs - GValues to set
    • copy

      public TagList copy()

      Creates a new GstTagList as a copy of the old taglist. The new taglist will have a refcount of 1, owned by the caller, and will be writable as a result.

      Note that this function is the semantic equivalent of a gst_tag_list_ref() followed by a gst_tag_list_make_writable(). If you only want to hold on to a reference to the data, you should use gst_tag_list_ref().

      When you are finished with the taglist, call gst_tag_list_unref() on it.

      Returns:
      the new GstTagList
    • foreach

      public void foreach(@Nullable TagForeachFunc func)
      Calls the given function for each tag inside the tag list. Note that if there is no tag, the function won't be called at all.
      Parameters:
      func - function to be called for each tag
    • getBoolean

      public boolean getBoolean(String tag, Out<Boolean> value)
      Copies the contents for the given tag into the value, merging multiple values into one if multiple values are associated with the tag.
      Parameters:
      tag - tag to read out
      value - location for the result
      Returns:
      true, if a value was copied, false if the tag didn't exist in the given list.
    • getBooleanIndex

      public boolean getBooleanIndex(String tag, int index, Out<Boolean> value)
      Gets the value that is at the given index for the given tag in the given list.
      Parameters:
      tag - tag to read out
      index - number of entry to read out
      value - location for the result
      Returns:
      true, if a value was copied, false if the tag didn't exist in the given list.
    • getDate

      public boolean getDate(String tag, Out<Date> value)

      Copies the first date for the given tag in the taglist into the variable pointed to by value. Free the date with g_date_free() when it is no longer needed.

      Free-function: g_date_free

      Parameters:
      tag - tag to read out
      value - address of a GDate pointer variable to store the result into
      Returns:
      true, if a date was copied, false if the tag didn't exist in the given list or if it was null.
    • getDateIndex

      public boolean getDateIndex(String tag, int index, Out<Date> value)

      Gets the date that is at the given index for the given tag in the given list and copies it into the variable pointed to by value. Free the date with g_date_free() when it is no longer needed.

      Free-function: g_date_free

      Parameters:
      tag - tag to read out
      index - number of entry to read out
      value - location for the result
      Returns:
      true, if a value was copied, false if the tag didn't exist in the given list or if it was null.
    • getDateTime

      public boolean getDateTime(String tag, Out<DateTime> value)

      Copies the first datetime for the given tag in the taglist into the variable pointed to by value. Unref the date with gst_date_time_unref() when it is no longer needed.

      Free-function: gst_date_time_unref

      Parameters:
      tag - tag to read out
      value - address of a GstDateTime pointer variable to store the result into
      Returns:
      true, if a datetime was copied, false if the tag didn't exist in the given list or if it was null.
    • getDateTimeIndex

      public boolean getDateTimeIndex(String tag, int index, Out<DateTime> value)

      Gets the datetime that is at the given index for the given tag in the given list and copies it into the variable pointed to by value. Unref the datetime with gst_date_time_unref() when it is no longer needed.

      Free-function: gst_date_time_unref

      Parameters:
      tag - tag to read out
      index - number of entry to read out
      value - location for the result
      Returns:
      true, if a value was copied, false if the tag didn't exist in the given list or if it was null.
    • getDouble

      public boolean getDouble(String tag, Out<Double> value)
      Copies the contents for the given tag into the value, merging multiple values into one if multiple values are associated with the tag.
      Parameters:
      tag - tag to read out
      value - location for the result
      Returns:
      true, if a value was copied, false if the tag didn't exist in the given list.
    • getDoubleIndex

      public boolean getDoubleIndex(String tag, int index, Out<Double> value)
      Gets the value that is at the given index for the given tag in the given list.
      Parameters:
      tag - tag to read out
      index - number of entry to read out
      value - location for the result
      Returns:
      true, if a value was copied, false if the tag didn't exist in the given list.
    • getFloat

      public boolean getFloat(String tag, Out<Float> value)
      Copies the contents for the given tag into the value, merging multiple values into one if multiple values are associated with the tag.
      Parameters:
      tag - tag to read out
      value - location for the result
      Returns:
      true, if a value was copied, false if the tag didn't exist in the given list.
    • getFloatIndex

      public boolean getFloatIndex(String tag, int index, Out<Float> value)
      Gets the value that is at the given index for the given tag in the given list.
      Parameters:
      tag - tag to read out
      index - number of entry to read out
      value - location for the result
      Returns:
      true, if a value was copied, false if the tag didn't exist in the given list.
    • getInt

      public boolean getInt(String tag, Out<Integer> value)
      Copies the contents for the given tag into the value, merging multiple values into one if multiple values are associated with the tag.
      Parameters:
      tag - tag to read out
      value - location for the result
      Returns:
      true, if a value was copied, false if the tag didn't exist in the given list.
    • getInt64

      public boolean getInt64(String tag, Out<Long> value)
      Copies the contents for the given tag into the value, merging multiple values into one if multiple values are associated with the tag.
      Parameters:
      tag - tag to read out
      value - location for the result
      Returns:
      true, if a value was copied, false if the tag didn't exist in the given list.
    • getInt64Index

      public boolean getInt64Index(String tag, int index, Out<Long> value)
      Gets the value that is at the given index for the given tag in the given list.
      Parameters:
      tag - tag to read out
      index - number of entry to read out
      value - location for the result
      Returns:
      true, if a value was copied, false if the tag didn't exist in the given list.
    • getIntIndex

      public boolean getIntIndex(String tag, int index, Out<Integer> value)
      Gets the value that is at the given index for the given tag in the given list.
      Parameters:
      tag - tag to read out
      index - number of entry to read out
      value - location for the result
      Returns:
      true, if a value was copied, false if the tag didn't exist in the given list.
    • getPointer

      public boolean getPointer(String tag, @Nullable Out<MemorySegment> value)
      Copies the contents for the given tag into the value, merging multiple values into one if multiple values are associated with the tag.
      Parameters:
      tag - tag to read out
      value - location for the result
      Returns:
      true, if a value was copied, false if the tag didn't exist in the given list.
    • getPointerIndex

      public boolean getPointerIndex(String tag, int index, @Nullable Out<MemorySegment> value)
      Gets the value that is at the given index for the given tag in the given list.
      Parameters:
      tag - tag to read out
      index - number of entry to read out
      value - location for the result
      Returns:
      true, if a value was copied, false if the tag didn't exist in the given list.
    • getSample

      public boolean getSample(String tag, Out<Sample> sample)

      Copies the first sample for the given tag in the taglist into the variable pointed to by sample. Free the sample with gst_sample_unref() when it is no longer needed. You can retrieve the buffer from the sample using gst_sample_get_buffer() and the associated caps (if any) with gst_sample_get_caps().

      Free-function: gst_sample_unref

      Parameters:
      tag - tag to read out
      sample - address of a GstSample pointer variable to store the result into
      Returns:
      true, if a sample was returned, false if the tag didn't exist in the given list or if it was null.
    • getSampleIndex

      public boolean getSampleIndex(String tag, int index, Out<Sample> sample)

      Gets the sample that is at the given index for the given tag in the given list and copies it into the variable pointed to by sample. Free the sample with gst_sample_unref() when it is no longer needed. You can retrieve the buffer from the sample using gst_sample_get_buffer() and the associated caps (if any) with gst_sample_get_caps().

      Free-function: gst_sample_unref

      Parameters:
      tag - tag to read out
      index - number of entry to read out
      sample - address of a GstSample pointer variable to store the result into
      Returns:
      true, if a sample was copied, false if the tag didn't exist in the given list or if it was null.
    • getScope

      public TagScope getScope()
      Gets the scope of list.
      Returns:
      The scope of this TagList
    • getString

      public boolean getString(String tag, Out<String> value)

      Copies the contents for the given tag into the value, possibly merging multiple values into one if multiple values are associated with the tag.

      Use gst_tag_list_get_string_index (list, tag, 0, value) if you want to retrieve the first string associated with this tag unmodified.

      The resulting string in value will be in UTF-8 encoding and should be freed by the caller using g_free when no longer needed. The returned string is also guaranteed to be non-null and non-empty.

      Free-function: g_free

      Parameters:
      tag - tag to read out
      value - location for the result
      Returns:
      true, if a value was copied, false if the tag didn't exist in the given list.
    • getStringIndex

      public boolean getStringIndex(String tag, int index, Out<String> value)

      Gets the value that is at the given index for the given tag in the given list.

      The resulting string in value will be in UTF-8 encoding and should be freed by the caller using g_free when no longer needed. The returned string is also guaranteed to be non-null and non-empty.

      Free-function: g_free

      Parameters:
      tag - tag to read out
      index - number of entry to read out
      value - location for the result
      Returns:
      true, if a value was copied, false if the tag didn't exist in the given list.
    • getTagSize

      public int getTagSize(String tag)
      Checks how many value are stored in this tag list for the given tag.
      Parameters:
      tag - the tag to query
      Returns:
      The number of tags stored
    • getUint

      public boolean getUint(String tag, Out<Integer> value)
      Copies the contents for the given tag into the value, merging multiple values into one if multiple values are associated with the tag.
      Parameters:
      tag - tag to read out
      value - location for the result
      Returns:
      true, if a value was copied, false if the tag didn't exist in the given list.
    • getUint64

      public boolean getUint64(String tag, Out<Long> value)
      Copies the contents for the given tag into the value, merging multiple values into one if multiple values are associated with the tag.
      Parameters:
      tag - tag to read out
      value - location for the result
      Returns:
      true, if a value was copied, false if the tag didn't exist in the given list.
    • getUint64Index

      public boolean getUint64Index(String tag, int index, Out<Long> value)
      Gets the value that is at the given index for the given tag in the given list.
      Parameters:
      tag - tag to read out
      index - number of entry to read out
      value - location for the result
      Returns:
      true, if a value was copied, false if the tag didn't exist in the given list.
    • getUintIndex

      public boolean getUintIndex(String tag, int index, Out<Integer> value)
      Gets the value that is at the given index for the given tag in the given list.
      Parameters:
      tag - tag to read out
      index - number of entry to read out
      value - location for the result
      Returns:
      true, if a value was copied, false if the tag didn't exist in the given list.
    • getValueIndex

      public @Nullable Value getValueIndex(String tag, int index)
      Gets the value that is at the given index for the given tag in the given list.
      Parameters:
      tag - tag to read out
      index - number of entry to read out
      Returns:
      The GValue for the specified entry or null if the tag wasn't available or the tag doesn't have as many entries
    • insert

      public void insert(TagList from, TagMergeMode mode)
      Inserts the tags of the from list into the first list using the given mode.
      Parameters:
      from - list to merge from
      mode - the mode to use
    • isEmpty

      public boolean isEmpty()
      Checks if the given taglist is empty.
      Returns:
      true if the taglist is empty, otherwise false.
    • isEqual

      public boolean isEqual(TagList list2)
      Checks if the two given taglists are equal.
      Parameters:
      list2 - a GstTagList.
      Returns:
      true if the taglists are equal, otherwise false
    • merge

      public @Nullable TagList merge(@Nullable TagList list2, TagMergeMode mode)

      Merges the two given lists into a new list. If one of the lists is null, a copy of the other is returned. If both lists are null, null is returned.

      Free-function: gst_tag_list_unref

      Parameters:
      list2 - second list to merge
      mode - the mode to use
      Returns:
      the new list
    • nTags

      public int nTags()
      Get the number of tags in list.
      Returns:
      The number of tags in list.
    • nthTagName

      public String nthTagName(int index)
      Get the name of the tag in this TagList at index.
      Parameters:
      index - the index
      Returns:
      The name of the tag at index.
    • peekStringIndex

      public boolean peekStringIndex(String tag, int index, Out<String> value)

      Peeks at the value that is at the given index for the given tag in the given list.

      The resulting string in value will be in UTF-8 encoding and doesn't need to be freed by the caller. The returned string is also guaranteed to be non-null and non-empty.

      Parameters:
      tag - tag to read out
      index - number of entry to read out
      value - location for the result
      Returns:
      true, if a value was set, false if the tag didn't exist in the given list.
    • ref

      public TagList ref()

      Add a reference to a GstTagList mini object.

      From this point on, until the caller calls gst_tag_list_unref() or gst_tag_list_make_writable(), it is guaranteed that the taglist object will not change. To use a GstTagList object, you must always have a refcount on it -- either the one made implicitly by e.g. gst_tag_list_new(), or via taking one explicitly with this function.

      Returns:
      the same GstTagList mini object.
    • removeTag

      public void removeTag(String tag)
      Removes the given tag from the taglist.
      Parameters:
      tag - tag to remove
    • setScope

      public void setScope(TagScope scope)
      Sets the scope of this TagList to scope. By default the scope of a taglist is stream scope.
      Parameters:
      scope - new scope for this TagList
    • toString

      public String toString()
      Serializes a tag list to a string.
      Overrides:
      toString in class Object
      Returns:
      a newly-allocated string. The string must be freed with g_free() when no longer needed.
    • unref

      public void unref()
      Unref a GstTagList, and and free all its memory when the refcount reaches 0.