Module: Gst::ChildProxy

Defined in:
(unknown)

Overview

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.

Instance Method Summary collapse

Instance Method Details

#child_added(child, name) ⇒ nil

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

Parameters:

  • child (GObject::Object)

    the newly added child

  • name (String)

    the name of the new child

Returns:

  • (nil)

#child_removed(child, name) ⇒ nil

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

Parameters:

  • child (GObject::Object)

    the removed child

  • name (String)

    the name of the old child

Returns:

  • (nil)

#children_countInteger

Gets the number of child objects this parent contains.

Returns:

  • (Integer)

    the number of child objects

#get(first_property_name, array) ⇒ nil

Gets properties of the parent object and its children.

Parameters:

  • first_property_name (String)

    name of the first property to get

  • array (Array)

    return location for the first property, followed optionally by more name/return location pairs, followed by nil

Returns:

  • (nil)

#get_child_by_index(index) ⇒ GObject::Object

Fetches a child by its number.

Parameters:

  • index (Integer)

    the child's position in the child list

Returns:

  • (GObject::Object)

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

#get_child_by_name(name) ⇒ GObject::Object

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
#GObjects, this methods needs to be overridden.

Parameters:

  • name (String)

    the child's name

Returns:

  • (GObject::Object)

    the child object or nil if
    not found.

#get_child_by_name_recurse(name) ⇒ GObject::Object

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

Similar to gst_child_proxy_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::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.

Parameters:

  • name (String)

    the full-path child's name

Returns:

  • (GObject::Object)

    the child object or nil if
    not found.

#get_property(name, value) ⇒ nil

Gets a single property using the GstChildProxy mechanism.
You are responsible for freeing it by calling g_value_unset()

Parameters:

  • name (String)

    name of the property

  • value (GObject::Value)

    a #GValue that should take the result.

Returns:

  • (nil)

#get_valist(first_property_name, var_args) ⇒ nil

Gets properties of the parent object and its children.

Parameters:

  • first_property_name (String)

    name of the first property to get

  • var_args (Gst::va_list)

    return location for the first property, followed optionally by more name/return location pairs, followed by nil

Returns:

  • (nil)

#lookup(name, target, pspec) ⇒ Boolean

Looks up which object and GParam::Spec would be effected by the given name.
case the values for pspec and target are not modified. Unref target after
usage. For plain #GObject target is the same as object.

Parameters:

  • name (String)

    name of the property to look up

  • target (GObject::Object)

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

  • pspec (GObject::ParamSpec)

    pointer to take the GParam::Spec
    describing the property

Returns:

  • (Boolean)

    true if target and pspec could be found. false otherwise. In that

#set(first_property_name, array) ⇒ nil

Sets properties of the parent object and its children.

Parameters:

  • first_property_name (String)

    name of the first property to set

  • array (Array)

    value for the first property, followed optionally by more name/value pairs, followed by nil

Returns:

  • (nil)

#set_property(name, value) ⇒ nil

Sets a single property using the GstChildProxy mechanism.

Parameters:

  • name (String)

    name of the property to set

  • value (GObject::Value)

    new #GValue for the property

Returns:

  • (nil)

#set_valist(first_property_name, var_args) ⇒ nil

Sets properties of the parent object and its children.

Parameters:

  • first_property_name (String)

    name of the first property to set

  • var_args (Gst::va_list)

    value for the first property, followed optionally by more name/value pairs, followed by nil

Returns:

  • (nil)