mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2024-11-18 07:47:17 +00:00
glfilter: rename draw_texture to draw_fullscreen_quad
And remove unused arguments.
This commit is contained in:
parent
7004e44be9
commit
c7dd43f21a
23 changed files with 50 additions and 53 deletions
|
@ -69,7 +69,7 @@ gst_gl_effects_blur_callback_hconv (gint width, gint height, guint texture,
|
|||
gst_gl_shader_set_uniform_1fv (shader, "kernel", 7,
|
||||
gst_gl_effects_blur_kernel ());
|
||||
|
||||
gst_gl_filter_draw_texture (filter, texture, width, height);
|
||||
gst_gl_filter_draw_fullscreen_quad (filter);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -102,7 +102,7 @@ gst_gl_effects_blur_callback_vconv (gint width, gint height, guint texture,
|
|||
gst_gl_shader_set_uniform_1fv (shader, "kernel", 7,
|
||||
gst_gl_effects_blur_kernel ());
|
||||
|
||||
gst_gl_filter_draw_texture (filter, texture, width, height);
|
||||
gst_gl_filter_draw_fullscreen_quad (filter);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -53,7 +53,7 @@ gst_gl_effects_bulge_callback (gint width, gint height, guint texture,
|
|||
|
||||
gst_gl_shader_set_uniform_1i (shader, "tex", 0);
|
||||
|
||||
gst_gl_filter_draw_texture (filter, texture, width, height);
|
||||
gst_gl_filter_draw_fullscreen_quad (filter);
|
||||
}
|
||||
|
||||
void
|
||||
|
|
|
@ -53,7 +53,7 @@ gst_gl_effects_fisheye_callback (gint width, gint height, guint texture,
|
|||
|
||||
gst_gl_shader_set_uniform_1i (shader, "tex", 0);
|
||||
|
||||
gst_gl_filter_draw_texture (filter, texture, width, height);
|
||||
gst_gl_filter_draw_fullscreen_quad (filter);
|
||||
}
|
||||
|
||||
void
|
||||
|
|
|
@ -56,7 +56,7 @@ gst_gl_effects_glow_step_one (gint width, gint height, guint texture,
|
|||
|
||||
gst_gl_shader_set_uniform_1i (shader, "tex", 0);
|
||||
|
||||
gst_gl_filter_draw_texture (filter, texture, width, height);
|
||||
gst_gl_filter_draw_fullscreen_quad (filter);
|
||||
}
|
||||
|
||||
static void
|
||||
|
@ -95,7 +95,7 @@ gst_gl_effects_glow_step_two (gint width, gint height, guint texture,
|
|||
gst_gl_shader_set_uniform_1fv (shader, "kernel", 7, gauss_kernel);
|
||||
gst_gl_shader_set_uniform_1f (shader, "gauss_width", width);
|
||||
|
||||
gst_gl_filter_draw_texture (filter, texture, width, height);
|
||||
gst_gl_filter_draw_fullscreen_quad (filter);
|
||||
}
|
||||
|
||||
static void
|
||||
|
@ -130,7 +130,7 @@ gst_gl_effects_glow_step_three (gint width, gint height, guint texture,
|
|||
gst_gl_shader_set_uniform_1fv (shader, "kernel", 7, gauss_kernel);
|
||||
gst_gl_shader_set_uniform_1f (shader, "gauss_height", height);
|
||||
|
||||
gst_gl_filter_draw_texture (filter, texture, width, height);
|
||||
gst_gl_filter_draw_fullscreen_quad (filter);
|
||||
}
|
||||
|
||||
static void
|
||||
|
@ -159,7 +159,7 @@ gst_gl_effects_glow_step_four (gint width, gint height, guint texture,
|
|||
gst_gl_shader_use (shader);
|
||||
|
||||
gl->ActiveTexture (GL_TEXTURE2);
|
||||
gl->BindTexture (GL_TEXTURE_2D, effects->intexture);
|
||||
gl->BindTexture (GL_TEXTURE_2D, effects->intexture->tex_id);
|
||||
|
||||
gst_gl_shader_set_uniform_1f (shader, "alpha", 1.0f);
|
||||
gst_gl_shader_set_uniform_1i (shader, "base", 2);
|
||||
|
@ -170,7 +170,7 @@ gst_gl_effects_glow_step_four (gint width, gint height, guint texture,
|
|||
gst_gl_shader_set_uniform_1f (shader, "beta", (gfloat) 1 / 3.5f);
|
||||
gst_gl_shader_set_uniform_1i (shader, "blend", 1);
|
||||
|
||||
gst_gl_filter_draw_texture (filter, texture, width, height);
|
||||
gst_gl_filter_draw_fullscreen_quad (filter);
|
||||
}
|
||||
|
||||
void
|
||||
|
|
|
@ -64,7 +64,7 @@ gst_gl_effects_identity_callback (gint width, gint height, guint texture,
|
|||
|
||||
gst_gl_shader_set_uniform_1i (shader, "tex", 0);
|
||||
|
||||
gst_gl_filter_draw_texture (filter, texture, width, height);
|
||||
gst_gl_filter_draw_fullscreen_quad (filter);
|
||||
}
|
||||
|
||||
void
|
||||
|
|
|
@ -59,7 +59,7 @@ gst_gl_effects_laplacian_callback (gint width, gint height, guint texture,
|
|||
gst_gl_shader_set_uniform_1fv (shader, "kernel", 9, kernel);
|
||||
gst_gl_shader_set_uniform_1i (shader, "invert", effects->invert);
|
||||
|
||||
gst_gl_filter_draw_texture (filter, texture, width, height);
|
||||
gst_gl_filter_draw_fullscreen_quad (filter);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -97,7 +97,7 @@ gst_gl_effects_luma_to_curve (GstGLEffects * effects,
|
|||
gst_gl_shader_set_uniform_1i (shader, "curve", 1);
|
||||
}
|
||||
|
||||
gst_gl_filter_draw_texture (filter, texture, width, height);
|
||||
gst_gl_filter_draw_fullscreen_quad (filter);
|
||||
}
|
||||
|
||||
static void
|
||||
|
|
|
@ -53,7 +53,7 @@ gst_gl_effects_mirror_callback (gint width, gint height, guint texture,
|
|||
|
||||
gst_gl_shader_set_uniform_1i (shader, "tex", 0);
|
||||
|
||||
gst_gl_filter_draw_texture (filter, texture, width, height);
|
||||
gst_gl_filter_draw_fullscreen_quad (filter);
|
||||
}
|
||||
|
||||
void
|
||||
|
|
|
@ -96,7 +96,7 @@ gst_gl_effects_rgb_to_curve (GstGLEffects * effects,
|
|||
gst_gl_shader_set_uniform_1i (shader, "curve", 1);
|
||||
}
|
||||
|
||||
gst_gl_filter_draw_texture (filter, texture, width, height);
|
||||
gst_gl_filter_draw_fullscreen_quad (filter);
|
||||
}
|
||||
|
||||
static void
|
||||
|
|
|
@ -53,7 +53,7 @@ gst_gl_effects_sin_callback (gint width, gint height, guint texture,
|
|||
|
||||
gst_gl_shader_set_uniform_1i (shader, "tex", 0);
|
||||
|
||||
gst_gl_filter_draw_texture (filter, texture, width, height);
|
||||
gst_gl_filter_draw_fullscreen_quad (filter);
|
||||
}
|
||||
|
||||
void
|
||||
|
|
|
@ -51,7 +51,7 @@ gst_gl_effects_sobel_callback_desaturate (gint width, gint height,
|
|||
|
||||
gst_gl_shader_set_uniform_1i (shader, "tex", 0);
|
||||
|
||||
gst_gl_filter_draw_texture (filter, texture, width, height);
|
||||
gst_gl_filter_draw_fullscreen_quad (filter);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -82,7 +82,7 @@ gst_gl_effects_sobel_callback_hconv (gint width, gint height, guint texture,
|
|||
gst_gl_shader_set_uniform_1i (shader, "tex", 0);
|
||||
gst_gl_shader_set_uniform_1f (shader, "width", width);
|
||||
|
||||
gst_gl_filter_draw_texture (filter, texture, width, height);
|
||||
gst_gl_filter_draw_fullscreen_quad (filter);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -113,7 +113,7 @@ gst_gl_effects_sobel_callback_vconv (gint width, gint height, guint texture,
|
|||
gst_gl_shader_set_uniform_1i (shader, "tex", 0);
|
||||
gst_gl_shader_set_uniform_1f (shader, "height", height);
|
||||
|
||||
gst_gl_filter_draw_texture (filter, texture, width, height);
|
||||
gst_gl_filter_draw_fullscreen_quad (filter);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -144,7 +144,7 @@ gst_gl_effects_sobel_callback_length (gint width, gint height, guint texture,
|
|||
gst_gl_shader_set_uniform_1i (shader, "tex", 0);
|
||||
gst_gl_shader_set_uniform_1i (shader, "invert", effects->invert);
|
||||
|
||||
gst_gl_filter_draw_texture (filter, texture, width, height);
|
||||
gst_gl_filter_draw_fullscreen_quad (filter);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -53,7 +53,7 @@ gst_gl_effects_square_callback (gint width, gint height, guint texture,
|
|||
|
||||
gst_gl_shader_set_uniform_1i (shader, "tex", 0);
|
||||
|
||||
gst_gl_filter_draw_texture (filter, texture, width, height);
|
||||
gst_gl_filter_draw_fullscreen_quad (filter);
|
||||
}
|
||||
|
||||
void
|
||||
|
|
|
@ -53,7 +53,7 @@ gst_gl_effects_squeeze_callback (gint width, gint height, guint texture,
|
|||
|
||||
gst_gl_shader_set_uniform_1i (shader, "tex", 0);
|
||||
|
||||
gst_gl_filter_draw_texture (filter, texture, width, height);
|
||||
gst_gl_filter_draw_fullscreen_quad (filter);
|
||||
}
|
||||
|
||||
void
|
||||
|
|
|
@ -52,7 +52,7 @@ gst_gl_effects_stretch_callback (gint width, gint height, guint texture,
|
|||
|
||||
gst_gl_shader_set_uniform_1i (shader, "tex", 0);
|
||||
|
||||
gst_gl_filter_draw_texture (filter, texture, width, height);
|
||||
gst_gl_filter_draw_fullscreen_quad (filter);
|
||||
}
|
||||
|
||||
void
|
||||
|
|
|
@ -53,7 +53,7 @@ gst_gl_effects_tunnel_callback (gint width, gint height, guint texture,
|
|||
|
||||
gst_gl_shader_set_uniform_1i (shader, "tex", 0);
|
||||
|
||||
gst_gl_filter_draw_texture (filter, texture, width, height);
|
||||
gst_gl_filter_draw_fullscreen_quad (filter);
|
||||
}
|
||||
|
||||
void
|
||||
|
|
|
@ -53,7 +53,7 @@ gst_gl_effects_twirl_callback (gint width, gint height, guint texture,
|
|||
|
||||
gst_gl_shader_set_uniform_1i (shader, "tex", 0);
|
||||
|
||||
gst_gl_filter_draw_texture (filter, texture, width, height);
|
||||
gst_gl_filter_draw_fullscreen_quad (filter);
|
||||
}
|
||||
|
||||
void
|
||||
|
|
|
@ -74,7 +74,7 @@ gst_gl_effects_xray_step_two (gint width, gint height, guint texture,
|
|||
gst_gl_shader_set_uniform_1fv (shader, "kernel", 9, gauss_kernel);
|
||||
gst_gl_shader_set_uniform_1f (shader, "gauss_width", width);
|
||||
|
||||
gst_gl_filter_draw_texture (filter, texture, width, height);
|
||||
gst_gl_filter_draw_fullscreen_quad (filter);
|
||||
}
|
||||
|
||||
static void
|
||||
|
@ -109,7 +109,7 @@ gst_gl_effects_xray_step_three (gint width, gint height, guint texture,
|
|||
gst_gl_shader_set_uniform_1fv (shader, "kernel", 9, gauss_kernel);
|
||||
gst_gl_shader_set_uniform_1f (shader, "gauss_height", height);
|
||||
|
||||
gst_gl_filter_draw_texture (filter, texture, width, height);
|
||||
gst_gl_filter_draw_fullscreen_quad (filter);
|
||||
}
|
||||
|
||||
/* multipass separable sobel */
|
||||
|
@ -142,7 +142,7 @@ gst_gl_effects_xray_desaturate (gint width, gint height, guint texture,
|
|||
gl->BindTexture (GL_TEXTURE_2D, texture);
|
||||
|
||||
gst_gl_shader_set_uniform_1i (shader, "tex", 1);
|
||||
gst_gl_filter_draw_texture (filter, texture, width, height);
|
||||
gst_gl_filter_draw_fullscreen_quad (filter);
|
||||
}
|
||||
|
||||
static void
|
||||
|
@ -176,7 +176,7 @@ gst_gl_effects_xray_sobel_hconv (gint width, gint height, guint texture,
|
|||
gst_gl_shader_set_uniform_1i (shader, "tex", 1);
|
||||
gst_gl_shader_set_uniform_1f (shader, "width", width);
|
||||
|
||||
gst_gl_filter_draw_texture (filter, texture, width, height);
|
||||
gst_gl_filter_draw_fullscreen_quad (filter);
|
||||
}
|
||||
|
||||
static void
|
||||
|
@ -210,7 +210,7 @@ gst_gl_effects_xray_sobel_vconv (gint width, gint height, guint texture,
|
|||
gst_gl_shader_set_uniform_1i (shader, "tex", 1);
|
||||
gst_gl_shader_set_uniform_1f (shader, "height", height);
|
||||
|
||||
gst_gl_filter_draw_texture (filter, texture, width, height);
|
||||
gst_gl_filter_draw_fullscreen_quad (filter);
|
||||
}
|
||||
|
||||
static void
|
||||
|
@ -243,7 +243,7 @@ gst_gl_effects_xray_sobel_length (gint width, gint height, guint texture,
|
|||
|
||||
gst_gl_shader_set_uniform_1i (shader, "tex", 1);
|
||||
gst_gl_shader_set_uniform_1i (shader, "invert", TRUE);
|
||||
gst_gl_filter_draw_texture (filter, texture, width, height);
|
||||
gst_gl_filter_draw_fullscreen_quad (filter);
|
||||
}
|
||||
|
||||
/* end of sobel passes */
|
||||
|
@ -274,7 +274,7 @@ gst_gl_effects_xray_step_five (gint width, gint height, guint texture,
|
|||
gst_gl_shader_use (shader);
|
||||
|
||||
gl->ActiveTexture (GL_TEXTURE2);
|
||||
gl->BindTexture (GL_TEXTURE_2D, effects->midtexture[2]);
|
||||
gl->BindTexture (GL_TEXTURE_2D, effects->midtexture[2]->tex_id);
|
||||
|
||||
gst_gl_shader_set_uniform_1i (shader, "base", 2);
|
||||
|
||||
|
@ -284,7 +284,7 @@ gst_gl_effects_xray_step_five (gint width, gint height, guint texture,
|
|||
gst_gl_shader_set_uniform_1f (shader, "alpha", (gfloat) 0.5f);
|
||||
gst_gl_shader_set_uniform_1i (shader, "blend", 1);
|
||||
|
||||
gst_gl_filter_draw_texture (filter, texture, width, height);
|
||||
gst_gl_filter_draw_fullscreen_quad (filter);
|
||||
}
|
||||
|
||||
void
|
||||
|
|
|
@ -254,7 +254,7 @@ gst_gl_color_balance_callback (gint width, gint height, guint tex_id,
|
|||
|
||||
gl->BindTexture (GL_TEXTURE_2D, tex_id);
|
||||
|
||||
gst_gl_filter_draw_texture (filter, tex_id, width, height);
|
||||
gst_gl_filter_draw_fullscreen_quad (filter);
|
||||
}
|
||||
|
||||
static gboolean
|
||||
|
|
|
@ -457,7 +457,7 @@ gst_gl_deinterlace_vfir_callback (gint width, gint height, guint texture,
|
|||
gst_gl_shader_set_uniform_1f (shader, "height",
|
||||
GST_VIDEO_INFO_HEIGHT (&filter->out_info));
|
||||
|
||||
gst_gl_filter_draw_texture (filter, texture, width, height);
|
||||
gst_gl_filter_draw_fullscreen_quad (filter);
|
||||
}
|
||||
|
||||
static void
|
||||
|
@ -505,7 +505,7 @@ gst_gl_deinterlace_greedyh_callback (gint width, gint height, guint texture,
|
|||
gst_gl_shader_set_uniform_1f (shader, "height",
|
||||
GST_VIDEO_INFO_HEIGHT (&filter->out_info));
|
||||
|
||||
gst_gl_filter_draw_texture (filter, texture, width, height);
|
||||
gst_gl_filter_draw_fullscreen_quad (filter);
|
||||
|
||||
/* we keep the previous buffer around so this is safe */
|
||||
deinterlace_filter->prev_tex = texture;
|
||||
|
|
|
@ -331,7 +331,7 @@ gst_gl_differencematte_diff (gint width, gint height, guint texture,
|
|||
|
||||
gst_gl_shader_set_uniform_1i (differencematte->shader[0], "saved", 1);
|
||||
|
||||
gst_gl_filter_draw_texture (filter, texture, width, height);
|
||||
gst_gl_filter_draw_fullscreen_quad (filter);
|
||||
}
|
||||
|
||||
static void
|
||||
|
@ -354,7 +354,7 @@ gst_gl_differencematte_hblur (gint width, gint height, guint texture,
|
|||
gst_gl_shader_set_uniform_1f (differencematte->shader[1], "gauss_width",
|
||||
width);
|
||||
|
||||
gst_gl_filter_draw_texture (filter, texture, width, height);
|
||||
gst_gl_filter_draw_fullscreen_quad (filter);
|
||||
}
|
||||
|
||||
static void
|
||||
|
@ -377,7 +377,7 @@ gst_gl_differencematte_vblur (gint width, gint height, guint texture,
|
|||
gst_gl_shader_set_uniform_1f (differencematte->shader[2], "gauss_height",
|
||||
height);
|
||||
|
||||
gst_gl_filter_draw_texture (filter, texture, width, height);
|
||||
gst_gl_filter_draw_fullscreen_quad (filter);
|
||||
}
|
||||
|
||||
static void
|
||||
|
@ -405,7 +405,7 @@ gst_gl_differencematte_interp (gint width, gint height, guint texture,
|
|||
|
||||
gst_gl_shader_set_uniform_1i (differencematte->shader[3], "alpha", 2);
|
||||
|
||||
gst_gl_filter_draw_texture (filter, texture, width, height);
|
||||
gst_gl_filter_draw_fullscreen_quad (filter);
|
||||
}
|
||||
|
||||
static void
|
||||
|
@ -423,7 +423,7 @@ gst_gl_differencematte_identity (gint width, gint height, guint texture,
|
|||
|
||||
gst_gl_shader_set_uniform_1i (differencematte->identity_shader, "tex", 0);
|
||||
|
||||
gst_gl_filter_draw_texture (filter, texture, width, height);
|
||||
gst_gl_filter_draw_fullscreen_quad (filter);
|
||||
}
|
||||
|
||||
static gboolean
|
||||
|
|
|
@ -525,7 +525,7 @@ gst_gl_filtershader_hcallback (gint width, gint height, guint texture,
|
|||
gl->ActiveTexture (GL_TEXTURE0);
|
||||
gl->BindTexture (GL_TEXTURE_2D, texture);
|
||||
|
||||
gst_gl_filter_draw_texture (filter, texture, width, height);
|
||||
gst_gl_filter_draw_fullscreen_quad (filter);
|
||||
|
||||
gst_object_unref (shader);
|
||||
}
|
||||
|
|
|
@ -1040,7 +1040,7 @@ gst_gl_filter_render_to_target (GstGLFilter * filter, gboolean resize,
|
|||
cb.height = in_height;
|
||||
|
||||
gst_gl_context_use_fbo_v2 (context, out_width, out_height,
|
||||
filter->fbo, filter->depthbuffer, target, _glcb2, &cb);
|
||||
filter->fbo, filter->depthbuffer, output->tex_id, _glcb2, &cb);
|
||||
}
|
||||
|
||||
static void
|
||||
|
@ -1089,7 +1089,7 @@ _draw_with_shader_cb (gint width, gint height, guint texture, gpointer stuff)
|
|||
gst_gl_shader_set_uniform_1f (filter->default_shader, "width", width);
|
||||
gst_gl_shader_set_uniform_1f (filter->default_shader, "height", height);
|
||||
|
||||
gst_gl_filter_draw_texture (filter, texture, width, height);
|
||||
gst_gl_filter_draw_fullscreen_quad (filter);
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -1168,23 +1168,20 @@ _unbind_buffer (GstGLFilter * filter)
|
|||
}
|
||||
|
||||
/**
|
||||
* gst_gl_filter_draw_texture:
|
||||
* gst_gl_filter_draw_fullscreen_quad:
|
||||
* @filter: a #GstGLFilter
|
||||
* @texture: the texture to draw
|
||||
* @width: width of @texture
|
||||
* @height: height of texture
|
||||
*
|
||||
* Draws @texture into the OpenGL scene at the specified @width and @height.
|
||||
* Render a fullscreen quad using the current GL state. The only GL state this
|
||||
* modifies is the necessary vertex/index buffers and, if necessary, a
|
||||
* Vertex Array Object for drawing a fullscreen quad. Framebuffer state,
|
||||
* any shaders, viewport state, etc must be setup by the caller.
|
||||
*/
|
||||
void
|
||||
gst_gl_filter_draw_texture (GstGLFilter * filter, GLuint texture,
|
||||
guint width, guint height)
|
||||
gst_gl_filter_draw_fullscreen_quad (GstGLFilter * filter)
|
||||
{
|
||||
GstGLContext *context = GST_GL_BASE_FILTER (filter)->context;
|
||||
GstGLFuncs *gl = context->gl_vtable;
|
||||
|
||||
GST_DEBUG ("drawing texture:%u dimensions:%ux%u", texture, width, height);
|
||||
|
||||
{
|
||||
if (!filter->vertex_buffer) {
|
||||
if (gl->GenVertexArrays) {
|
||||
|
|
|
@ -119,7 +119,7 @@ void gst_gl_filter_render_to_target (GstGLFilter *filter, gboolean resize, GLuin
|
|||
void gst_gl_filter_render_to_target_with_shader (GstGLFilter * filter, gboolean resize,
|
||||
GLuint input, GLuint target, GstGLShader *shader);
|
||||
|
||||
void gst_gl_filter_draw_texture (GstGLFilter *filter, GLuint texture, guint width, guint height);
|
||||
void gst_gl_filter_draw_fullscreen_quad (GstGLFilter *filter);
|
||||
|
||||
G_END_DECLS
|
||||
|
||||
|
|
Loading…
Reference in a new issue