mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2024-12-25 01:30:38 +00:00
[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:
parent
02a21f80ab
commit
a595635904
2 changed files with 12 additions and 13 deletions
|
@ -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); */
|
||||
|
|
|
@ -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);
|
||||
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));
|
||||
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);
|
||||
|
||||
|
|
Loading…
Reference in a new issue