Gst.TagList

Fields

Name Type Access Description
mini_object Gst.MiniObject r/w the parent type

Methods

class copy_value (list, tag)
class new_empty ()
class new_from_string (str)
  add_value (mode, tag, value)
  foreach (func, *user_data)
  get_boolean (tag)
  get_boolean_index (tag, index)
  get_date (tag)
  get_date_index (tag, index)
  get_date_time (tag)
  get_date_time_index (tag, index)
  get_double (tag)
  get_double_index (tag, index)
  get_float (tag)
  get_float_index (tag, index)
  get_int (tag)
  get_int64 (tag)
  get_int64_index (tag, index)
  get_int_index (tag, index)
  get_pointer (tag)
  get_pointer_index (tag, index)
  get_sample (tag)
  get_sample_index (tag, index)
  get_scope ()
  get_string (tag)
  get_string_index (tag, index)
  get_tag_size (tag)
  get_uint (tag)
  get_uint64 (tag)
  get_uint64_index (tag, index)
  get_uint_index (tag, index)
  get_value_index (tag, index)
  insert (from_, mode)
  is_empty ()
  is_equal (list2)
  merge (list2, mode)
  n_tags ()
  nth_tag_name (index)
  peek_string_index (tag, index)
  remove_tag (tag)
  set_scope (scope)
  to_string ()

Details

class Gst.TagList

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.

classmethod copy_value(list, tag)[source]
Parameters:
  • list (Gst.TagList) – list to get the tag from
  • tag (str) – tag to read out
Returns:

True, if a value was copied, False if the tag didn’t exist in the given list.

dest:uninitialized GObject.Value to copy into

Return type:

(bool, dest: GObject.Value)

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 GObject.Value.unset() the value after use.

classmethod new_empty()[source]
Returns:An empty tag list
Return type:Gst.TagList

Creates a new empty Gst.TagList.

Free-function: gst_tag_list_unref

classmethod new_from_string(str)[source]
Parameters:str (str) – a string created with Gst.TagList.to_string()
Returns:a new Gst.TagList, or None in case of an error.
Return type:Gst.TagList or None

Deserializes a tag list.

add_value(mode, tag, value)[source]
Parameters:

Sets the GObject.Value for a given tag using the specified mode.

foreach(func, *user_data)[source]
Parameters:

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.

get_boolean(tag)[source]
Parameters:tag (str) – tag to read out
Returns:True, if a value was copied, False if the tag didn’t exist in the given list.
value:location for the result
Return type:(bool, value: bool)

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

get_boolean_index(tag, index)[source]
Parameters:
  • tag (str) – tag to read out
  • index (int) – number of entry to read out
Returns:

True, if a value was copied, False if the tag didn’t exist in the given list.

value:location for the result

Return type:

(bool, value: bool)

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

get_date(tag)[source]
Parameters:tag (str) – tag to read out
Returns:True, if a date was copied, False if the tag didn’t exist in the given list or if it was None.
value:address of a GLib.Date pointer variable to store the result into
Return type:(bool, value: GLib.Date)

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

Free-function: GLib.Date.free

get_date_index(tag, index)[source]
Parameters:
  • tag (str) – tag to read out
  • index (int) – number of entry to read out
Returns:

True, if a value was copied, False if the tag didn’t exist in the given list or if it was None.

value:location for the result

Return type:

