org.gstreamer
public final class Gst extends Object
Modifier and Type | Class and Description |
---|---|
static class |
Gst.NativeArgs |
Modifier and Type | Method and Description |
---|---|
static void |
addStaticShutdownTask(Runnable task)
Adds a task to be called when
deinit() is called. |
static void |
deinit()
Undoes all the initialization done in
init() . |
static Executor |
getExecutor()
Gets the common
Executor used to execute background tasks. |
static ExecutorService |
getExecutorService()
Gets the common
ExecutorService used to execute background tasks. |
static GMainContext |
getMainContext()
Gets the current main context used (if any).
|
static ScheduledExecutorService |
getScheduledExecutorService()
Gets the common
ScheduledExecutorService used to execute
background tasks and schedule timeouts. |
static Version |
getVersion()
Gets the version of gstreamer currently in use.
|
static String |
getVersionString()
Gets the the version of gstreamer currently in use, as a String.
|
static void |
init()
Initializes the GStreamer library.
|
static String[] |
init(String progname,
String[] args)
Initializes the GStreamer library.
|
static void |
invokeAndWait(Runnable task)
Executes a task on the gstreamer background
Executor , waiting until the task completes
before returning. |
static void |
invokeLater(Runnable task)
Schedules a task for execution on the gstreamer background
Executor . |
static boolean |
isInitialized()
Test whether the GStreamer library already initialized.
|
static boolean |
isSegTrapEnabled()
Get Segmentation Trap status.
|
static void |
main()
Waits for the gstreamer system to shutdown via a call to
quit . |
static void |
quit()
Signals the thread that called
init() to return. |
static void |
registerClass(Class<? extends NativeObject> cls) |
static void |
setSegTrap(boolean enabled)
Set Segmentation Trap status.
|
static void |
setUseDefaultContext(boolean useDefault)
Instructs gstreamer-java to use the default main context.
|
public static Version getVersion()
public static String getVersionString()
public static boolean isSegTrapEnabled()
public static void setSegTrap(boolean enabled)
enabled
- public static final boolean isInitialized()
public static Executor getExecutor()
Executor
used to execute background tasks.public static ExecutorService getExecutorService()
ExecutorService
used to execute background tasks.public static ScheduledExecutorService getScheduledExecutorService()
ScheduledExecutorService
used to execute
background tasks and schedule timeouts.public static void quit()
init()
to return.public static void main()
quit
.
For most gui programs, this is of little use. However, it can be a convenient way of keeping the main thread alive whilst gstreamer processing on other threads continues.
public static void invokeLater(Runnable task)
Executor
.task
- the task to execute.public static void invokeAndWait(Runnable task)
Executor
, waiting until the task completes
before returning.task
- the task to execute.public static GMainContext getMainContext()
public static final void init() throws GstException
This is a shortcut if no arguments are to be passed to gstreamer.
GstException
public static final String[] init(String progname, String[] args) throws GstException
This sets up internal path lists, registers built-in elements, and loads standard plugins.
This method should be called before calling any other GLib functions. If this is not an option, your program must initialise the GLib thread system using g_thread_init() before any other GLib functions are called.
Note:
This method will throw a GstException if it fails.
progname
- the java program name.args
- the java argument list.GstException
public static final void deinit()
init()
.
This will run any cleanup tasks, terminate any timers and other asynchronous tasks, and de-initialize the gstreamer library.
public static void addStaticShutdownTask(Runnable task)
deinit()
is called.
This is used internally, and is not recommended for other uses.
task
- the task to execute.public static void setUseDefaultContext(boolean useDefault)
This may be useful if integration with the GTK main loop is desirable,
as all Bus
signals and timers will be executed in the context
of the GTK main loop.
For the majority of programs though, it is better to wrap the individual listeners in a proxy which executes the listener in the appropriate context.
useDefault
- if true, use the default glib main context.public static void registerClass(Class<? extends NativeObject> cls)
Copyright © 2014. All rights reserved.