:right-sidebar: True TagList =================================================================== .. currentmodule:: gi.repository.Gst .. class:: TagList(*args, **kwargs) :no-contents-entry: 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 :const:`None`. Constructors ------------ .. rst-class:: interim-class .. class:: TagList :no-index: .. classmethod:: new_empty() -> ~gi.repository.Gst.TagList Creates a new empty GstTagList. Free-function: gst_tag_list_unref .. classmethod:: new_from_string(str: str) -> ~gi.repository.Gst.TagList | None Deserializes a tag list. :param str: a string created with :func:`~gi.repository.Gst.TagList.to_string` Methods ------- .. rst-class:: interim-class .. class:: TagList :no-index: .. method:: add_value(mode: ~gi.repository.Gst.TagMergeMode, tag: str, value: ~gi.repository.GObject.Value) -> None Sets the GValue for a given tag using the specified mode. :param mode: the mode to use :param tag: tag :param value: GValue for this tag .. method:: foreach(func: ~typing.Callable[[~gi.repository.Gst.TagList, str, ~typing.Any], None], user_data: ~typing.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. :param func: function to be called for each tag :param user_data: user specified data .. method:: get_boolean(tag: str) -> ~typing.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. :param tag: tag to read out .. method:: get_boolean_index(tag: str, index: int) -> ~typing.Tuple[bool, bool] Gets the value that is at the given index for the given tag in the given list. :param tag: tag to read out :param index: number of entry to read out .. method:: get_date(tag: str) -> ~typing.Tuple[bool, ~gi.repository.GLib.Date] Copies the first date for the given tag in the taglist into the variable pointed to by ``value``\. Free the date with :func:`~gi.repository.GLib.Date.free` when it is no longer needed. Free-function: g_date_free :param tag: tag to read out .. method:: get_date_index(tag: str, index: int) -> ~typing.Tuple[bool, ~gi.repository.GLib.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 with :func:`~gi.repository.GLib.Date.free` when it is no longer needed. Free-function: g_date_free :param tag: tag to read out :param index: number of entry to read out .. method:: get_date_time(tag: str) -> ~typing.Tuple[bool, ~gi.repository.Gst.DateTime] Copies the first datetime for the given tag in the taglist into the variable pointed to by ``value``\. Unref the date with :func:`~gi.repository.Gst.DateTime.unref` when it is no longer needed. Free-function: gst_date_time_unref :param tag: tag to read out .. method:: get_date_time_index(tag: str, index: int) -> ~typing.Tuple[bool, ~gi.repository.Gst.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 with :func:`~gi.repository.Gst.DateTime.unref` when it is no longer needed. Free-function: gst_date_time_unref :param tag: tag to read out :param index: number of entry to read out .. method:: get_double(tag: str) -> ~typing.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. :param tag: tag to read out .. method:: get_double_index(tag: str, index: int) -> ~typing.Tuple[bool, float] Gets the value that is at the given index for the given tag in the given list. :param tag: tag to read out :param index: number of entry to read out .. method:: get_float(tag: str) -> ~typing.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. :param tag: tag to read out .. method:: get_float_index(tag: str, index: int) -> ~typing.Tuple[bool, float] Gets the value that is at the given index for the given tag in the given list. :param tag: tag to read out :param index: number of entry to read out .. method:: get_int(tag: str) -> ~typing.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. :param tag: tag to read out .. method:: get_int64(tag: str) -> ~typing.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. :param tag: tag to read out .. method:: get_int64_index(tag: str, index: int) -> ~typing.Tuple[bool, int] Gets the value that is at the given index for the given tag in the given list. :param tag: tag to read out :param index: number of entry to read out .. method:: get_int_index(tag: str, index: int) -> ~typing.Tuple[bool, int] Gets the value that is at the given index for the given tag in the given list. :param tag: tag to read out :param index: number of entry to read out .. method:: get_pointer(tag: str) -> ~typing.Tuple[bool, ~typing.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. :param tag: tag to read out .. method:: get_pointer_index(tag: str, index: int) -> ~typing.Tuple[bool, ~typing.Any | None] Gets the value that is at the given index for the given tag in the given list. :param tag: tag to read out :param index: number of entry to read out .. method:: get_sample(tag: str) -> ~typing.Tuple[bool, ~gi.repository.Gst.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 :func:`~gi.repository.Gst.Sample.get_buffer` and the associated caps (if any) with :func:`~gi.repository.Gst.Sample.get_caps`. Free-function: gst_sample_unref :param tag: tag to read out .. method:: get_sample_index(tag: str, index: int) -> ~typing.Tuple[bool, ~gi.repository.Gst.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 :func:`~gi.repository.Gst.Sample.get_buffer` and the associated caps (if any) with :func:`~gi.repository.Gst.Sample.get_caps`. Free-function: gst_sample_unref :param tag: tag to read out :param index: number of entry to read out .. method:: get_scope() -> ~gi.repository.Gst.TagScope Gets the scope of ``list``\. .. method:: get_string(tag: str) -> ~typing.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 ``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-:const:`None` and non-empty. Free-function: g_free :param tag: tag to read out .. method:: get_string_index(tag: str, index: int) -> ~typing.Tuple[bool, str] 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-:const:`None` and non-empty. Free-function: g_free :param tag: tag to read out :param index: number of entry to read out .. method:: get_tag_size(tag: str) -> int Checks how many value are stored in this tag list for the given tag. :param tag: the tag to query .. method:: get_uint(tag: str) -> ~typing.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. :param tag: tag to read out .. method:: get_uint64(tag: str) -> ~typing.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. :param tag: tag to read out .. method:: get_uint64_index(tag: str, index: int) -> ~typing.Tuple[bool, int] Gets the value that is at the given index for the given tag in the given list. :param tag: tag to read out :param index: number of entry to read out .. method:: get_uint_index(tag: str, index: int) -> ~typing.Tuple[bool, int] Gets the value that is at the given index for the given tag in the given list. :param tag: tag to read out :param index: number of entry to read out .. method:: get_value_index(tag: str, index: int) -> ~gi.repository.GObject.Value | None Gets the value that is at the given index for the given tag in the given list. :param tag: tag to read out :param index: number of entry to read out .. method:: insert(from_: ~gi.repository.Gst.TagList, mode: ~gi.repository.Gst.TagMergeMode) -> None Inserts the tags of the ``from`` list into the first list using the given mode. :param from_: :param mode: the mode to use .. method:: is_empty() -> bool Checks if the given taglist is empty. .. method:: is_equal(list2: ~gi.repository.Gst.TagList) -> bool Checks if the two given taglists are equal. :param list2: a :obj:`~gi.repository.Gst.TagList`\. .. method:: merge(list2: ~gi.repository.Gst.TagList | None, mode: ~gi.repository.Gst.TagMergeMode) -> ~gi.repository.Gst.TagList | None Merges the two given lists into a new list. If one of the lists is :const:`None`, a copy of the other is returned. If both lists are :const:`None`, :const:`None` is returned. Free-function: gst_tag_list_unref :param list2: second list to merge :param mode: the mode to use .. method:: n_tags() -> int Get the number of tags in ``list``\. .. method:: nth_tag_name(index: int) -> str Get the name of the tag in ``list`` at ``index``\. :param index: the index .. method:: peek_string_index(tag: str, index: int) -> ~typing.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 ``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-:const:`None` and non-empty. :param tag: tag to read out :param index: number of entry to read out .. method:: remove_tag(tag: str) -> None Removes the given tag from the taglist. :param tag: tag to remove .. method:: set_scope(scope: ~gi.repository.Gst.TagScope) -> None Sets the scope of ``list`` to ``scope``\. By default the scope of a taglist is stream scope. :param scope: new scope for ``list`` .. method:: to_string() -> str Serializes a tag list to a string. Fields ------ .. rst-class:: interim-class .. class:: TagList :no-index: .. attribute:: mini_object The parent type