Package org.freedesktop.gstreamer.gst
Class Bus.Builder<B extends Bus.Builder<B>>
java.lang.Object
io.github.jwharm.javagi.gobject.Builder<B>
org.gnome.gobject.GObject.Builder<B>
org.gnome.gobject.InitiallyUnowned.Builder<B>
org.freedesktop.gstreamer.gst.GstObject.Builder<B>
org.freedesktop.gstreamer.gst.Bus.Builder<B>
- Type Parameters:
B
- the type of the Builder that is returned
- All Implemented Interfaces:
BuilderInterface
- Enclosing class:
Bus
Inner class implementing a builder pattern to construct a GObject with
properties.
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionbuild()
Finish building theBus
object.onMessage
(@Nullable String detail, Bus.MessageCallback handler) A message has been posted on the bus.onSyncMessage
(@Nullable String detail, Bus.SyncMessageCallback handler) A message has been posted on the bus.setEnableAsync
(boolean enableAsync) Enables async message delivery support for bus watches, gst_bus_pop() and similar API.Methods inherited from class org.freedesktop.gstreamer.gst.GstObject.Builder
onDeepNotify, setName, setParent
Methods inherited from class org.gnome.gobject.GObject.Builder
onNotify
Methods inherited from class io.github.jwharm.javagi.gobject.Builder
addBuilderProperty, connect, connect, connectSignals, getArena, getNames, getValues
-
Constructor Details
-
Builder
protected Builder()Default constructor for aBuilder
object.
-
-
Method Details
-
build
Finish building theBus
object. This will callGObject.withProperties(org.gnome.glib.Type, java.lang.String[], org.gnome.gobject.Value[])
to create a new GObject instance, which is then cast toBus
.- Overrides:
build
in classGstObject.Builder<B extends Bus.Builder<B>>
- Returns:
- a new instance of
Bus
with the properties that were set in the Builder object.
-
setEnableAsync
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 theenable-async
property- Returns:
- the
Builder
instance is returned, to allow method chaining
-
onMessage
A message has been posted on the bus. This signal is emitted from aGSource
added to the mainloop. this signal will only be emitted when there is aGMainLoop
running.- Parameters:
handler
- the signal handler- Returns:
- the
Builder
instance is returned, to allow method chaining - See Also:
-
onSyncMessage
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:
-