GES.MetaContainer

g GES.MetaContainer GES.MetaContainer GObject.GInterface GObject.GInterface GObject.GInterface->GES.MetaContainer

Implementations

GES.Asset, GES.Layer, GES.Marker, GES.Timeline, GES.TimelineElement, GES.Track

Methods

add_metas_from_string (str)

check_meta_registered (meta_item)

foreach (func, *user_data)

get_boolean (meta_item)

get_date (meta_item)

get_date_time (meta_item)

get_double (meta_item)

get_float (meta_item)

get_int (meta_item)

get_int64 (meta_item)

get_marker_list (key)

get_meta (key)

get_string (meta_item)

get_uint (meta_item)

get_uint64 (meta_item)

metas_to_string ()

register_meta (flags, meta_item, value)

register_meta_boolean (flags, meta_item, value)

register_meta_date (flags, meta_item, value)

register_meta_date_time (flags, meta_item, value)

register_meta_double (flags, meta_item, value)

register_meta_float (flags, meta_item, value)

register_meta_int (flags, meta_item, value)

register_meta_int64 (flags, meta_item, value)

register_meta_string (flags, meta_item, value)

register_meta_uint (flags, meta_item, value)

register_meta_uint64 (flags, meta_item, value)

register_static_meta (flags, meta_item, type)

set_boolean (meta_item, value)

set_date (meta_item, value)

set_date_time (meta_item, value)

set_double (meta_item, value)

set_float (meta_item, value)

set_int (meta_item, value)

set_int64 (meta_item, value)

set_marker_list (meta_item, list)

set_meta (meta_item, value)

set_string (meta_item, value)

set_uint (meta_item, value)

set_uint64 (meta_item, value)

Virtual Methods

None

Properties

None

Signals

Name

Short Description

notify-meta

This is emitted for a meta container whenever the metadata under one of its fields changes, is set for the first time, or is removed.

Fields

None

Class Details

class GES.MetaContainer
Bases

GObject.GInterface

Structure

GES.MetaContainerInterface

A GObject.Object that implements GES.MetaContainer can have metadata set on it, that is data that is unimportant to its function within GES, but may hold some useful information. In particular, GES.MetaContainer.set_meta() can be used to store any GObject.Value under any generic field (specified by a string key). The same method can also be used to remove the field by passing None. A number of convenience methods are also provided to make it easier to set common value types. The metadata can then be read with GES.MetaContainer.get_meta() and similar convenience methods.

Registered Fields

By default, any GObject.Value can be set for a metadata field. However, you can register some fields as static, that is they only allow values of a specific type to be set under them, using GES.MetaContainer.register_meta() or GES.MetaContainer.register_static_meta(). The set GES.MetaFlag will determine whether the value can be changed, but even if it can be changed, it must be changed to a value of the same type.

Internally, some GES objects will be initialized with static metadata fields. These will correspond to some standard keys, such as GES.META_VOLUME.

add_metas_from_string(str)[source]
Parameters

str (str) – A string to deserialize and add to self

Returns

True if the fields in str was successfully deserialized and added to self.

Return type

bool

Deserializes the given string, and adds and sets the found fields and their values on the container. The string should be the return of GES.MetaContainer.metas_to_string().

check_meta_registered(meta_item)[source]
Parameters

meta_item (str) – The key for the self field to check

Returns

True if the meta_item field has been registered on self.

flags

A destination to get the registered flags of the field, or None to ignore

type

A destination to get the registered type of the field, or None to ignore

Return type

(bool, flags: GES.MetaFlag, type: GObject.GType)

Checks whether the specified field has been registered as static, and gets the registered type and flags of the field, as used in GES.MetaContainer.register_meta() and GES.MetaContainer.register_static_meta().

foreach(func, *user_data)[source]
Parameters
  • func (GES.MetaForeachFunc) – A function to call on each of self's set metadata fields

  • user_data (object or None) – User data to send to func

Calls the given function on each of the meta container’s set metadata fields.

get_boolean(meta_item)[source]
Parameters

meta_item (str) – The key for the self field to get

Returns

True if the boolean value under meta_item was copied to dest.

dest

Destination into which the value under meta_item should be copied.

Return type

(bool, dest: bool)

Gets the current boolean value of the specified field of the meta container. If the field does not have a set value, or it is of the wrong type, the method will fail.

get_date(meta_item)[source]
Parameters

meta_item (str) – The key for the self field to get

Returns

True if the date value under meta_item was copied to dest.

dest

Destination into which the value under meta_item should be copied.

Return type

(bool, dest: GLib.Date)

Gets the current date value of the specified field of the meta container. If the field does not have a set value, or it is of the wrong type, the method will fail.

get_date_time(meta_item)[source]
Parameters

