Class Bin.Builder<B extends Bin.Builder<B>>

Type Parameters:
B - the type of the Builder that is returned
All Implemented Interfaces:
BuilderInterface
Direct Known Subclasses:
Pipeline.Builder
Enclosing class:
Bin

public static class Bin.Builder<B extends Bin.Builder<B>> extends Element.Builder<B>
Inner class implementing a builder pattern to construct a GObject with properties.
  • Constructor Details

    • Builder

      protected Builder()
      Default constructor for a Builder object.
  • Method Details

    • build

      public Bin build()
      Finish building the Bin object. This will call GObject.withProperties(Type, String[], Value[]) to create a new GObject instance, which is then cast to Bin.
      Overrides:
      build in class Element.Builder<B extends Bin.Builder<B>>
      Returns:
      a new instance of Bin with the properties that were set in the Builder object.
    • setAsyncHandling

      public B setAsyncHandling(boolean asyncHandling)
      If set to true, the bin will handle asynchronous state changes. This should be used only if the bin subclass is modifying the state of its children on its own.
      Parameters:
      asyncHandling - the value for the async-handling property
      Returns:
      the Builder instance is returned, to allow method chaining
    • setMessageForward

      public B setMessageForward(boolean messageForward)

      Forward all children messages, even those that would normally be filtered by the bin. This can be interesting when one wants to be notified of the EOS state of individual elements, for example.

      The messages are converted to an ELEMENT message with the bin as the source. The structure of the message is named GstBinForwarded and contains a field named message that contains the original forwarded GstMessage.

      Parameters:
      messageForward - the value for the message-forward property
      Returns:
      the Builder instance is returned, to allow method chaining
    • onDeepElementAdded

      public B onDeepElementAdded(Bin.DeepElementAddedCallback handler)
      Will be emitted after the element was added to subBin.
      Parameters:
      handler - the signal handler
      Returns:
      the Builder instance is returned, to allow method chaining
      Since:
      1.10
      See Also:
    • onDeepElementRemoved

      public B onDeepElementRemoved(Bin.DeepElementRemovedCallback handler)
      Will be emitted after the element was removed from subBin.
      Parameters:
      handler - the signal handler
      Returns:
      the Builder instance is returned, to allow method chaining
      Since:
      1.10
      See Also:
    • onDoLatency

      public B onDoLatency(Bin.DoLatencyCallback handler)

      Will be emitted when the bin needs to perform latency calculations. This signal is only emitted for toplevel bins or when GstBin:async-handling is enabled.

      Only one signal handler is invoked. If no signals are connected, the default handler is invoked, which will query and distribute the lowest possible latency to all sinks.

      Connect to this signal if the default latency calculations are not sufficient, like when you need different latencies for different sinks in the same pipeline.

      Parameters:
      handler - the signal handler
      Returns:
      the Builder instance is returned, to allow method chaining
      See Also:
    • onElementAdded

      public B onElementAdded(Bin.ElementAddedCallback handler)
      Will be emitted after the element was added to the bin.
      Parameters:
      handler - the signal handler
      Returns:
      the Builder instance is returned, to allow method chaining
      See Also:
    • onElementRemoved

      public B onElementRemoved(Bin.ElementRemovedCallback handler)
      Will be emitted after the element was removed from the bin.
      Parameters:
      handler - the signal handler
      Returns:
      the Builder instance is returned, to allow method chaining
      See Also: