public class MainLoop extends RefCountedObject
NativeObject.Initializer
defaultInit, LIFECYCLE, ownsHandle
Constructor and Description |
---|
MainLoop()
Creates a new instance of
MainLoop |
MainLoop(NativeObject.Initializer init)
Creates a new instance of
MainLoop |
Modifier and Type | Method and Description |
---|---|
protected void |
disposeNativeHandle(com.sun.jna.Pointer ptr)
Frees the native
GMainLoop |
GMainContext |
getMainContext()
Gets the main context for this main loop.
|
void |
invokeAndWait(java.lang.Runnable r)
Invokes a task on the main loop thread.
|
void |
invokeLater(java.lang.Runnable r)
Invokes a task on the main loop thread.
|
boolean |
isRunning()
Returns whether this main loop is currently processing or not.
|
void |
quit()
Instructs a main loop to stop processing and return from
run() . |
protected void |
ref()
Increases the reference count on the native
GMainLoop |
void |
run()
Enter a loop, processing all events.
|
void |
startInBackground()
Runs the main loop in a background thread.
|
protected void |
unref()
Decreases the reference count on the native
GMainLoop |
classFor, disown, dispose, equals, finalize, getNativeAddress, handle, hashCode, initializer, initializer, instanceFor, invalidate, isDisposed, nativeValue, objectFor, objectFor, objectFor, objectFor, toString
public MainLoop()
MainLoop
This will create a new main loop on the default gstreamer main context.
public MainLoop(NativeObject.Initializer init)
MainLoop
This variant is used internally.
init
- internal initialization data.public void quit()
run()
.public void run()
The loop will continue processing events until quit()
is
called.
public boolean isRunning()
public GMainContext getMainContext()
public void startInBackground()
public void invokeAndWait(java.lang.Runnable r)
This method will wait until the task has completed before returning.
r
- the task to invoke.public void invokeLater(java.lang.Runnable r)
This method returns immediately, without waiting for the task to complete.
r
- the task to invoke.protected void ref()
GMainLoop
ref
in class RefCountedObject
protected void unref()
GMainLoop
unref
in class RefCountedObject
protected void disposeNativeHandle(com.sun.jna.Pointer ptr)
GMainLoop
disposeNativeHandle
in class NativeObject