meta_item (str) – The key for the self field to get

Returns

True if the date time value under meta_item was copied to dest.

dest

Destination into which the value under meta_item should be copied.

Return type

(bool, dest: Gst.DateTime)

Gets the current date time value of the specified field of the meta container. If the field does not have a set value, or it is of the wrong type, the method will fail.

get_double(meta_item)[source]
Parameters

meta_item (str) – The key for the self field to get

Returns

True if the double value under meta_item was copied to dest.

dest

Destination into which the value under meta_item should be copied.

Return type

(bool, dest: float)

Gets the current double value of the specified field of the meta container. If the field does not have a set value, or it is of the wrong type, the method will fail.

get_float(meta_item)[source]
Parameters

meta_item (str) – The key for the self field to get

Returns

True if the float value under meta_item was copied to dest.

dest

Destination into which the value under meta_item should be copied.

Return type

(bool, dest: float)

Gets the current float value of the specified field of the meta container. If the field does not have a set value, or it is of the wrong type, the method will fail.

get_int(meta_item)[source]
Parameters

meta_item (str) – The key for the self field to get

Returns

True if the int value under meta_item was copied to dest.

dest

Destination into which the value under meta_item should be copied.

Return type

(bool, dest: int)

Gets the current int value of the specified field of the meta container. If the field does not have a set value, or it is of the wrong type, the method will fail.

get_int64(meta_item)[source]
Parameters

meta_item (str) – The key for the self field to get

Returns

True if the int64 value under meta_item was copied to dest.

dest

Destination into which the value under meta_item should be copied.

Return type

(bool, dest: int)

Gets the current int64 value of the specified field of the meta container. If the field does not have a set value, or it is of the wrong type, the method will fail.

get_marker_list(key)[source]
Parameters

key (str) – The key for the self field to get

Returns

A copy of the marker list value under key, or None if it could not be fetched.

Return type

GES.MarkerList or None

Gets the current marker list value of the specified field of the meta container. If the field does not have a set value, or it is of the wrong type, the method will fail.

New in version 1.18.

get_meta(key)[source]
Parameters

key (str) – The key for the self field to get

Returns

The value under key, or None if self does not have the field set.

Return type

GObject.Value or None

Gets the current value of the specified field of the meta container.

get_string(meta_item)[source]
Parameters

meta_item (str) – The key for the self field to get

Returns

The string value under meta_item, or None if it could not be fetched.

Return type

str or None

Gets the current string value of the specified field of the meta container. If the field does not have a set value, or it is of the wrong type, the method will fail.

get_uint(meta_item)[source]
Parameters

meta_item (str) – The key for the self field to get

Returns

True if the uint value under meta_item was copied to dest.

dest

Destination into which the value under meta_item should be copied.

Return type

(bool, dest: int)

Gets the current uint value of the specified field of the meta container. If the field does not have a set value, or it is of the wrong type, the method will fail.

get_uint64(meta_item)[source]
Parameters

meta_item (str) – The key for the self field to get

Returns

True if the uint64 value under meta_item was copied to dest.

dest

Destination into which the value under meta_item should be copied.

Return type

(bool, dest: int)

Gets the current uint64 value of the specified field of the meta container. If the field does not have a set value, or it is of the wrong type, the method will fail.

metas_to_string()[source]
Returns

A serialized self.

Return type

str

Serializes the set metadata fields of the meta container to a string.

register_meta(flags, meta_item, value)[source]
Parameters
  • flags (GES.MetaFlag) – Flags to be used for the registered field

  • meta_item (str) – The key for the self field to register

  • value (GObject.Value) – The value to set for the registered field

Returns

True if the meta_item field was successfully registered on self to only hold value types, with the given flags, and the field was successfully set to value.

Return type

bool

Sets the value of the specified field of the meta container to the given value, and registers the field to only hold a value of the same type. After calling this, only values of the same type as value can be set for this field. The given flags can be set to make this field only readable after calling this method.

register_meta_boolean(flags, meta_item, value)[source]
Parameters
  • flags (GES.MetaFlag) – Flags to be used for the registered field

  • meta_item (str) – The key for the self field to register

  • value (bool) – The value to set for the registered field

Returns

True if the meta_item field was successfully registered on self to only hold boolean typed values, with the given flags, and the field was successfully set to value.

Return type

bool

Sets the value of the specified field of the meta container to the given boolean value, and registers the field to only hold a boolean typed value. After calling this, only boolean values can be set for this field. The given flags can be set to make this field only readable after calling this method.

register_meta_date(flags, meta_item, value)[source]
Parameters
  • flags (GES.MetaFlag) – Flags to be used for the registered field

  • meta_item (str) – The key for the self field to register

  • value (GLib.Date) – The value to set for the registered field

