: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: ~collections.abc.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) -> 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) -> 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) -> 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) -> 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) -> 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) -> 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) -> 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) -> 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) -> 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) -> 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) -> 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) -> 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) -> 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) -> 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) -> 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) -> 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) -> 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 :func:`~gi.repository.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) -> 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 :func:`~gi.repository.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) -> 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) -> 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) -> 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) -> 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) -> 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) -> 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:: is_writable() -> bool Tests if you can safely modify ``taglist``\. It is only safe to modify taglist when there is only one owner of the taglist - ie, the object is writable. .. method:: make_writable() -> ~gi.repository.Gst.TagList Returns a writable copy of ``taglist``\. If there is only one reference count on ``taglist``\, the caller must be the owner, and so this function will return the taglist object unchanged. If on the other hand there is more than one reference on the object, a new taglist object will be returned. The caller's reference on ``taglist`` will be removed, and instead the caller will own a reference to the returned object. In short, this function unrefs the taglist in the argument and refs the taglist that it returns. Don't access the argument after calling this function. See also: :func:`~gi.repository.Gst.TagList.ref`. .. 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) -> 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 .. classmethod:: replace(old_taglist: ~gi.repository.Gst.TagList | None = None, new_taglist: ~gi.repository.Gst.TagList | None = None) -> tuple[bool, ~gi.repository.Gst.TagList | None] Modifies a pointer to a :obj:`~gi.repository.Gst.TagList` to point to a different :obj:`~gi.repository.Gst.TagList`\. 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 ``new_taglist`` or the :obj:`~gi.repository.Gst.TagList` pointed to by ``old_taglist`` may be :const:`None`. .. versionadded:: 1.16 :param old_taglist: pointer to a pointer to a :obj:`~gi.repository.Gst.TagList` to be replaced. :param new_taglist: pointer to a :obj:`~gi.repository.Gst.TagList` that will replace the tag list pointed to by ``old_taglist``\. .. 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`` .. classmethod:: take(old_taglist: ~gi.repository.Gst.TagList, new_taglist: ~gi.repository.Gst.TagList | None = None) -> tuple[bool, ~gi.repository.Gst.TagList] Modifies a pointer to a :obj:`~gi.repository.Gst.TagList` to point to a different :obj:`~gi.repository.Gst.TagList`\. This function is similar to :func:`~gi.repository.Gst.TagList.replace` except that it takes ownership of ``new_taglist``\. .. versionadded:: 1.16 :param old_taglist: pointer to a pointer to a :obj:`~gi.repository.Gst.TagList` to be replaced. :param new_taglist: pointer to a :obj:`~gi.repository.Gst.TagList` that will replace the taglist pointed to by ``old_taglist``\. .. 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