Class TagList
- All Implemented Interfaces:
Proxy
Strings in structures must be ASCII or UTF-8 encoded. Other encodings are
not allowed. Strings must not be empty or null.
-
Constructor Summary
ConstructorsConstructorDescriptionTagList(MemorySegment address) Create a TagList proxy instance for the provided memory address.Creates a new taglist and appends the values for the given tags. -
Method Summary
Modifier and TypeMethodDescriptionvoidadd(TagMergeMode mode, String tag, Object... varargs) Sets the values for the given tags using the specified mode.voidaddValue(TagMergeMode mode, String tag, Value value) Sets the GValue for a given tag using the specified mode.voidaddValues(TagMergeMode mode, String tag, Object... varargs) Sets the GValues for the given tags using the specified mode.copy()Creates a newGstTagListas a copy of the oldtaglist.The new taglist will have a refcount of 1, owned by the caller, and will be writable as a result.static booleanCopies the contents for the given tag into the value, merging multiple values into one if multiple values are associated with the tag.static TagListempty()Creates a new empty GstTagList.voidforeach(@Nullable TagForeachFunc func) Calls the given function for each tag inside the tag list.static TagListfromString(String str) Deserializes a tag list.booleangetBoolean(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.booleangetBooleanIndex(String tag, int index, Out<Boolean> value) Gets the value that is at the given index for the given tag in the given list.booleanCopies the first date for the given tag in the taglist into the variable pointed to byvalue.Free the date with g_date_free() when it is no longer needed.booleangetDateIndex(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 byvalue.Free the date with g_date_free() when it is no longer needed.booleangetDateTime(String tag, Out<DateTime> value) Copies the first datetime for the given tag in the taglist into the variable pointed to byvalue.Unref the date with gst_date_time_unref() when it is no longer needed.booleangetDateTimeIndex(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 byvalue.Unref the datetime with gst_date_time_unref() when it is no longer needed.booleanCopies the contents for the given tag into the value, merging multiple values into one if multiple values are associated with the tag.booleangetDoubleIndex(String tag, int index, Out<Double> value) Gets the value that is at the given index for the given tag in the given list.booleanCopies the contents for the given tag into the value, merging multiple values into one if multiple values are associated with the tag.booleangetFloatIndex(String tag, int index, Out<Float> value) Gets the value that is at the given index for the given tag in the given list.booleanCopies the contents for the given tag into the value, merging multiple values into one if multiple values are associated with the tag.booleanCopies the contents for the given tag into the value, merging multiple values into one if multiple values are associated with the tag.booleangetInt64Index(String tag, int index, Out<Long> value) Gets the value that is at the given index for the given tag in the given list.booleangetIntIndex(String tag, int index, Out<Integer> value) Gets the value that is at the given index for the given tag in the given list.static MemoryLayoutThe memory layout of the native struct.booleangetPointer(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.booleangetPointerIndex(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.booleanCopies the first sample for the given tag in the taglist into the variable pointed to bysample.Free the sample with gst_sample_unref() when it is no longer needed.booleangetSampleIndex(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 bysample.Free the sample with gst_sample_unref() when it is no longer needed.getScope()Gets the scope oflist.booleanCopies the contents for the given tag into the value, possibly merging multiple values into one if multiple values are associated with the tag.booleangetStringIndex(String tag, int index, Out<String> value) Gets the value that is at the given index for the given tag in the given list.intgetTagSize(String tag) Checks how many value are stored in this tag list for the given tag.static @Nullable TypegetType()Get the GType of the TagList classbooleanCopies the contents for the given tag into the value, merging multiple values into one if multiple values are associated with the tag.booleanCopies the contents for the given tag into the value, merging multiple values into one if multiple values are associated with the tag.booleangetUint64Index(String tag, int index, Out<Long> value) Gets the value that is at the given index for the given tag in the given list.booleangetUintIndex(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 ValuegetValueIndex(String tag, int index) Gets the value that is at the given index for the given tag in the given list.voidinsert(TagList from, TagMergeMode mode) Inserts the tags of thefromlist into the first list using the given mode.booleanisEmpty()Checks if the given taglist is empty.booleanChecks if the two given taglists are equal.@Nullable TagListmerge(@Nullable TagList list2, TagMergeMode mode) Merges the two given lists into a new list.intnTags()Get the number of tags inlist.nthTagName(int index) Get the name of the tag in this TagList atindex.booleanpeekStringIndex(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 MiniObjectRead the value of the fieldmini_object.ref()Add a reference to aGstTagListmini object.voidRemoves the given tag from the taglist.static booleanModifies a pointer to aGstTagListto point to a differentGstTagList.voidSets the scope of this TagList toscope.By default the scope of a taglist is stream scope.static booleanModifies a pointer to aGstTagListto point to a differentGstTagList.toString()Serializes a tag list to a string.voidunref()Unref aGstTagList, and and free all its memory when the refcount reaches 0.voidwriteMiniObject(@Nullable MiniObject miniObject) Write a value in the fieldmini_object.Methods inherited from class org.javagi.base.ProxyInstance
equals, handle, hashCode
-
Constructor Details
-
TagList
Create a TagList proxy instance for the provided memory address.- Parameters:
address- the memory address of the native object
-
TagList
Creates a new taglist and appends the values for the given tags. It expects tag-value pairs like gst_tag_list_add(), and anullterminator 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
GstTagScopeon 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- tagvarargs-null-terminated list of values to set
-
-
Method Details
-
getType
-
getMemoryLayout
The memory layout of the native struct.- Returns:
- the memory layout
-
readMiniObject
Read the value of the fieldmini_object.- Returns:
- The value of the field
mini_object
-
writeMiniObject
Write a value in the fieldmini_object.- Parameters:
miniObject- The new value for the fieldmini_object
-
empty
Creates a new empty GstTagList.Free-function: gst_tag_list_unref
- Returns:
- An empty tag list
-
fromString
-
copyValue
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- uninitializedGValueto copy intolist- list to get the tag fromtag- tag to read out- Returns:
true, if a value was copied,falseif the tag didn't exist in the given list.
-
replace
Modifies a pointer to aGstTagListto point to a differentGstTagList. 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
newTaglistor theGstTagListpointed to byoldTaglistmay benull.- Parameters:
oldTaglist- pointer to a pointer to aGstTagListto be replaced.newTaglist- pointer to aGstTagListthat will replace the tag list pointed to byoldTaglist.- Returns:
trueifnewTaglistwas different fromoldTaglist- Since:
- 1.16
-
take
Modifies a pointer to aGstTagListto point to a differentGstTagList. This function is similar to gst_tag_list_replace() except that it takes ownership ofnewTaglist.- Parameters:
oldTaglist- pointer to a pointer to aGstTagListto be replaced.newTaglist- pointer to aGstTagListthat will replace the taglist pointed to byoldTaglist.- Returns:
trueifnewTaglistwas different fromoldTaglist- Since:
- 1.16
-
add
Sets the values for the given tags using the specified mode.- Parameters:
mode- the mode to usetag- tagvarargs-null-terminated list of values to set
-
addValue
Sets the GValue for a given tag using the specified mode.- Parameters:
mode- the mode to usetag- tagvalue- GValue for this tag
-
addValues
Sets the GValues for the given tags using the specified mode.- Parameters:
mode- the mode to usetag- tagvarargs- GValues to set
-
copy
Creates a newGstTagListas a copy of the oldtaglist.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
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
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 outvalue- location for the result- Returns:
true, if a value was copied,falseif the tag didn't exist in the given list.
-
getBooleanIndex
Gets the value that is at the given index for the given tag in the given list.- Parameters:
tag- tag to read outindex- number of entry to read outvalue- location for the result- Returns:
true, if a value was copied,falseif the tag didn't exist in the given list.
-
getDate
Copies the first date for the given tag in the taglist into the variable pointed to byvalue.Free the date with g_date_free() when it is no longer needed.Free-function: g_date_free
- Parameters:
tag- tag to read outvalue- address of a GDate pointer variable to store the result into- Returns:
true, if a date was copied,falseif the tag didn't exist in the given list or if it wasnull.
-
getDateIndex
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 byvalue.Free the date with g_date_free() when it is no longer needed.Free-function: g_date_free
- Parameters:
tag- tag to read outindex- number of entry to read outvalue- location for the result- Returns:
true, if a value was copied,falseif the tag didn't exist in the given list or if it wasnull.
-
getDateTime
Copies the first datetime for the given tag in the taglist into the variable pointed to byvalue.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 outvalue- address of aGstDateTimepointer variable to store the result into- Returns:
true, if a datetime was copied,falseif the tag didn't exist in the given list or if it wasnull.
-
getDateTimeIndex
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 byvalue.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 outindex- number of entry to read outvalue- location for the result- Returns:
true, if a value was copied,falseif the tag didn't exist in the given list or if it wasnull.
-
getDouble
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 outvalue- location for the result- Returns:
true, if a value was copied,falseif the tag didn't exist in the given list.
-
getDoubleIndex
Gets the value that is at the given index for the given tag in the given list.- Parameters:
tag- tag to read outindex- number of entry to read outvalue- location for the result- Returns:
true, if a value was copied,falseif the tag didn't exist in the given list.
-
getFloat
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 outvalue- location for the result- Returns:
true, if a value was copied,falseif the tag didn't exist in the given list.
-
getFloatIndex
Gets the value that is at the given index for the given tag in the given list.- Parameters:
tag- tag to read outindex- number of entry to read outvalue- location for the result- Returns:
true, if a value was copied,falseif the tag didn't exist in the given list.
-
getInt
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 outvalue- location for the result- Returns:
true, if a value was copied,falseif the tag didn't exist in the given list.
-
getInt64
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 outvalue- location for the result- Returns:
true, if a value was copied,falseif the tag didn't exist in the given list.
-
getInt64Index
Gets the value that is at the given index for the given tag in the given list.- Parameters:
tag- tag to read outindex- number of entry to read outvalue- location for the result- Returns:
true, if a value was copied,falseif the tag didn't exist in the given list.
-
getIntIndex
Gets the value that is at the given index for the given tag in the given list.- Parameters:
tag- tag to read outindex- number of entry to read outvalue- location for the result- Returns:
true, if a value was copied,falseif the tag didn't exist in the given list.
-
getPointer
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 outvalue- location for the result- Returns:
true, if a value was copied,falseif the tag didn't exist in the given list.
-
getPointerIndex
Gets the value that is at the given index for the given tag in the given list.- Parameters:
tag- tag to read outindex- number of entry to read outvalue- location for the result- Returns:
true, if a value was copied,falseif the tag didn't exist in the given list.
-
getSample
Copies the first sample for the given tag in the taglist into the variable pointed to bysample.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 outsample- address of a GstSample pointer variable to store the result into- Returns:
true, if a sample was returned,falseif the tag didn't exist in the given list or if it wasnull.
-
getSampleIndex
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 bysample.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 outindex- number of entry to read outsample- address of a GstSample pointer variable to store the result into- Returns:
true, if a sample was copied,falseif the tag didn't exist in the given list or if it wasnull.
-
getScope
-
getString
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
valuewill 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-nulland non-empty.Free-function: g_free
- Parameters:
tag- tag to read outvalue- location for the result- Returns:
true, if a value was copied,falseif the tag didn't exist in the given list.
-
getStringIndex
Gets the value that is at the given index for the given tag in the given list.The resulting string in
valuewill 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-nulland non-empty.Free-function: g_free
- Parameters:
tag- tag to read outindex- number of entry to read outvalue- location for the result- Returns:
true, if a value was copied,falseif the tag didn't exist in the given list.
-
getTagSize
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
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 outvalue- location for the result- Returns:
true, if a value was copied,falseif the tag didn't exist in the given list.
-
getUint64
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 outvalue- location for the result- Returns:
true, if a value was copied,falseif the tag didn't exist in the given list.
-
getUint64Index
Gets the value that is at the given index for the given tag in the given list.- Parameters:
tag- tag to read outindex- number of entry to read outvalue- location for the result- Returns:
true, if a value was copied,falseif the tag didn't exist in the given list.
-
getUintIndex
Gets the value that is at the given index for the given tag in the given list.- Parameters:
tag- tag to read outindex- number of entry to read outvalue- location for the result- Returns:
true, if a value was copied,falseif the tag didn't exist in the given list.
-
getValueIndex
Gets the value that is at the given index for the given tag in the given list.- Parameters:
tag- tag to read outindex- number of entry to read out- Returns:
- The GValue for the specified
entry or
nullif the tag wasn't available or the tag doesn't have as many entries
-
insert
Inserts the tags of thefromlist into the first list using the given mode.- Parameters:
from- list to merge frommode- the mode to use
-
isEmpty
public boolean isEmpty()Checks if the given taglist is empty.- Returns:
trueif the taglist is empty, otherwisefalse.
-
isEqual
Checks if the two given taglists are equal.- Parameters:
list2- aGstTagList.- Returns:
trueif the taglists are equal, otherwisefalse
-
merge
Merges the two given lists into a new list. If one of the lists isnull, a copy of the other is returned. If both lists arenull,nullis returned.Free-function: gst_tag_list_unref
- Parameters:
list2- second list to mergemode- the mode to use- Returns:
- the new list
-
nTags
public int nTags()Get the number of tags inlist.- Returns:
- The number of tags in
list.
-
nthTagName
Get the name of the tag in this TagList atindex.- Parameters:
index- the index- Returns:
- The name of the tag at
index.
-
peekStringIndex
Peeks at the value that is at the given index for the given tag in the given list.The resulting string in
valuewill be in UTF-8 encoding and doesn't need to be freed by the caller. The returned string is also guaranteed to be non-nulland non-empty.- Parameters:
tag- tag to read outindex- number of entry to read outvalue- location for the result- Returns:
true, if a value was set,falseif the tag didn't exist in the given list.
-
ref
Add a reference to aGstTagListmini 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
GstTagListobject, 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
GstTagListmini object.
-
removeTag
Removes the given tag from the taglist.- Parameters:
tag- tag to remove
-
setScope
Sets the scope of this TagList toscope.By default the scope of a taglist is stream scope.- Parameters:
scope- new scope for this TagList
-
toString
-
unref
public void unref()Unref aGstTagList, and and free all its memory when the refcount reaches 0.
-