(bool, value: 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 GLib.Date.free() when it is no longer needed.

Free-function: GLib.Date.free

get_date_time(tag)[source]
Parameters:tag (str) – tag to read out
Returns:True, if a datetime was copied, False if the tag didn’t exist in the given list or if it was None.
value:address of a Gst.DateTime pointer variable to store the result into
Return type:(bool, value: Gst.DateTime)

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

Free-function: Gst.DateTime.unref

get_date_time_index(tag, index)[source]
Parameters:
  • tag (str) – tag to read out
  • index (int) – number of entry to read out
Returns:

True, if a value was copied, False if the tag didn’t exist in the given list or if it was None.

value:location for the result

Return type:

(bool, value: 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 Gst.DateTime.unref() when it is no longer needed.

Free-function: Gst.DateTime.unref

get_double(tag)[source]
Parameters:tag (str) – tag to read out
Returns:True, if a value was copied, False if the tag didn’t exist in the given list.
value:location for the result
Return type:(bool, value: float)

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

get_double_index(tag, index)[source]
Parameters:
  • tag (str) – tag to read out
  • index (int) – number of entry to read out
Returns:

True, if a value was copied, False if the tag didn’t exist in the given list.

value:location for the result

Return type:

(bool, value: float)

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

get_float(tag)[source]
Parameters:tag (str) – tag to read out
Returns:True, if a value was copied, False if the tag didn’t exist in the given list.
value:location for the result
Return type:(bool, value: float)

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

get_float_index(tag, index)[source]
Parameters:
  • tag (str) – tag to read out
  • index (int) – number of entry to read out
Returns:

True, if a value was copied, False if the tag didn’t exist in the given list.

value:location for the result

Return type:

(bool, value: float)

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

get_int(tag)[source]
Parameters:tag (str) – tag to read out
Returns:True, if a value was copied, False if the tag didn’t exist in the given list.
value:location for the result
Return type:(bool, value: int)

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

get_int64(tag)[source]
Parameters:tag (str) – tag to read out
Returns:True, if a value was copied, False if the tag didn’t exist in the given list.
value:location for the result
Return type:(bool, value: int)

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

get_int64_index(tag, index)[source]
Parameters:
  • tag (str) – tag to read out
  • index (int) – number of entry to read out
Returns:

True, if a value was copied, False if the tag didn’t exist in the given list.

value:location for the result

Return type:

(bool, value: int)

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

get_int_index(tag, index)[source]
Parameters:
  • tag (str) – tag to read out
  • index (int) – number of entry to read out
Returns:

True, if a value was copied, False if the tag didn’t exist in the given list.

value:location for the result

Return type:

(bool, value: int)

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

get_pointer(tag)[source]
Parameters:tag (str) – tag to read out
Returns:True, if a value was copied, False if the tag didn’t exist in the given list.
value:location for the result
Return type:(bool, value: object)

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

get_pointer_index(tag, index)[source]
Parameters:
  • tag (str) – tag to read out
  • index (int) – number of entry to read out
Returns:

True, if a value was copied, False if the tag didn’t exist in the given list.

value:location for the result

Return type:

(bool, value: object)

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

get_sample(tag)[source]
Parameters:tag (str) – tag to read out
Returns:True, if a sample was returned, False if the tag didn’t exist in the given list or if it was None.
sample:address of a Gst.Sample pointer variable to store the result into
Return type:(bool, sample: 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 Gst.Sample.get_buffer() and the associated caps (if any) with Gst.Sample.get_caps().

Free-function: gst_sample_unref

get_sample_index(tag, index)[source]
Parameters:
  • tag (str) – tag to read out
  • index (int) – number of entry to read out
Returns:

True, if a sample was copied, False if the tag didn’t exist in the given list or if it was None.

sample:address of a Gst.Sample pointer variable to store the result into

Return type:

(bool, sample: 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 Gst.Sample.get_buffer() and the associated caps (if any) with Gst.Sample.get_caps().

Free-function: gst_sample_unref

get_scope()[source]
Returns:The scope of self
Return type:Gst.TagScope

Gets the scope of self.

get_string(tag)[source]
Parameters:tag (str) – tag to read out
Returns:True, if a value was copied, False if the tag didn’t exist in the given list.
value:location for the result
Return type:(bool, value: 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.TagList.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 GLib.free when no longer needed. The returned string is also guaranteed to be non-None and non-empty.

Free-function: GLib.free

get_string_index(tag, index)[source]
Parameters:
  • tag (str) – tag to read out
  • index (int) – number of entry to read out
Returns:

True, if a value was copied, False if the tag didn’t exist in the given list.

value:location for the result

Return type:

(bool, value: 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 GLib.free when no longer needed. The returned string is also guaranteed to be non-None and non-empty.

Free-function: GLib.free

get_tag_size(tag)[source]
Parameters:tag (str) – the tag to query
Returns:The number of tags stored
Return type:int

Checks how many value are stored in this tag list for the given tag.

get_uint(tag)[source]
Parameters:tag (str) – tag to read out
Returns:True, if a value was copied, False if the tag didn’t exist in the given list.
value:location for the result
Return type:(bool, value: int)

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

get_uint64(tag)[source]
Parameters:tag (str) – tag to read out
Returns:True, if a value was copied, False if the tag didn’t exist in the given list.
value:location for the result
Return type:(bool, value: int)

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

get_uint64_index(tag, index)[source]
Parameters:
  • tag (str) – tag to read out
  • index (int) – number of entry to read out
Returns:

True, if a value was copied, False if the tag didn’t exist in the given list.

value:location for the result

Return type:

(bool, value: int)

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

get_uint_index(tag, index)[source]
Parameters:
  • tag (str) – tag to read out
  • index (int) – number of entry to read out
Returns:

True, if a value was copied, False if the tag didn’t exist in the given list.

value:location for the result

Return type:

(bool, value: int)

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

get_value_index(tag, index)[source]
Parameters:
  • tag (str) – tag to read out
  • index (int) – number of entry to read out
Returns:

The GObject.Value for the specified entry or None if the tag wasn’t available or the tag doesn’t have as many entries

Return type:

GObject.Value or None

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

insert(from_, mode)[source]
Parameters:

Inserts the tags of the from list into the first list using the given mode.

is_empty()[source]
Returns:True if the taglist is empty, otherwise False.
Return type:bool

Checks if the given taglist is empty.

is_equal(list2)[source]
Parameters:list2 (Gst.TagList) – a Gst.TagList.
Returns:True if the taglists are equal, otherwise False
Return type:bool

Checks if the two given taglists are equal.

merge(list2, mode)[source]
Parameters:
Returns:

the new list

Return type:

Gst.TagList or 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 are None, None is returned.

Free-function: gst_tag_list_unref

n_tags()[source]
Returns:The number of tags in self.
Return type:int

Get the number of tags in self.

nth_tag_name(index)[source]
Parameters:index (int) – the index
Returns:The name of the tag at index.
Return type:str

Get the name of the tag in self at index.

peek_string_index(tag, index)[source]
Parameters:
  • tag (str) – tag to read out
  • index (int) – number of entry to read out
Returns:

True, if a value was set, False if the tag didn’t exist in the given list.

value:location for the result

Return type:

(bool, value: 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-None and non-empty.

remove_tag(tag)[source]
Parameters:tag (str) – tag to remove

Removes the given tag from the taglist.

set_scope(scope)[source]
Parameters:scope (Gst.TagScope) – new scope for self

Sets the scope of self to scope. By default the scope of a taglist is stream scope.

to_string()[source]
Returns:a newly-allocated string, or None in case of an error. The string must be freed with GLib.free() when no longer needed.
Return type:str or None

Serializes a tag list to a string.