mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2024-12-18 14:26:43 +00:00
[406/906] glimagesink: add a client-data property
Also add it to glfilterapp. Fixes #559131
This commit is contained in:
parent
32203f94ea
commit
36a51c6e02
2 changed files with 18 additions and 4 deletions
|
@ -150,6 +150,7 @@ gst_gl_display_init (GstGLDisplay * display, GstGLDisplayClass * klass)
|
|||
//client callbacks
|
||||
display->clientReshapeCallback = NULL;
|
||||
display->clientDrawCallback = NULL;
|
||||
display->client_data = NULL;
|
||||
|
||||
//upload
|
||||
display->upload_fbo = 0;
|
||||
|
@ -521,6 +522,8 @@ gst_gl_display_finalize (GObject * object)
|
|||
display->clientReshapeCallback = NULL;
|
||||
if (display->clientDrawCallback)
|
||||
display->clientDrawCallback = NULL;
|
||||
if (display->client_data)
|
||||
display->client_data = NULL;
|
||||
if (display->use_fbo_scene_cb)
|
||||
display->use_fbo_scene_cb = NULL;
|
||||
if (display->use_fbo_scene_cb_v2)
|
||||
|
@ -1808,7 +1811,7 @@ gst_gl_display_on_resize (GstGLDisplay * display, gint width, gint height)
|
|||
{
|
||||
//check if a client reshape callback is registered
|
||||
if (display->clientReshapeCallback)
|
||||
display->clientReshapeCallback (width, height);
|
||||
display->clientReshapeCallback (width, height, display->client_data);
|
||||
|
||||
//default reshape
|
||||
else {
|
||||
|
@ -1860,7 +1863,8 @@ gst_gl_display_on_draw (GstGLDisplay * display)
|
|||
if (display->clientDrawCallback) {
|
||||
gboolean doRedisplay =
|
||||
display->clientDrawCallback (display->redisplay_texture,
|
||||
display->redisplay_texture_width, display->redisplay_texture_height);
|
||||
display->redisplay_texture_width, display->redisplay_texture_height,
|
||||
display->client_data);
|
||||
|
||||
if (doRedisplay && display->gl_window)
|
||||
gst_gl_window_draw_unlocked (display->gl_window,
|
||||
|
@ -2483,6 +2487,14 @@ gst_gl_display_set_client_draw_callback (GstGLDisplay * display, CDCB cb)
|
|||
gst_gl_display_unlock (display);
|
||||
}
|
||||
|
||||
void
|
||||
gst_gl_display_set_client_data (GstGLDisplay * display, gpointer data)
|
||||
{
|
||||
gst_gl_display_lock (display);
|
||||
display->client_data = data;
|
||||
gst_gl_display_unlock (display);
|
||||
}
|
||||
|
||||
gulong
|
||||
gst_gl_display_get_internal_gl_context (GstGLDisplay * display)
|
||||
{
|
||||
|
|
|
@ -66,8 +66,8 @@ typedef struct _GstGLDisplayTex
|
|||
|
||||
|
||||
//Client callbacks
|
||||
typedef void (*CRCB) (GLuint, GLuint);
|
||||
typedef gboolean (*CDCB) (GLuint, GLuint, GLuint);
|
||||
typedef void (*CRCB) (GLuint, GLuint, gpointer);
|
||||
typedef gboolean (*CDCB) (GLuint, GLuint, GLuint, gpointer);
|
||||
|
||||
typedef void (*GstGLDisplayThreadFunc) (GstGLDisplay * display, gpointer data);
|
||||
|
||||
|
@ -117,6 +117,7 @@ struct _GstGLDisplay
|
|||
//client callbacks
|
||||
CRCB clientReshapeCallback;
|
||||
CDCB clientDrawCallback;
|
||||
gpointer client_data;
|
||||
|
||||
//upload
|
||||
GLuint upload_fbo;
|
||||
|
@ -283,6 +284,7 @@ void gst_gl_display_set_window_id (GstGLDisplay * display, gulong window_id);
|
|||
void gst_gl_display_set_client_reshape_callback (GstGLDisplay * display,
|
||||
CRCB cb);
|
||||
void gst_gl_display_set_client_draw_callback (GstGLDisplay * display, CDCB cb);
|
||||
void gst_gl_display_set_client_data (GstGLDisplay * display, gpointer data);
|
||||
|
||||
gulong gst_gl_display_get_internal_gl_context (GstGLDisplay * display);
|
||||
void gst_gl_display_activate_gl_context (GstGLDisplay * display, gboolean activate);
|
||||
|
|
Loading…
Reference in a new issue