mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2024-12-26 02:00:33 +00:00
[121/906] avoid use of GLSL functions when fragment_shader is not available
git-svn-id: svn://svn.wobow.com/GStreamer_playground/gst-plugins-gl@581 93df14bb-0f41-7a43-8087-d3e2a2f0e464
This commit is contained in:
parent
cbd66b24c8
commit
ed46d70150
1 changed files with 40 additions and 16 deletions
|
@ -718,17 +718,29 @@ gst_gl_display_thread_destroy_context (GstGLDisplay *display)
|
||||||
glutSetWindow (display->glutWinId);
|
glutSetWindow (display->glutWinId);
|
||||||
glutReshapeFunc (NULL);
|
glutReshapeFunc (NULL);
|
||||||
glutDestroyWindow (display->glutWinId);
|
glutDestroyWindow (display->glutWinId);
|
||||||
glUseProgramObjectARB (0);
|
|
||||||
|
|
||||||
|
//colorspace_conversion specific
|
||||||
|
switch (display->colorspace_conversion)
|
||||||
|
{
|
||||||
|
case GST_GL_DISPLAY_CONVERSION_MESA:
|
||||||
|
case GST_GL_DISPLAY_CONVERSION_MATRIX:
|
||||||
|
break;
|
||||||
|
case GST_GL_DISPLAY_CONVERSION_GLSL:
|
||||||
|
{
|
||||||
|
glUseProgramObjectARB (0);
|
||||||
glDeleteObjectARB (display->GLSLProgram_YUY2);
|
glDeleteObjectARB (display->GLSLProgram_YUY2);
|
||||||
glDeleteObjectARB (display->GLSLProgram_UYVY);
|
glDeleteObjectARB (display->GLSLProgram_UYVY);
|
||||||
glDeleteObjectARB (display->GLSLProgram_I420_YV12);
|
glDeleteObjectARB (display->GLSLProgram_I420_YV12);
|
||||||
glDeleteObjectARB (display->GLSLProgram_AYUV);
|
glDeleteObjectARB (display->GLSLProgram_AYUV);
|
||||||
|
|
||||||
glDeleteObjectARB (display->GLSLProgram_to_YUY2);
|
glDeleteObjectARB (display->GLSLProgram_to_YUY2);
|
||||||
glDeleteObjectARB (display->GLSLProgram_to_UYVY);
|
glDeleteObjectARB (display->GLSLProgram_to_UYVY);
|
||||||
glDeleteObjectARB (display->GLSLProgram_to_I420_YV12);
|
glDeleteObjectARB (display->GLSLProgram_to_I420_YV12);
|
||||||
glDeleteObjectARB (display->GLSLProgram_to_AYUV);
|
glDeleteObjectARB (display->GLSLProgram_to_AYUV);
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
default:
|
||||||
|
g_assert_not_reached ();
|
||||||
|
}
|
||||||
|
|
||||||
glDeleteFramebuffersEXT (1, &display->upload_fbo);
|
glDeleteFramebuffersEXT (1, &display->upload_fbo);
|
||||||
glDeleteRenderbuffersEXT(1, &display->upload_depth_buffer);
|
glDeleteRenderbuffersEXT(1, &display->upload_depth_buffer);
|
||||||
|
@ -1305,6 +1317,8 @@ gst_gl_display_thread_use_fbo (GstGLDisplay *display)
|
||||||
|
|
||||||
glDrawBuffer(GL_NONE);
|
glDrawBuffer(GL_NONE);
|
||||||
|
|
||||||
|
//in case of the developer forgot the de-init use of GLSL in the scene code
|
||||||
|
if (display->colorspace_conversion == GST_GL_DISPLAY_CONVERSION_GLSL)
|
||||||
glUseProgramObjectARB (0);
|
glUseProgramObjectARB (0);
|
||||||
|
|
||||||
glDisable(GL_TEXTURE_RECTANGLE_ARB);
|
glDisable(GL_TEXTURE_RECTANGLE_ARB);
|
||||||
|
@ -1341,8 +1355,14 @@ static void
|
||||||
gst_gl_display_thread_gen_shader (GstGLDisplay* display)
|
gst_gl_display_thread_gen_shader (GstGLDisplay* display)
|
||||||
{
|
{
|
||||||
glutSetWindow (display->glutWinId);
|
glutSetWindow (display->glutWinId);
|
||||||
|
if (GLEW_ARB_fragment_shader)
|
||||||
display->gen_handle_shader =
|
display->gen_handle_shader =
|
||||||
gst_gl_display_load_fragment_shader (display->gen_text_shader);
|
gst_gl_display_load_fragment_shader (display->gen_text_shader);
|
||||||
|
else
|
||||||
|
{
|
||||||
|
g_print ("One of the filter required ARB_fragment_shader\n");
|
||||||
|
display->isAlive = FALSE;
|
||||||
|
}
|
||||||
g_cond_signal (display->cond_gen_shader);
|
g_cond_signal (display->cond_gen_shader);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1455,6 +1475,8 @@ void gst_gl_display_on_draw(void)
|
||||||
|
|
||||||
//opengl scene
|
//opengl scene
|
||||||
|
|
||||||
|
//make sure that the environnement is clean
|
||||||
|
if (display->colorspace_conversion == GST_GL_DISPLAY_CONVERSION_GLSL)
|
||||||
glUseProgramObjectARB (0);
|
glUseProgramObjectARB (0);
|
||||||
glDisable (GL_TEXTURE_RECTANGLE_ARB);
|
glDisable (GL_TEXTURE_RECTANGLE_ARB);
|
||||||
glBindTexture (GL_TEXTURE_RECTANGLE_ARB, 0);
|
glBindTexture (GL_TEXTURE_RECTANGLE_ARB, 0);
|
||||||
|
@ -2368,6 +2390,8 @@ gst_gl_display_thread_do_upload_draw (GstGLDisplay* display, GLuint texture,
|
||||||
|
|
||||||
glDrawBuffer(GL_NONE);
|
glDrawBuffer(GL_NONE);
|
||||||
|
|
||||||
|
//we are done with the shader
|
||||||
|
if (display->colorspace_conversion == GST_GL_DISPLAY_CONVERSION_GLSL)
|
||||||
glUseProgramObjectARB (0);
|
glUseProgramObjectARB (0);
|
||||||
|
|
||||||
glDisable(GL_TEXTURE_RECTANGLE_ARB);
|
glDisable(GL_TEXTURE_RECTANGLE_ARB);
|
||||||
|
|
Loading…
Reference in a new issue