public final class Gst extends Object
| Modifier and Type | Class and Description |
|---|---|
static interface |
Gst.Since
Annotation on classes, methods or fields to show the required GStreamer
version.
|
static class |
Gst.Types |
| Modifier and Type | Method and Description |
|---|---|
static void |
checkVersion(int major,
int minor)
Checks that the version of GStreamer requested in init() satisfies the
given version or throws an exception.
|
static void |
deinit()
Clean up any resources created by GStreamer in
init(org.freedesktop.gstreamer.Version). |
static ScheduledExecutorService |
getExecutor()
Gets the common
ScheduledExecutorService used to execute
background tasks and schedule timeouts. |
static GMainContext |
getMainContext()
Gets the current main context used (if any).
|
static Version |
getVersion()
Gets the version of gstreamer currently available.
|
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 |
init(Version requiredVersion)
Initializes the GStreamer library.
|
static String[] |
init(Version requestedVersion,
String progname,
String... args)
Initializes the GStreamer library.
|
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()
Some functions in the GStreamer core might install a custom SIGSEGV
handler to better catch and report errors to the application.
|
static void |
main()
Waits for the gstreamer system to shutdown via a call to
quit. |
static Bin |
parseBinFromDescription(String binDescription,
boolean ghostUnlinkedPads)
Creates a bin from a text bin description.
|
static Bin |
parseBinFromDescription(String binDescription,
boolean ghostUnlinkedPads,
List<GError> errors)
Creates a bin from a text bin description.
|
static Element |
parseLaunch(String pipelineDescription)
Create a new pipeline based on command line syntax.
|
static Element |
parseLaunch(String[] pipelineDescription)
Create a new element based on command line syntax.
|
static Element |
parseLaunch(String[] pipelineDescription,
List<GError> errors)
Create a new element based on command line syntax.
|
static Element |
parseLaunch(String pipelineDescription,
List<GError> errors)
Create a new pipeline based on command line syntax.
|
static void |
quit()
Signals the thread that called
init() to return. |
static void |
setSegTrap(boolean enabled)
Applications might want to disable/enable the SIGSEGV handling of the
GStreamer core.
|
static void |
setUseDefaultContext(boolean useDefault)
Instructs gstreamer-java to use the default main context.
|
static boolean |
testVersion(int major,
int minor)
Tests that the version of GStreamer requested in init() satisfies the
given version.
|
public static Version getVersion()
init(org.freedesktop.gstreamer.Version)public static String getVersionString()
public static boolean isSegTrapEnabled()
Applications might want to disable this behaviour with the
setSegTrap(boolean) function. This is typically done if the
application wants to install its own handler without GStreamer
interfering.
public static void setSegTrap(boolean enabled)
isSegTrapEnabled() for more information.enabled - public static final boolean isInitialized()
public static ScheduledExecutorService getExecutor()
ScheduledExecutorService used to execute
background tasks and schedule timeouts.public static void quit()
init() to return.public static Element parseLaunch(String pipelineDescription, List<GError> errors)
pipelineDescription - the command line describing the pipelineerrors - a list that any errors will be added toGstException - if the pipeline / element could not be createdpublic static Element parseLaunch(String pipelineDescription)
pipelineDescription - the command line describing the pipelineGstException - if the pipeline / element could not be createdpublic static Element parseLaunch(String[] pipelineDescription, List<GError> errors)
pipelineDescription - An array of strings containing the command
line describing the pipeline.errors - a list that any errors will be added toGstException - if the pipeline / element could not be createdpublic static Element parseLaunch(String[] pipelineDescription)
pipelineDescription - An array of strings containing the command
line describing the pipeline.GstException - if the pipeline / element could not be createdpublic static Bin parseBinFromDescription(String binDescription, boolean ghostUnlinkedPads, List<GError> errors)
binDescription - the command line describing the binghostUnlinkedPads - whether to create ghost pads for the bin from
any unlinked padserrors - list that any errors will be added toGstException - if the bin could not be createdpublic static Bin parseBinFromDescription(String binDescription, boolean ghostUnlinkedPads)
binDescription - the command line describing the binghostUnlinkedPads - whether to create ghost pads for the bin from
any unlinked padsGstException - if the bin could not be createdpublic 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 GMainContext getMainContext()
public static final void init()
throws GstException
This is a shortcut if no arguments are to be passed to gstreamer.
This is equivalent to calling
init(org.freedesktop.gstreamer.Version) with
Version.BASELINE, currently GStreamer 1.8. If you require
features from a later version of GStreamer you should specify the
required version.
GstExceptionpublic static final void init(Version requiredVersion) throws GstException
This is a shortcut if no arguments are to be passed to gstreamer.
requiredVersion - GstExceptionpublic 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 is equivalent to calling
init(org.freedesktop.gstreamer.Version, java.lang.String, java.lang.String...)
with Version.BASELINE, currently GStreamer 1.8. If you
require features from a later version of GStreamer you should specify the
required version.
progname - the java program name.args - the java argument list.GstExceptionpublic static final String[] init(Version requestedVersion, String progname, String... args) throws GstException
This sets up internal path lists, registers built-in elements, and loads standard plugins.
requestedVersion - the minimum requested GStreamer version.progname - the java program name.args - the java argument list.GstExceptionpublic static final void deinit()
init(org.freedesktop.gstreamer.Version).
It is normally not needed to call this function in a normal
application as the resources will automatically be freed when the program
terminates. This function is therefore mostly used by testsuites and
other memory profiling tools.
After this call GStreamer (including this method) should not be used
anymore.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 checkVersion(int major,
int minor)
major - major version, only 1 is supportedminor - minor version requiredGstException - if the requested version support was not requestedpublic static boolean testVersion(int major,
int minor)
major - major version, only 1 is supportedminor - minor version requiredCopyright © 2021 gstreamer-java. All rights reserved.