Returns

True if the meta_item field was successfully registered on self to only hold date typed values, with the given flags, and the field was successfully set to value.

Return type

bool

Sets the value of the specified field of the meta container to the given date value, and registers the field to only hold a date typed value. After calling this, only date values can be set for this field. The given flags can be set to make this field only readable after calling this method.

register_meta_date_time(flags, meta_item, value)[source]
Parameters
  • flags (GES.MetaFlag) – Flags to be used for the registered field

  • meta_item (str) – The key for the self field to register

  • value (Gst.DateTime) – The value to set for the registered field

Returns

True if the meta_item field was successfully registered on self to only hold date time typed values, with the given flags, and the field was successfully set to value.

Return type

bool

Sets the value of the specified field of the meta container to the given date time value, and registers the field to only hold a date time typed value. After calling this, only date time values can be set for this field. The given flags can be set to make this field only readable after calling this method.

register_meta_double(flags, meta_item, value)[source]
Parameters
  • flags (GES.MetaFlag) – Flags to be used for the registered field

  • meta_item (str) – The key for the self field to register

  • value (float) – The value to set for the registered field

Returns

True if the meta_item field was successfully registered on self to only hold double typed values, with the given flags, and the field was successfully set to value.

Return type

bool

Sets the value of the specified field of the meta container to the given double value, and registers the field to only hold a double typed value. After calling this, only double values can be set for this field. The given flags can be set to make this field only readable after calling this method.

register_meta_float(flags, meta_item, value)[source]
Parameters
  • flags (GES.MetaFlag) – Flags to be used for the registered field

  • meta_item (str) – The key for the self field to register

  • value (float) – The value to set for the registered field

Returns

True if the meta_item field was successfully registered on self to only hold float typed values, with the given flags, and the field was successfully set to value.

Return type

bool

Sets the value of the specified field of the meta container to the given float value, and registers the field to only hold a float typed value. After calling this, only float values can be set for this field. The given flags can be set to make this field only readable after calling this method.

register_meta_int(flags, meta_item, value)[source]
Parameters
  • flags (GES.MetaFlag) – Flags to be used for the registered field

  • meta_item (str) – The key for the self field to register

  • value (int) – The value to set for the registered field

Returns

True if the meta_item field was successfully registered on self to only hold int typed values, with the given flags, and the field was successfully set to value.

Return type

bool

Sets the value of the specified field of the meta container to the given int value, and registers the field to only hold an int typed value. After calling this, only int values can be set for this field. The given flags can be set to make this field only readable after calling this method.

register_meta_int64(flags, meta_item, value)[source]
Parameters
  • flags (GES.MetaFlag) – Flags to be used for the registered field

  • meta_item (str) – The key for the self field to register

  • value (int) – The value to set for the registered field

Returns

True if the meta_item field was successfully registered on self to only hold int64 typed values, with the given flags, and the field was successfully set to value.

Return type

bool

Sets the value of the specified field of the meta container to the given int64 value, and registers the field to only hold an int64 typed value. After calling this, only int64 values can be set for this field. The given flags can be set to make this field only readable after calling this method.

register_meta_string(flags, meta_item, value)[source]
Parameters
  • flags (GES.MetaFlag) – Flags to be used for the registered field

  • meta_item (str) – The key for the self field to register

  • value (str) – The value to set for the registered field

Returns

True if the meta_item field was successfully registered on self to only hold string typed values, with the given flags, and the field was successfully set to value.

Return type

bool

Sets the value of the specified field of the meta container to the given string value, and registers the field to only hold a string typed value. After calling this, only string values can be set for this field. The given flags can be set to make this field only readable after calling this method.

register_meta_uint(flags, meta_item, value)[source]
Parameters
  • flags (GES.MetaFlag) – Flags to be used for the registered field

  • meta_item (str) – The key for the self field to register

  • value (int) – The value to set for the registered field

Returns

True if the meta_item field was successfully registered on self to only hold uint typed values, with the given flags, and the field was successfully set to value.

Return type

bool

Sets the value of the specified field of the meta container to the given uint value, and registers the field to only hold a uint typed value. After calling this, only uint values can be set for this field. The given flags can be set to make this field only readable after calling this method.

register_meta_uint64(flags, meta_item, value)[source]
Parameters
  • flags (GES.MetaFlag) – Flags to be used for the registered field

  • meta_item (str) – The key for the self field to register

  • value (int) – The value to set for the registered field

Returns

True if the meta_item field was successfully registered on self to only hold uint64 typed values, with the given flags, and the field was successfully set to value.

Return type

bool

Sets the value of the specified field of the meta container to the given uint64 value, and registers the field to only hold a uint64 typed value. After calling this, only uint64 values can be set for this field. The given flags can be set to make this field only readable after calling this method.

