[153/906] Try to genereate textures within gstglfilterblur to see if the new thread_u...
authorFilippo Argiolas <filippo.argiolas@gmail.com>
Mon, 11 Aug 2008 18:12:02 +0000 (20:12 +0200)
committerMatthew Waters <ystreet00@gmail.com>
Sat, 15 Mar 2014 17:36:24 +0000 (18:36 +0100)
gst-libs/gst/gl/gstgldisplay.c
gst/gl/gstglfilterblur.c

index b06402c..2c31a5e 100644 (file)
@@ -2448,7 +2448,7 @@ gst_gl_display_thread_do_upload_draw (GstGLDisplay *display)
 {
   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); */
   /* glTexImage2D(GL_TEXTURE_RECTANGLE_ARB, 0, GL_RGBA8, */
   /*          display->upload_width, display->upload_height, 0, GL_RGBA, GL_UNSIGNED_BYTE, NULL); */
index e6fb1f7..5b3ea30 100644 (file)
@@ -124,19 +124,24 @@ static void gst_gl_filterblur_vcallback (gint width, gint height, guint texture,
 static void
 gst_gl_filterblur_init_resources (GstGLFilter *filter)
 {
-//  GstGLFilterBlur *filterblur = GST_GL_FILTERBLUR (filter);
-
-  /* dummy gl call to test if we really are in a  gl context */
-  g_print ("\nStart!!!: %s\n\n", glGetString (GL_VERSION));
+  GstGLFilterBlur *filterblur = GST_GL_FILTERBLUR (filter);
+
+  glGenTextures (1, &filterblur->midtexture);
+  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
 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 */
-  g_print ("\nStop!!!: %s\n\n", glGetString (GL_VENDOR));
+  glDeleteTextures (1, &filterblur->midtexture);
 }
 
 static void
@@ -181,9 +186,6 @@ gst_gl_filter_filterblur_reset (GstGLFilter* filter)
 
   //blocking call, wait the opengl thread has destroyed the shader
   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
@@ -217,9 +219,6 @@ gst_gl_filterblur_init_shader (GstGLFilter* 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
   gst_gl_display_gen_shader (filter->display, hconv9_fragment_source, &blur_filter->shader0);