From 5bc069a5d573c1d54095ae4a52a5c21cffbc92a9 Mon Sep 17 00:00:00 2001 From: Matthew Waters Date: Thu, 13 Jun 2013 16:31:38 +1000 Subject: [PATCH] [706/906] display: move activate_context into utils --- gst-libs/gst/gl/gstgldisplay.c | 15 --------------- gst-libs/gst/gl/gstgldisplay.h | 1 - gst-libs/gst/gl/gstglutils.c | 20 ++++++++++++++++++++ gst-libs/gst/gl/gstglutils.h | 1 + 4 files changed, 21 insertions(+), 16 deletions(-) diff --git a/gst-libs/gst/gl/gstgldisplay.c b/gst-libs/gst/gl/gstgldisplay.c index ef406ff23a..2158e2c7c6 100644 --- a/gst-libs/gst/gl/gstgldisplay.c +++ b/gst-libs/gst/gl/gstgldisplay.c @@ -200,21 +200,6 @@ gst_gl_display_get_internal_gl_context (GstGLDisplay * display) return gst_gl_window_get_gl_context (display->priv->window); } -void -gst_gl_display_activate_gl_context (GstGLDisplay * display, gboolean activate) -{ - g_return_if_fail (GST_IS_GL_DISPLAY (display)); - g_return_if_fail (GST_GL_IS_WINDOW (display->priv->window)); - - if (!activate) - gst_gl_display_lock (display); - - gst_gl_window_activate (display->priv->window, activate); - - if (activate) - gst_gl_display_unlock (display); -} - GstGLAPI gst_gl_display_get_gl_api (GstGLDisplay * display) { diff --git a/gst-libs/gst/gl/gstgldisplay.h b/gst-libs/gst/gl/gstgldisplay.h index 5cdb54431d..1a1f184701 100644 --- a/gst-libs/gst/gl/gstgldisplay.h +++ b/gst-libs/gst/gl/gstgldisplay.h @@ -114,7 +114,6 @@ void gst_gl_display_thread_add (GstGLDisplay * display, GstGLDisplayThreadFunc func, gpointer data); gulong gst_gl_display_get_internal_gl_context (GstGLDisplay * display); -void gst_gl_display_activate_gl_context (GstGLDisplay * display, gboolean activate); /* Must be called inside a lock/unlock on display, or within the glthread */ void gst_gl_display_set_error (GstGLDisplay * display, const char * format, ...); diff --git a/gst-libs/gst/gl/gstglutils.c b/gst-libs/gst/gl/gstglutils.c index 03cfec20a1..4ec717a95e 100644 --- a/gst-libs/gst/gl/gstglutils.c +++ b/gst-libs/gst/gl/gstglutils.c @@ -232,6 +232,26 @@ gst_gl_display_check_framebuffer_status (GstGLDisplay * display) return FALSE; } +void +gst_gl_display_activate_gl_context (GstGLDisplay * display, gboolean activate) +{ + GstGLWindow *window; + + g_return_if_fail (GST_IS_GL_DISPLAY (display)); + + if (!activate) + gst_gl_display_lock (display); + + window = gst_gl_display_get_window_unlocked (display); + + gst_gl_window_activate (window, activate); + + if (activate) + gst_gl_display_unlock (display); + + gst_object_unref (window); +} + void gst_gl_display_gen_texture (GstGLDisplay * display, GLuint * pTexture, GstVideoFormat v_format, GLint width, GLint height) diff --git a/gst-libs/gst/gl/gstglutils.h b/gst-libs/gst/gl/gstglutils.h index bdff1714f5..6a735bafa0 100644 --- a/gst-libs/gst/gl/gstglutils.h +++ b/gst-libs/gst/gl/gstglutils.h @@ -100,5 +100,6 @@ gboolean gst_gl_display_gen_shader (GstGLDisplay * display, void gst_gl_display_del_shader (GstGLDisplay * display, GstGLShader * shader); gboolean gst_gl_display_check_framebuffer_status (GstGLDisplay * display); +void gst_gl_display_activate_gl_context (GstGLDisplay * display, gboolean activate); #endif /* __GST_GL_UTILS_H__ */