register_static_meta(flags, meta_item, type)[source]
Parameters
  • flags (GES.MetaFlag) – Flags to be used for the registered field

  • meta_item (str) – The key for the self field to register

  • type (GObject.GType) – The required value type for the registered field

Returns

True if the meta_item field was successfully registered on self to only hold type values, with the given flags.

Return type

bool

Registers a static metadata field on the container to only hold the specified type. After calling this, setting a value under this field can only succeed if its type matches the registered type of the field.

Unlike GES.MetaContainer.register_meta(), no (initial) value is set for this field, which means you can use this method to reserve the space to be _optionally_ set later.

Note that if a value has already been set for the field being registered, then its type must match the registering type, and its value will be left in place. If the field has no set value, then you will likely want to include GES.MetaFlag.WRITABLE in flags to allow the value to be set later.

New in version 1.18.

set_boolean(meta_item, value)[source]
Parameters
  • meta_item (str) – The key for the self field to set

  • value (bool) – The value to set under meta_item

Returns

True if value was set under meta_item for self.

Return type

bool

Sets the value of the specified field of the meta container to the given boolean value.

set_date(meta_item, value)[source]
Parameters
  • meta_item (str) – The key for the self field to set

  • value (GLib.Date) – The value to set under meta_item

Returns

True if value was set under meta_item for self.

Return type

bool

Sets the value of the specified field of the meta container to the given date value.

set_date_time(meta_item, value)[source]
Parameters
  • meta_item (str) – The key for the self field to set

  • value (Gst.DateTime) – The value to set under meta_item

Returns

True if value was set under meta_item for self.

Return type

bool

Sets the value of the specified field of the meta container to the given date time value.

set_double(meta_item, value)[source]
Parameters
  • meta_item (str) – The key for the self field to set

  • value (float) – The value to set under meta_item

Returns

True if value was set under meta_item for self.

Return type

bool

Sets the value of the specified field of the meta container to the given double value.

set_float(meta_item, value)[source]
Parameters
  • meta_item (str) – The key for the self field to set

  • value (float) – The value to set under meta_item

Returns

True if value was set under meta_item for self.

Return type

bool

Sets the value of the specified field of the meta container to the given float value.

set_int(meta_item, value)[source]
Parameters
  • meta_item (str) – The key for the self field to set

  • value (int) – The value to set under meta_item

Returns

True if value was set under meta_item for self.

Return type

bool

Sets the value of the specified field of the meta container to the given int value.

set_int64(meta_item, value)[source]
Parameters
  • meta_item (str) – The key for the self field to set

  • value (int) – The value to set under meta_item

Returns

True if value was set under meta_item for self.

Return type

bool

Sets the value of the specified field of the meta container to the given int64 value.

set_marker_list(meta_item, list)[source]
Parameters
  • meta_item (str) – The key for the self field to set

  • list (GES.MarkerList) – The value to set under meta_item

Returns

True if value was set under meta_item for self.

Return type

bool

Sets the value of the specified field of the meta container to the given marker list value.

New in version 1.18.

set_meta(meta_item, value)[source]
Parameters
  • meta_item (str) – The key for the self field to set

  • value (GObject.Value or None) – The value to set under meta_item, or None to remove the corresponding field

Returns

True if value was set under meta_item for self.

Return type

bool

Sets the value of the specified field of the meta container to a copy of the given value. If the given value is None, the field given by meta_item is removed and True is returned.

set_string(meta_item, value)[source]
Parameters
  • meta_item (str) – The key for the self field to set

  • value (str) – The value to set under meta_item

Returns

True if value was set under meta_item for self.

Return type

bool

Sets the value of the specified field of the meta container to the given string value.

set_uint(meta_item, value)[source]
Parameters
  • meta_item (str) – The key for the self field to set

  • value (int) – The value to set under meta_item

Returns

True if value was set under meta_item for self.

Return type

bool

Sets the value of the specified field of the meta container to the given uint value.

set_uint64(meta_item, value)[source]
Parameters
  • meta_item (str) – The key for the self field to set

  • value (int) – The value to set under meta_item

Returns

True if value was set under meta_item for self.

Return type

bool

Sets the value of the specified field of the meta container to the given uint64 value.

Signal Details

GES.MetaContainer.signals.notify_meta(meta_container, key, value)
Signal Name

notify-meta

Flags

RUN_FIRST, NO_RECURSE, DETAILED, NO_HOOKS

Parameters
  • meta_container (GES.MetaContainer) – The object which received the signal

  • key (str) – The key for the container field that changed

  • value (GObject.Value or None) – The new value under key

This is emitted for a meta container whenever the metadata under one of its fields changes, is set for the first time, or is removed. In the latter case, value will be None.