GstGLFilter filter;
GstGLShader *shader0;
GstGLShader *shader1;
+
+ GLuint midtexture;
};
struct _GstGLFilterBlurClass
static void gst_gl_filterblur_vcallback (gint width, gint height, guint texture, gpointer stuff);
-static void
+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));
}
-static void
+static void
gst_gl_filterblur_reset_resources (GstGLFilter *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));
+ g_print ("\nStop!!!: %s\n\n", glGetString (GL_VENDOR));
}
static void
{
filterblur->shader0 = NULL;
filterblur->shader1 = NULL;
+ filterblur->midtexture = 0;
}
static void
//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);
}
static void
{
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) ;
+
//blocking call, wait the opengl thread has compiled the shader
gst_gl_display_gen_shader (filter->display, hconv9_fragment_source, &blur_filter->shader0);
0.0, 0.0, 1.0, 0.0,
0.0, 0.0, 0.0, 1.0
};
-
+
glMatrixMode (GL_MODELVIEW);
glLoadMatrixd (mirrormatrix);
}
gst_gl_filterblur_filter (GstGLFilter* filter, GstGLBuffer* inbuf,
GstGLBuffer* outbuf)
{
- gpointer filterblur = GST_GL_FILTERBLUR(filter);
- GLuint midtexture = 0;
-
- //blocking call, generate a texture using the pool
- gst_gl_display_gen_texture (filter->display, &midtexture) ;
+ GstGLFilterBlur* filterblur = GST_GL_FILTERBLUR(filter);
- gst_gl_filter_render_to_target (filter, inbuf->texture, midtexture,
+ gst_gl_filter_render_to_target (filter, inbuf->texture, filterblur->midtexture,
gst_gl_filterblur_hcallback, filterblur);
gst_gl_display_thread_add (filter->display, change_view, filterblur);
- gst_gl_filter_render_to_target (filter, midtexture, outbuf->texture,
+ gst_gl_filter_render_to_target (filter, filterblur->midtexture, outbuf->texture,
gst_gl_filterblur_vcallback, filterblur);
- //blocking call, put the texture in the pool
- gst_gl_display_del_texture (filter->display, midtexture);
-
return TRUE;
}