Gst.ChildProxy

g GObject.GInterface GObject.GInterface Gst.ChildProxy Gst.ChildProxy GObject.GInterface->Gst.ChildProxy

Implementations:

Gst.Bin

Methods

child_added (child, name)

child_removed (child, name)

get_child_by_index (index)

get_child_by_name (name)

get_child_by_name_recurse (name)

get_children_count ()

get_property (name)

lookup (name)

set_property (name, value)

Virtual Methods

do_child_added (child, name)

do_child_removed (child, name)

do_get_child_by_index (index)

do_get_child_by_name (name)

do_get_children_count ()

Properties

None

Signals

Name

Short Description

child-added

Will be emitted after the object was added to the child_proxy.

child-removed

Will be emitted after the object was removed from the child_proxy.

Fields

None

Class Details

class Gst.ChildProxy
Bases:

GObject.GInterface

Structure:

Gst.ChildProxyInterface

This interface abstracts handling of property sets for elements with children. Imagine elements such as mixers or polyphonic generators. They all have multiple Gst.Pad or some kind of voice objects. Another use case are container elements like Gst.Bin. The element implementing the interface acts as a parent for those child objects.

By implementing this interface the child properties can be accessed from the parent element by using gst_child_proxy_get() and gst_child_proxy_set().

Property names are written as child-name::property-name. The whole naming scheme is recursive. Thus child1::child2::property is valid too, if child1 and child2 implement the Gst.ChildProxy interface.

child_added(child, name)[source]
Parameters:
  • child (GObject.Object) – the newly added child

  • name (str) – the name of the new child

Emits the Gst.ChildProxy ::child-added signal.

child_removed(child, name)[source]
Parameters:
  • child (GObject.Object) – the removed child

  • name (str) – the name of the old child

Emits the Gst.ChildProxy ::child-removed signal.

get_child_by_index(index)[source]
Parameters:

index (int) – the child’s position in the child list

Returns:

the child object or None if not found (index too high).

Return type:

GObject.Object or None

Fetches a child by its number.

get_child_by_name(name)[source]
Parameters:

name (str) – the child’s name

Returns:

the child object or None if not found.

Return type:

GObject.Object or None

Looks up a child element by the given name.

This virtual method has a default implementation that uses Gst.Object together with Gst.Object.get_name(). If the interface is to be used with GObject.Objects, this methods needs to be overridden.

get_child_by_name_recurse(name)[source]
Parameters:

name (str) – the full-path child’s name

Returns:

the child object or None if not found.

Return type:

GObject.Object or None

Looks up a child element by the given full-path name.

Similar to Gst.ChildProxy.get_child_by_name(), this method searches and returns a child given a name. The difference is that this method allows a hierarchical path in the form of child1::child2:py:func:::child3<Gst.ChildProxy.signals.child3>. In the later example this method would return a reference to child3, if found. The name should be made of element names only and should not contain any property names.

New in version 1.22.

get_children_count()[source]
Returns:

the number of child objects

Return type:

int

Gets the number of child objects this parent contains.

get_property(name)[source]
Parameters:

name (str) – name of the property

Returns:

a GObject.Value that should take the result.

Return type:

value: GObject.Value

Gets a single property using the Gst.ChildProxy mechanism. You are responsible for freeing it by calling GObject.Value.unset()

lookup(name)[source]
Parameters:

name (str) – name of the property to look up

Returns:

True if target and pspec could be found. False otherwise. In that case the values for pspec and target are not modified. Unref target after usage. For plain GObject.Object target is the same as self.

target:

pointer to a GObject.Object that takes the real object to set property on

pspec:

pointer to take the GObject.ParamSpec describing the property

Return type:

(bool, target: GObject.Object, pspec: GObject.ParamSpec)

Looks up which object and GObject.ParamSpec would be effected by the given name.

set_property(name, value)[source]
Parameters:

Sets a single property using the Gst.ChildProxy mechanism.

do_child_added(child, name) virtual
Parameters:
  • child (GObject.Object) – the newly added child

  • name (str) – the name of the new child

Emits the Gst.ChildProxy ::child-added signal.

do_child_removed(child, name) virtual
Parameters:
  • child (GObject.Object) – the removed child

  • name (str) – the name of the old child

Emits the Gst.ChildProxy ::child-removed signal.

do_get_child_by_index(index) virtual
Parameters:

index (int) – the child’s position in the child list

Returns:

the child object or None if not found (index too high).

Return type:

GObject.Object or None

Fetches a child by its number.

do_get_child_by_name(name) virtual
Parameters:

name (str) – the child’s name

Returns:

the child object or None if not found.

Return type:

GObject.Object or None

Looks up a child element by the given name.

This virtual method has a default implementation that uses Gst.Object together with Gst.Object.get_name(). If the interface is to be used with GObject.Objects, this methods needs to be overridden.

do_get_children_count() virtual
Returns:

the number of child objects

Return type:

int

Gets the number of child objects this parent contains.

Signal Details

Gst.ChildProxy.signals.child_added(child_proxy, object, name)
Signal Name:

child-added

Flags:

RUN_FIRST

Parameters:

Will be emitted after the object was added to the child_proxy.

Gst.ChildProxy.signals.child_removed(child_proxy, object, name)
Signal Name:

child-removed

Flags:

RUN_FIRST

Parameters:

Will be emitted after the object was removed from the child_proxy.