![]() |
![]() |
![]() |
GStreamer Bad Plugins 1.0 Library Reference Manual | ![]() |
---|---|---|---|---|
Top | Description | Object Hierarchy |
#define GST_GL_CONTEXT_ERROR GQuark gst_gl_context_error_quark (void
); enum GstGLContextError; void (*GstGLContextThreadFunc) (GstGLContext *context
,gpointer data
); GstGLContext; GstGLContext * gst_gl_context_new (GstGLDisplay *display
); GstGLContext * gst_gl_context_new_wrapped (GstGLDisplay *display
,guintptr handle
,GstGLPlatform context_type
,GstGLAPI available_apis
); gboolean gst_gl_context_create (GstGLContext *context
,GstGLContext *other_context
,GError **error
); void gst_gl_context_destroy (GstGLContext *context
); gboolean gst_gl_context_activate (GstGLContext *context
,gboolean activate
); gpointer gst_gl_context_default_get_proc_address (GstGLAPI gl_api
,const gchar *name
); gpointer gst_gl_context_get_proc_address (GstGLContext *context
,const gchar *name
); gpointer gst_gl_context_get_proc_address_with_platform (GstGLPlatform context_type
,GstGLAPI gl_api
,const gchar *name
); GstGLWindow * gst_gl_context_get_window (GstGLContext *context
); gboolean gst_gl_context_set_window (GstGLContext *context
,GstGLWindow *window
); void gst_gl_context_thread_add (GstGLContext *context
,GstGLContextThreadFunc func
,gpointer data
); GstGLDisplay * gst_gl_context_get_display (GstGLContext *context
); GstGLAPI gst_gl_context_get_gl_api (GstGLContext *context
); guintptr gst_gl_context_get_gl_context (GstGLContext *context
); GstGLPlatform gst_gl_context_get_gl_platform (GstGLContext *context
); guintptr gst_gl_context_get_current_gl_context (GstGLPlatform context_type
); GstGLAPI gst_gl_context_get_current_gl_api (GstGLPlatform platform
,guint *major
,guint *minor
); GThread * gst_gl_context_get_thread (GstGLContext *context
); gboolean gst_gl_context_can_share (GstGLContext *context
,GstGLContext *other_context
); gboolean gst_gl_context_is_shared (GstGLContext *context
); void gst_gl_context_set_shared_with (GstGLContext *context
,GstGLContext *share
); gboolean gst_gl_context_check_feature (GstGLContext *context
,const gchar *feature
); gboolean gst_gl_context_check_gl_version (GstGLContext *context
,GstGLAPI api
,gint maj
,gint min
); void gst_gl_context_get_gl_version (GstGLContext *context
,gint *maj
,gint *min
); gboolean gst_gl_context_fill_info (GstGLContext *context
,GError **error
); GstGLContext * gst_gl_context_get_current (void
);
GstGLContext wraps an OpenGL context object in a uniform API. As a result of the limitation on OpenGL context, this object is not thread safe unless specified and must only be activated in a single thread.
typedef enum { GST_GL_CONTEXT_ERROR_FAILED, GST_GL_CONTEXT_ERROR_WRONG_CONFIG, GST_GL_CONTEXT_ERROR_WRONG_API, GST_GL_CONTEXT_ERROR_OLD_LIBS, GST_GL_CONTEXT_ERROR_CREATE_CONTEXT, GST_GL_CONTEXT_ERROR_RESOURCE_UNAVAILABLE, } GstGLContextError;
void (*GstGLContextThreadFunc) (GstGLContext *context
,gpointer data
);
Represents a function to run in the GL thread with context
and data
|
a GstGLContext |
|
user data |
GstGLContext * gst_gl_context_new (GstGLDisplay *display
);
Create a new GstGLContext with the specified display
|
a GstGLDisplay |
Returns : |
a new GstGLContext |
Since 1.4
GstGLContext * gst_gl_context_new_wrapped (GstGLDisplay *display
,guintptr handle
,GstGLPlatform context_type
,GstGLAPI available_apis
);
Wraps an existing OpenGL context into a GstGLContext.
|
a GstGLDisplay |
|
the OpenGL context to wrap |
|
a GstGLPlatform specifying the type of context in handle
|
|
a GstGLAPI containing the available OpenGL apis in handle
|
Returns : |
a GstGLContext wrapping handle
|
Since 1.4
gboolean gst_gl_context_create (GstGLContext *context
,GstGLContext *other_context
,GError **error
);
Creates an OpenGL context in the current thread with the specified
other_context
as a context to share shareable OpenGL objects with. See the
OpenGL specification for what is shared between contexts.
If an error occurs, and error
is not NULL
, then error will contain details
of the error and FALSE
will be returned.
Should only be called once.
|
a GstGLContext: |
|
a GstGLContext to share OpenGL objects with. [allow-none] |
|
a GError. [allow-none] |
Returns : |
whether the context could successfully be created |
Since 1.4
void gst_gl_context_destroy (GstGLContext *context
);
Destroys an OpenGL context.
Should only be called after gst_gl_context_create()
has been successfully
called for this context.
|
a GstGLContext: |
Since 1.6
gboolean gst_gl_context_activate (GstGLContext *context
,gboolean activate
);
(De)activate the OpenGL context represented by this context
.
In OpenGL terms, calls eglMakeCurrent or similar with this context and the
currently set window. See gst_gl_context_set_window()
for details.
|
a GstGLContext |
|
TRUE to activate, FALSE to deactivate |
Returns : |
Whether the activation succeeded |
Since 1.4
gpointer gst_gl_context_default_get_proc_address (GstGLAPI gl_api
,const gchar *name
);
gpointer gst_gl_context_get_proc_address (GstGLContext *context
,const gchar *name
);
Get a function pointer to a specified opengl function, name
. If the the
specific function does not exist, NULL is returned instead.
Platform specfic functions (names starting 'egl', 'glX', 'wgl', etc) can also be retrieved using this method.
|
a GstGLContext |
|
an opengl function name |
Returns : |
a function pointer or NULL |
Since 1.4
gpointer gst_gl_context_get_proc_address_with_platform (GstGLPlatform context_type
,GstGLAPI gl_api
,const gchar *name
);
GstGLWindow * gst_gl_context_get_window (GstGLContext *context
);
|
a GstGLContext |
Returns : |
the currently set window |
Since 1.4
gboolean gst_gl_context_set_window (GstGLContext *context
,GstGLWindow *window
);
Set's the current window on context
to window
. The window can only be
changed before gst_gl_context_create()
has been called and the window
is not
already running.
|
a GstGLContext |
|
a GstGLWindow. [transfer full] |
Returns : |
Whether the window was successfully updated |
Since 1.4
void gst_gl_context_thread_add (GstGLContext *context
,GstGLContextThreadFunc func
,gpointer data
);
Execute func
in the OpenGL thread of context
with data
MT-safe
|
a GstGLContext |
|
a GstGLContextThreadFunc |
|
user data to call func with. [closure]
|
Since 1.4
GstGLDisplay * gst_gl_context_get_display (GstGLContext *context
);
|
a GstGLContext: |
Returns : |
the GstGLDisplay associated with this context
|
Since 1.4
GstGLAPI gst_gl_context_get_gl_api (GstGLContext *context
);
Get the currently enabled OpenGL api.
The currently available API may be limited by the GstGLDisplay in use and/or the GstGLWindow chosen.
|
a GstGLContext |
Returns : |
the available OpenGL api |
Since 1.4
guintptr gst_gl_context_get_gl_context (GstGLContext *context
);
Gets the backing OpenGL context used by context
.
|
a GstGLContext: |
Returns : |
The platform specific backing OpenGL context |
Since 1.4
GstGLPlatform gst_gl_context_get_gl_platform (GstGLContext *context
);
Gets the OpenGL platform that used by context
.
|
a GstGLContext: |
Returns : |
The platform specific backing OpenGL context |
Since 1.4
guintptr gst_gl_context_get_current_gl_context
(GstGLPlatform context_type
);
|
a GstGLPlatform specifying the type of context to retrieve |
Returns : |
The OpenGL context handle current in the calling thread or NULL
|
Since 1.6
GstGLAPI gst_gl_context_get_current_gl_api (GstGLPlatform platform
,guint *major
,guint *minor
);
If an error occurs, major
and minor
aren't modified and GST_GL_API_NONE
is
returned.
|
the GstGLPlatform to retrieve the API for |
|
(allow-none): the major version. [out] |
|
(allow-none): the minor version. [out] |
Returns : |
The version supported by the OpenGL context current in the calling
thread or GST_GL_API_NONE
|
Since 1.6
GThread * gst_gl_context_get_thread (GstGLContext *context
);
|
a GstGLContext |
Returns : |
The GThread, context is current in or NULL. [transfer full]
|
Since 1.6
gboolean gst_gl_context_can_share (GstGLContext *context
,GstGLContext *other_context
);
Note: This will always fail for two wrapped GstGLContext's
|
a GstGLContext |
|
another GstGLContext |
Returns : |
whether context and other_context are able to share OpenGL
resources. |
Since 1.6
gboolean gst_gl_context_is_shared (GstGLContext *context
);
|
a GstGLContext |
Returns : |
Whether the GstGLContext has been shared with another GstGLContext |
Since 1.8
void gst_gl_context_set_shared_with (GstGLContext *context
,GstGLContext *share
);
Will internally set context
as shared with share
|
a wrapped GstGLContext |
|
another GstGLContext |
Since 1.8
gboolean gst_gl_context_check_feature (GstGLContext *context
,const gchar *feature
);
Some features require that the context be created before it is possible to determine their existence and so will fail if that is not the case.
|
a GstGLContext |
|
a platform specific feature |
Returns : |
Whether feature is supported by context
|
Since 1.4
gboolean gst_gl_context_check_gl_version (GstGLContext *context
,GstGLAPI api
,gint maj
,gint min
);
|
a GstGLContext |
|
api type required |
|
major version required |
|
minor version required |
Returns : |
whether OpenGL context implements the required api and specified version. |
Since 1.4
void gst_gl_context_get_gl_version (GstGLContext *context
,gint *maj
,gint *min
);
|
a GstGLContext |
|
resulting major version. [out] |
|
resulting minor version. [out] |
Returns : |
the OpenGL version implemented by context . See
gst_gl_context_get_gl_api() for retreiving the OpenGL api implemented by
context . |
Since 1.4
gboolean gst_gl_context_fill_info (GstGLContext *context
,GError **error
);
Fills context
's info (version, extensions, vtable, etc) from the GL
context in the current thread. Typically used with wrapped contexts to
allow wrapped contexts to be used as regular GstGLContext's.
|
a GstGLContext: |
Since 1.6
GstGLContext * gst_gl_context_get_current (void
);
See also gst_gl_context_activate()
.
Returns : |
the GstGLContext active in the current thread or NULL
|
Since 1.6