[706/906] display: move activate_context into utils

This commit is contained in:
Matthew Waters 2013-06-13 16:31:38 +10:00 committed by Tim-Philipp Müller
parent 4f117323b8
commit 5bc069a5d5
4 changed files with 21 additions and 16 deletions

View file

@ -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)
{

View file

@ -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, ...);

View file

@ -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)

View file

@ -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__ */