TagList#
- class TagList(*args, **kwargs)#
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 None.
Constructors#
Methods#
- class TagList
- add_value(mode: TagMergeMode, tag: str, value: Value) None#
Sets the GValue for a given tag using the specified mode.
- Parameters:
mode – the mode to use
tag – tag
value – GValue for this tag
- foreach(func: Callable[[TagList, str, Any], None], user_data: Any = None) None#
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
user_data – user specified data
- get_boolean(tag: str) tuple[bool, bool]#
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
- get_boolean_index(tag: str, index: int) tuple[bool, bool]#
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
- get_date(tag: str) tuple[bool, Date]#
Copies the first date for the given tag in the taglist into the variable pointed to by
value. Free the date withfree()when it is no longer needed.Free-function: g_date_free
- Parameters:
tag – tag to read out
- get_date_index(tag: str, index: int) tuple[bool, Date]#
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 withfree()when it is no longer needed.Free-function: g_date_free
- Parameters:
tag – tag to read out
index – number of entry to read out
- get_date_time(tag: str) tuple[bool, DateTime]#
Copies the first datetime for the given tag in the taglist into the variable pointed to by
value. Unref the date withunref()when it is no longer needed.Free-function: gst_date_time_unref
- Parameters:
tag – tag to read out
- get_date_time_index(tag: str, index: int) tuple[bool, DateTime]#
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 withunref()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
- get_double(tag: str) tuple[bool, float]#
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
- get_double_index(tag: str, index: int) tuple[bool, float]#
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
- get_float(tag: str) tuple[bool, float]#
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
- get_float_index(tag: str, index: int) tuple[bool, float]#
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
- get_int(tag: str) tuple[bool, int]#
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
- get_int64(tag: str) tuple[bool, int]#
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
- get_int64_index(tag: str, index: int) tuple[bool, int]#
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
- get_int_index(tag: str, index: int) tuple[bool, int]#
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
- get_pointer(tag: str) tuple[bool, Any | None]#
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
- get_pointer_index(tag: str, index: int) tuple[bool, Any | None]#
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
- get_sample(tag: str) tuple[bool, 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 usingget_buffer()and the associated caps (if any) withget_caps().Free-function: gst_sample_unref
- Parameters:
tag – tag to read out
- get_sample_index(tag: str, index: int) tuple[bool, 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 usingget_buffer()and the associated caps (if any) withget_caps().Free-function: gst_sample_unref
- Parameters:
tag – tag to read out
index – number of entry to read out
- get_string(tag: str) tuple[bool, str]#
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-Noneand non-empty.Free-function: g_free
- Parameters:
tag – tag to read out
- get_string_index(tag: str, index: int) tuple[bool, str]#
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-Noneand non-empty.Free-function: g_free
- Parameters:
tag – tag to read out
index – number of entry to read out
- get_tag_size(tag: str) int#
Checks how many value are stored in this tag list for the given tag.
- Parameters:
tag – the tag to query
- get_uint(tag: str) tuple[bool, int]#
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
- get_uint64(tag: str) tuple[bool, int]#
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
- get_uint64_index(tag: str, index: int) tuple[bool, int]#
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
- get_uint_index(tag: str, index: int) tuple[bool, int]#
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
- get_value_index(tag: str, index: int) Value | None#
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
- insert(from_: TagList, mode: TagMergeMode) None#
Inserts the tags of the
fromlist into the first list using the given mode.- Parameters:
from
mode – the mode to use
- is_equal(list2: TagList) bool#
Checks if the two given taglists are equal.
- Parameters:
list2 – a
TagList.
- merge(list2: TagList | None, mode: TagMergeMode) TagList | None#
Merges the two given lists into a new list. If one of the lists is
None, a copy of the other is returned. If both lists areNone,Noneis returned.Free-function: gst_tag_list_unref
- Parameters:
list2 – second list to merge
mode – the mode to use
- nth_tag_name(index: int) str#
Get the name of the tag in
listatindex.- Parameters:
index – the index
- peek_string_index(tag: str, index: int) tuple[bool, str]#
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-Noneand non-empty.- Parameters:
tag – tag to read out
index – number of entry to read out
Fields#
- class TagList
- mini_object#
The parent type