|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.gstreamer.Gst
public final class Gst
Media library supporting arbitrary formats and filter graphs.
Method Summary | |
---|---|
static void |
addStaticShutdownTask(java.lang.Runnable task)
Adds a task to be called when deinit() is called. |
static void |
deinit()
Undoes all the initialization done in init() . |
static java.util.concurrent.Executor |
getExecutor()
Gets the common Executor used to execute background tasks. |
static java.util.concurrent.ExecutorService |
getExecutorService()
Gets the common ExecutorService used to execute background tasks. |
static GMainContext |
getMainContext()
Gets the current main context used (if any). |
static java.util.concurrent.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 java.lang.String |
getVersionString()
Gets the the version of gstreamer currently in use, as a String. |
static void |
init()
Initializes the GStreamer library. |
static java.lang.String[] |
init(java.lang.String progname,
java.lang.String[] args)
Initializes the GStreamer library. |
static void |
invokeAndWait(java.lang.Runnable task)
Executes a task on the gstreamer background Executor , waiting until the task completes
before returning. |
static void |
invokeLater(java.lang.Runnable task)
Schedules a task for execution on the gstreamer background Executor . |
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 |
setUseDefaultContext(boolean useDefault)
Instructs gstreamer-java to use the default main context. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Method Detail |
---|
public static Version getVersion()
public static java.lang.String getVersionString()
public static java.util.concurrent.Executor getExecutor()
Executor
used to execute background tasks.
public static java.util.concurrent.ExecutorService getExecutorService()
ExecutorService
used to execute background tasks.
public static java.util.concurrent.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(java.lang.Runnable task)
Executor
.
task
- the task to execute.public static void invokeAndWait(java.lang.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 java.lang.String[] init(java.lang.String progname, java.lang.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(java.lang.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.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |