Interface ChildProxy

All Superinterfaces:
Proxy
All Known Implementing Classes:
Bin, ChildProxy.ChildProxy$Impl, Pipeline

@Generated("org.javagi.JavaGI") public interface ChildProxy extends Proxy

This interface abstracts handling of property sets for elements with children. Imagine elements such as mixers or polyphonic generators. They all have multiple GstPad or some kind of voice objects. Another use case are container elements like GstBin. 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 GstChildProxy interface.

  • Method Details

    • getType

      static @Nullable Type getType()
      Get the GType of the ChildProxy class.
      Returns:
      the GType
    • childAdded

      default void childAdded(GObject child, String name)
      Emits the GstChildProxy::child-added signal.
      Parameters:
      child - the newly added child
      name - the name of the new child
    • childRemoved

      default void childRemoved(GObject child, String name)
      Emits the GstChildProxy::child-removed signal.
      Parameters:
      child - the removed child
      name - the name of the old child
    • get

      default void get(String firstPropertyName, Object... varargs)
      Gets properties of the parent object and its children.
      Parameters:
      firstPropertyName - name of the first property to get
      varargs - return location for the first property, followed optionally by more name/return location pairs, followed by null
    • getChildByIndex

      default @Nullable GObject getChildByIndex(int index)
      Fetches a child by its number.
      Parameters:
      index - the child's position in the child list
      Returns:
      the child object or null if not found (index too high).
    • getChildByName

      default @Nullable GObject getChildByName(String name)

      Looks up a child element by the given name.

      This virtual method has a default implementation that uses GstObject together with gst_object_get_name(). If the interface is to be used with GObjects, this methods needs to be overridden.

      Parameters:
      name - the child's name
      Returns:
      the child object or null if not found.
    • getChildByNameRecurse

      default @Nullable GObject getChildByNameRecurse(String name)

      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 - the full-path child's name
      Returns:
      the child object or null if not found.
      Since:
      1.22
    • getChildrenCount

      default int getChildrenCount()
      Gets the number of child objects this parent contains.
      Returns:
      the number of child objects
    • getProperty

      default void getProperty(String name, Value value)
      Gets a single property using the GstChildProxy mechanism. You are responsible for freeing it by calling g_value_unset()
      Parameters:
      name - name of the property
      value - a GValue that should take the result.
    • lookup

      default boolean lookup(String name, @Nullable Out<GObject> target, @Nullable Out<ParamSpec> pspec)
      Looks up which object and GParamSpec would be effected by the given name.
      Parameters:
      name - name of the property to look up
      target - pointer to a GObject that takes the real object to set property on
      pspec - pointer to take the GParamSpec describing the property
      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 target is the same as object.
    • set

      default void set(String firstPropertyName, Object... varargs)
      Sets properties of the parent object and its children.
      Parameters:
      firstPropertyName - name of the first property to set
      varargs - value for the first property, followed optionally by more name/value pairs, followed by null
    • setProperty

      default void setProperty(String name, Value value)
      Sets a single property using the GstChildProxy mechanism.
      Parameters:
      name - name of the property to set
      value - new GValue for the property
    • onChildAdded

      Will be emitted after the object was added to the childProxy.
      Parameters:
      handler - the signal handler
      Returns:
      a signal handler ID to keep track of the signal connection
      See Also:
    • emitChildAdded

      default void emitChildAdded(@Nullable GObject object, String name)
      Emits the "child-added" signal. See onChildAdded(ChildProxy.ChildAddedCallback).
    • onChildRemoved

      Will be emitted after the object was removed from the childProxy.
      Parameters:
      handler - the signal handler
      Returns:
      a signal handler ID to keep track of the signal connection
      See Also:
    • emitChildRemoved

      default void emitChildRemoved(@Nullable GObject object, String name)
      Emits the "child-removed" signal. See onChildRemoved(ChildProxy.ChildRemovedCallback).