[153/906] Try to genereate textures within gstglfilterblur to see if the new thread_use_fbo works both with textures from the pool and custom ones

This commit is contained in:
Filippo Argiolas 2008-08-11 20:12:02 +02:00 committed by Matthew Waters
parent 02a21f80ab
commit a595635904
2 changed files with 12 additions and 13 deletions

View file

@ -2448,7 +2448,7 @@ gst_gl_display_thread_do_upload_draw (GstGLDisplay *display)
{ {
glBindFramebufferEXT(GL_FRAMEBUFFER_EXT, display->upload_fbo); glBindFramebufferEXT(GL_FRAMEBUFFER_EXT, display->upload_fbo);
/* no more needed? upload_uptex should already be in the pool */ /* no more needed? upload_outtex should already be in the pool */
/* glBindTexture(GL_TEXTURE_RECTANGLE_ARB, display->upload_outtex); */ /* glBindTexture(GL_TEXTURE_RECTANGLE_ARB, display->upload_outtex); */
/* glTexImage2D(GL_TEXTURE_RECTANGLE_ARB, 0, GL_RGBA8, */ /* glTexImage2D(GL_TEXTURE_RECTANGLE_ARB, 0, GL_RGBA8, */
/* display->upload_width, display->upload_height, 0, GL_RGBA, GL_UNSIGNED_BYTE, NULL); */ /* display->upload_width, display->upload_height, 0, GL_RGBA, GL_UNSIGNED_BYTE, NULL); */

View file

@ -124,19 +124,24 @@ static void gst_gl_filterblur_vcallback (gint width, gint height, guint texture,
static void static void
gst_gl_filterblur_init_resources (GstGLFilter *filter) gst_gl_filterblur_init_resources (GstGLFilter *filter)
{ {
// GstGLFilterBlur *filterblur = GST_GL_FILTERBLUR (filter); GstGLFilterBlur *filterblur = GST_GL_FILTERBLUR (filter);
/* dummy gl call to test if we really are in a gl context */ glGenTextures (1, &filterblur->midtexture);
g_print ("\nStart!!!: %s\n\n", glGetString (GL_VERSION)); glBindTexture(GL_TEXTURE_RECTANGLE_ARB, filterblur->midtexture);
glTexImage2D(GL_TEXTURE_RECTANGLE_ARB, 0, GL_RGBA8,
filter->width, filter->height, 0, GL_RGBA, GL_UNSIGNED_BYTE, NULL);
glTexParameteri (GL_TEXTURE_RECTANGLE_ARB, GL_TEXTURE_MAG_FILTER, GL_LINEAR);
glTexParameteri (GL_TEXTURE_RECTANGLE_ARB, GL_TEXTURE_MIN_FILTER, GL_LINEAR);
glTexParameteri (GL_TEXTURE_RECTANGLE_ARB, GL_TEXTURE_WRAP_S, GL_CLAMP_TO_EDGE);
glTexParameteri (GL_TEXTURE_RECTANGLE_ARB, GL_TEXTURE_WRAP_T, GL_CLAMP_TO_EDGE);
} }
static void static void
gst_gl_filterblur_reset_resources (GstGLFilter *filter) gst_gl_filterblur_reset_resources (GstGLFilter *filter)
{ {
// GstGLFilterBlur *filterblur = GST_GL_FILTERBLUR (filter); GstGLFilterBlur *filterblur = GST_GL_FILTERBLUR (filter);
/* dummy gl call to test if we really are in a gl context */ glDeleteTextures (1, &filterblur->midtexture);
g_print ("\nStop!!!: %s\n\n", glGetString (GL_VENDOR));
} }
static void static void
@ -181,9 +186,6 @@ gst_gl_filter_filterblur_reset (GstGLFilter* filter)
//blocking call, wait the opengl thread has destroyed the shader //blocking call, wait the opengl thread has destroyed the shader
gst_gl_display_del_shader (filter->display, filterblur->shader1); gst_gl_display_del_shader (filter->display, filterblur->shader1);
//blocking call, put the texture in the pool
gst_gl_display_del_texture (filter->display, filterblur->midtexture, filter->width, filter->height);
} }
static void static void
@ -217,9 +219,6 @@ gst_gl_filterblur_init_shader (GstGLFilter* filter)
{ {
GstGLFilterBlur* blur_filter = GST_GL_FILTERBLUR (filter); GstGLFilterBlur* blur_filter = GST_GL_FILTERBLUR (filter);
//blocking call, generate a texture using the pool
gst_gl_display_gen_texture (filter->display, &blur_filter->midtexture, filter->width, filter->height) ;
//blocking call, wait the opengl thread has compiled the shader //blocking call, wait the opengl thread has compiled the shader
gst_gl_display_gen_shader (filter->display, hconv9_fragment_source, &blur_filter->shader0); gst_gl_display_gen_shader (filter->display, hconv9_fragment_source, &blur_filter->shader0);