Class Bus.Builder<B extends Bus.Builder<B>>

Type Parameters:
B - the type of the Builder that is returned
All Implemented Interfaces:
BuilderInterface
Enclosing class:
Bus

public static class Bus.Builder<B extends Bus.Builder<B>> extends GstObject.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 Bus build()
      Finish building the Bus object. This will call GObject.withProperties(Type, String[], Value[]) to create a new GObject instance, which is then cast to Bus.
      Overrides:
      build in class GstObject.Builder<B extends Bus.Builder<B>>
      Returns:
      a new instance of Bus with the properties that were set in the Builder object.
    • setEnableAsync

      public B setEnableAsync(boolean enableAsync)

      Enables async message delivery support for bus watches, gst_bus_pop() and similar API. Without this only the synchronous message handlers are called.

      This property is used to create the child element buses in GstBin.

      Parameters:
      enableAsync - the value for the enable-async property
      Returns:
      the Builder instance is returned, to allow method chaining
    • onMessage

      public B onMessage(@Nullable String detail, Bus.MessageCallback handler)
      A message has been posted on the bus. This signal is emitted from a GSource added to the mainloop. this signal will only be emitted when there is a GMainLoop running.
      Parameters:
      handler - the signal handler
      Returns:
      the Builder instance is returned, to allow method chaining
      See Also:
    • onSyncMessage

      public B onSyncMessage(@Nullable String detail, Bus.SyncMessageCallback handler)

      A message has been posted on the bus. This signal is emitted from the thread that posted the message so one has to be careful with locking.

      This signal will not be emitted by default, you have to call gst_bus_enable_sync_message_emission() before.

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