mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2024-12-17 22:06:41 +00:00
gl: remove useless gl{En,Dis}able (GL_TEXTURE_*) calls
We are using shaders everywhere and so they are not needed
This commit is contained in:
parent
ac793f691d
commit
72993f54fa
27 changed files with 13 additions and 128 deletions
|
@ -62,9 +62,7 @@ gst_gl_effects_blur_callback_hconv (gint width, gint height, guint texture,
|
||||||
gst_gl_shader_use (shader);
|
gst_gl_shader_use (shader);
|
||||||
|
|
||||||
gl->ActiveTexture (GL_TEXTURE0);
|
gl->ActiveTexture (GL_TEXTURE0);
|
||||||
gl->Enable (GL_TEXTURE_2D);
|
|
||||||
gl->BindTexture (GL_TEXTURE_2D, texture);
|
gl->BindTexture (GL_TEXTURE_2D, texture);
|
||||||
gl->Disable (GL_TEXTURE_2D);
|
|
||||||
|
|
||||||
gst_gl_shader_set_uniform_1i (shader, "tex", 0);
|
gst_gl_shader_set_uniform_1i (shader, "tex", 0);
|
||||||
gst_gl_shader_set_uniform_1f (shader, "gauss_width", width);
|
gst_gl_shader_set_uniform_1f (shader, "gauss_width", width);
|
||||||
|
@ -97,9 +95,7 @@ gst_gl_effects_blur_callback_vconv (gint width, gint height, guint texture,
|
||||||
gst_gl_shader_use (shader);
|
gst_gl_shader_use (shader);
|
||||||
|
|
||||||
gl->ActiveTexture (GL_TEXTURE0);
|
gl->ActiveTexture (GL_TEXTURE0);
|
||||||
gl->Enable (GL_TEXTURE_2D);
|
|
||||||
gl->BindTexture (GL_TEXTURE_2D, texture);
|
gl->BindTexture (GL_TEXTURE_2D, texture);
|
||||||
gl->Disable (GL_TEXTURE_2D);
|
|
||||||
|
|
||||||
gst_gl_shader_set_uniform_1i (shader, "tex", 0);
|
gst_gl_shader_set_uniform_1i (shader, "tex", 0);
|
||||||
gst_gl_shader_set_uniform_1f (shader, "gauss_height", height);
|
gst_gl_shader_set_uniform_1f (shader, "gauss_height", height);
|
||||||
|
|
|
@ -49,7 +49,6 @@ gst_gl_effects_bulge_callback (gint width, gint height, guint texture,
|
||||||
gst_gl_shader_use (shader);
|
gst_gl_shader_use (shader);
|
||||||
|
|
||||||
gl->ActiveTexture (GL_TEXTURE0);
|
gl->ActiveTexture (GL_TEXTURE0);
|
||||||
gl->Enable (GL_TEXTURE_2D);
|
|
||||||
gl->BindTexture (GL_TEXTURE_2D, texture);
|
gl->BindTexture (GL_TEXTURE_2D, texture);
|
||||||
|
|
||||||
gst_gl_shader_set_uniform_1i (shader, "tex", 0);
|
gst_gl_shader_set_uniform_1i (shader, "tex", 0);
|
||||||
|
|
|
@ -49,7 +49,6 @@ gst_gl_effects_fisheye_callback (gint width, gint height, guint texture,
|
||||||
gst_gl_shader_use (shader);
|
gst_gl_shader_use (shader);
|
||||||
|
|
||||||
gl->ActiveTexture (GL_TEXTURE0);
|
gl->ActiveTexture (GL_TEXTURE0);
|
||||||
gl->Enable (GL_TEXTURE_2D);
|
|
||||||
gl->BindTexture (GL_TEXTURE_2D, texture);
|
gl->BindTexture (GL_TEXTURE_2D, texture);
|
||||||
|
|
||||||
gst_gl_shader_set_uniform_1i (shader, "tex", 0);
|
gst_gl_shader_set_uniform_1i (shader, "tex", 0);
|
||||||
|
|
|
@ -53,7 +53,6 @@ gst_gl_effects_glow_step_one (gint width, gint height, guint texture,
|
||||||
gst_gl_shader_use (shader);
|
gst_gl_shader_use (shader);
|
||||||
|
|
||||||
gl->ActiveTexture (GL_TEXTURE0);
|
gl->ActiveTexture (GL_TEXTURE0);
|
||||||
gl->Enable (GL_TEXTURE_2D);
|
|
||||||
gl->BindTexture (GL_TEXTURE_2D, texture);
|
gl->BindTexture (GL_TEXTURE_2D, texture);
|
||||||
|
|
||||||
gst_gl_shader_set_uniform_1i (shader, "tex", 0);
|
gst_gl_shader_set_uniform_1i (shader, "tex", 0);
|
||||||
|
@ -91,9 +90,7 @@ gst_gl_effects_glow_step_two (gint width, gint height, guint texture,
|
||||||
gst_gl_shader_use (shader);
|
gst_gl_shader_use (shader);
|
||||||
|
|
||||||
gl->ActiveTexture (GL_TEXTURE1);
|
gl->ActiveTexture (GL_TEXTURE1);
|
||||||
gl->Enable (GL_TEXTURE_2D);
|
|
||||||
gl->BindTexture (GL_TEXTURE_2D, texture);
|
gl->BindTexture (GL_TEXTURE_2D, texture);
|
||||||
gl->Disable (GL_TEXTURE_2D);
|
|
||||||
|
|
||||||
gst_gl_shader_set_uniform_1i (shader, "tex", 1);
|
gst_gl_shader_set_uniform_1i (shader, "tex", 1);
|
||||||
gst_gl_shader_set_uniform_1fv (shader, "kernel", 7, gauss_kernel);
|
gst_gl_shader_set_uniform_1fv (shader, "kernel", 7, gauss_kernel);
|
||||||
|
@ -128,9 +125,7 @@ gst_gl_effects_glow_step_three (gint width, gint height, guint texture,
|
||||||
gst_gl_shader_use (shader);
|
gst_gl_shader_use (shader);
|
||||||
|
|
||||||
gl->ActiveTexture (GL_TEXTURE1);
|
gl->ActiveTexture (GL_TEXTURE1);
|
||||||
gl->Enable (GL_TEXTURE_2D);
|
|
||||||
gl->BindTexture (GL_TEXTURE_2D, texture);
|
gl->BindTexture (GL_TEXTURE_2D, texture);
|
||||||
gl->Disable (GL_TEXTURE_2D);
|
|
||||||
|
|
||||||
gst_gl_shader_set_uniform_1i (shader, "tex", 1);
|
gst_gl_shader_set_uniform_1i (shader, "tex", 1);
|
||||||
gst_gl_shader_set_uniform_1fv (shader, "kernel", 7, gauss_kernel);
|
gst_gl_shader_set_uniform_1fv (shader, "kernel", 7, gauss_kernel);
|
||||||
|
@ -165,17 +160,13 @@ gst_gl_effects_glow_step_four (gint width, gint height, guint texture,
|
||||||
gst_gl_shader_use (shader);
|
gst_gl_shader_use (shader);
|
||||||
|
|
||||||
gl->ActiveTexture (GL_TEXTURE2);
|
gl->ActiveTexture (GL_TEXTURE2);
|
||||||
gl->Enable (GL_TEXTURE_2D);
|
|
||||||
gl->BindTexture (GL_TEXTURE_2D, effects->intexture);
|
gl->BindTexture (GL_TEXTURE_2D, effects->intexture);
|
||||||
gl->Disable (GL_TEXTURE_2D);
|
|
||||||
|
|
||||||
gst_gl_shader_set_uniform_1f (shader, "alpha", 1.0f);
|
gst_gl_shader_set_uniform_1f (shader, "alpha", 1.0f);
|
||||||
gst_gl_shader_set_uniform_1i (shader, "base", 2);
|
gst_gl_shader_set_uniform_1i (shader, "base", 2);
|
||||||
|
|
||||||
gl->ActiveTexture (GL_TEXTURE1);
|
gl->ActiveTexture (GL_TEXTURE1);
|
||||||
gl->Enable (GL_TEXTURE_2D);
|
|
||||||
gl->BindTexture (GL_TEXTURE_2D, texture);
|
gl->BindTexture (GL_TEXTURE_2D, texture);
|
||||||
gl->Disable (GL_TEXTURE_2D);
|
|
||||||
|
|
||||||
gst_gl_shader_set_uniform_1f (shader, "beta", (gfloat) 1 / 3.5f);
|
gst_gl_shader_set_uniform_1f (shader, "beta", (gfloat) 1 / 3.5f);
|
||||||
gst_gl_shader_set_uniform_1i (shader, "blend", 1);
|
gst_gl_shader_set_uniform_1i (shader, "blend", 1);
|
||||||
|
|
|
@ -51,9 +51,7 @@ gst_gl_effects_laplacian_callback (gint width, gint height, guint texture,
|
||||||
gst_gl_shader_use (shader);
|
gst_gl_shader_use (shader);
|
||||||
|
|
||||||
gl->ActiveTexture (GL_TEXTURE0);
|
gl->ActiveTexture (GL_TEXTURE0);
|
||||||
gl->Enable (GL_TEXTURE_2D);
|
|
||||||
gl->BindTexture (GL_TEXTURE_2D, texture);
|
gl->BindTexture (GL_TEXTURE_2D, texture);
|
||||||
gl->Disable (GL_TEXTURE_2D);
|
|
||||||
|
|
||||||
gst_gl_shader_set_uniform_1i (shader, "tex", 0);
|
gst_gl_shader_set_uniform_1i (shader, "tex", 0);
|
||||||
gst_gl_shader_set_uniform_1f (shader, "height", height);
|
gst_gl_shader_set_uniform_1f (shader, "height", height);
|
||||||
|
|
|
@ -56,7 +56,6 @@ gst_gl_effects_luma_to_curve (GstGLEffects * effects,
|
||||||
|
|
||||||
#if GST_GL_HAVE_OPENGL
|
#if GST_GL_HAVE_OPENGL
|
||||||
if (USING_OPENGL (context)) {
|
if (USING_OPENGL (context)) {
|
||||||
gl->Enable (GL_TEXTURE_1D);
|
|
||||||
gl->BindTexture (GL_TEXTURE_1D, effects->curve[curve_index]);
|
gl->BindTexture (GL_TEXTURE_1D, effects->curve[curve_index]);
|
||||||
gl->TexParameteri (GL_TEXTURE_1D, GL_TEXTURE_MIN_FILTER, GL_NEAREST);
|
gl->TexParameteri (GL_TEXTURE_1D, GL_TEXTURE_MIN_FILTER, GL_NEAREST);
|
||||||
gl->TexParameteri (GL_TEXTURE_1D, GL_TEXTURE_MAG_FILTER, GL_NEAREST);
|
gl->TexParameteri (GL_TEXTURE_1D, GL_TEXTURE_MAG_FILTER, GL_NEAREST);
|
||||||
|
@ -65,12 +64,9 @@ gst_gl_effects_luma_to_curve (GstGLEffects * effects,
|
||||||
|
|
||||||
gl->TexImage1D (GL_TEXTURE_1D, 0, curve->bytes_per_pixel,
|
gl->TexImage1D (GL_TEXTURE_1D, 0, curve->bytes_per_pixel,
|
||||||
curve->width, 0, GL_RGB, GL_UNSIGNED_BYTE, curve->pixel_data);
|
curve->width, 0, GL_RGB, GL_UNSIGNED_BYTE, curve->pixel_data);
|
||||||
|
|
||||||
gl->Disable (GL_TEXTURE_1D);
|
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
if (USING_GLES2 (context) || USING_OPENGL3 (context)) {
|
if (USING_GLES2 (context) || USING_OPENGL3 (context)) {
|
||||||
gl->Enable (GL_TEXTURE_2D);
|
|
||||||
gl->BindTexture (GL_TEXTURE_2D, effects->curve[curve_index]);
|
gl->BindTexture (GL_TEXTURE_2D, effects->curve[curve_index]);
|
||||||
gl->TexParameteri (GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_NEAREST);
|
gl->TexParameteri (GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_NEAREST);
|
||||||
gl->TexParameteri (GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_NEAREST);
|
gl->TexParameteri (GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_NEAREST);
|
||||||
|
@ -79,37 +75,27 @@ gst_gl_effects_luma_to_curve (GstGLEffects * effects,
|
||||||
|
|
||||||
gl->TexImage2D (GL_TEXTURE_2D, 0, GL_RGB,
|
gl->TexImage2D (GL_TEXTURE_2D, 0, GL_RGB,
|
||||||
curve->width, 1, 0, GL_RGB, GL_UNSIGNED_BYTE, curve->pixel_data);
|
curve->width, 1, 0, GL_RGB, GL_UNSIGNED_BYTE, curve->pixel_data);
|
||||||
gl->Disable (GL_TEXTURE_2D);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
gl->ActiveTexture (GL_TEXTURE2);
|
gl->ActiveTexture (GL_TEXTURE2);
|
||||||
gl->Enable (GL_TEXTURE_2D);
|
|
||||||
gl->BindTexture (GL_TEXTURE_2D, texture);
|
gl->BindTexture (GL_TEXTURE_2D, texture);
|
||||||
|
|
||||||
gst_gl_shader_set_uniform_1i (shader, "tex", 2);
|
gst_gl_shader_set_uniform_1i (shader, "tex", 2);
|
||||||
|
|
||||||
gl->Disable (GL_TEXTURE_2D);
|
|
||||||
|
|
||||||
#if GST_GL_HAVE_OPENGL
|
#if GST_GL_HAVE_OPENGL
|
||||||
if (USING_OPENGL (context)) {
|
if (USING_OPENGL (context)) {
|
||||||
gl->ActiveTexture (GL_TEXTURE1);
|
gl->ActiveTexture (GL_TEXTURE1);
|
||||||
gl->Enable (GL_TEXTURE_1D);
|
|
||||||
gl->BindTexture (GL_TEXTURE_1D, effects->curve[curve_index]);
|
gl->BindTexture (GL_TEXTURE_1D, effects->curve[curve_index]);
|
||||||
|
|
||||||
gst_gl_shader_set_uniform_1i (shader, "curve", 1);
|
gst_gl_shader_set_uniform_1i (shader, "curve", 1);
|
||||||
|
|
||||||
gl->Disable (GL_TEXTURE_1D);
|
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
if (USING_GLES2 (context) || USING_OPENGL3 (context)) {
|
if (USING_GLES2 (context) || USING_OPENGL3 (context)) {
|
||||||
gl->ActiveTexture (GL_TEXTURE1);
|
gl->ActiveTexture (GL_TEXTURE1);
|
||||||
gl->Enable (GL_TEXTURE_2D);
|
|
||||||
gl->BindTexture (GL_TEXTURE_2D, effects->curve[curve_index]);
|
gl->BindTexture (GL_TEXTURE_2D, effects->curve[curve_index]);
|
||||||
|
|
||||||
gst_gl_shader_set_uniform_1i (shader, "curve", 1);
|
gst_gl_shader_set_uniform_1i (shader, "curve", 1);
|
||||||
|
|
||||||
gl->Disable (GL_TEXTURE_2D);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
gst_gl_filter_draw_texture (filter, texture, width, height);
|
gst_gl_filter_draw_texture (filter, texture, width, height);
|
||||||
|
|
|
@ -49,8 +49,6 @@ gst_gl_effects_mirror_callback (gint width, gint height, guint texture,
|
||||||
gst_gl_shader_use (shader);
|
gst_gl_shader_use (shader);
|
||||||
|
|
||||||
gl->ActiveTexture (GL_TEXTURE0);
|
gl->ActiveTexture (GL_TEXTURE0);
|
||||||
if (USING_OPENGL (context))
|
|
||||||
gl->Enable (GL_TEXTURE_2D);
|
|
||||||
gl->BindTexture (GL_TEXTURE_2D, texture);
|
gl->BindTexture (GL_TEXTURE_2D, texture);
|
||||||
|
|
||||||
gst_gl_shader_set_uniform_1i (shader, "tex", 0);
|
gst_gl_shader_set_uniform_1i (shader, "tex", 0);
|
||||||
|
|
|
@ -54,7 +54,6 @@ gst_gl_effects_rgb_to_curve (GstGLEffects * effects,
|
||||||
gl->GenTextures (1, &effects->curve[curve_index]);
|
gl->GenTextures (1, &effects->curve[curve_index]);
|
||||||
#if GST_GL_HAVE_OPENGL
|
#if GST_GL_HAVE_OPENGL
|
||||||
if (USING_OPENGL (context)) {
|
if (USING_OPENGL (context)) {
|
||||||
gl->Enable (GL_TEXTURE_1D);
|
|
||||||
gl->BindTexture (GL_TEXTURE_1D, effects->curve[curve_index]);
|
gl->BindTexture (GL_TEXTURE_1D, effects->curve[curve_index]);
|
||||||
gl->TexParameteri (GL_TEXTURE_1D, GL_TEXTURE_MIN_FILTER, GL_NEAREST);
|
gl->TexParameteri (GL_TEXTURE_1D, GL_TEXTURE_MIN_FILTER, GL_NEAREST);
|
||||||
gl->TexParameteri (GL_TEXTURE_1D, GL_TEXTURE_MAG_FILTER, GL_NEAREST);
|
gl->TexParameteri (GL_TEXTURE_1D, GL_TEXTURE_MAG_FILTER, GL_NEAREST);
|
||||||
|
@ -63,12 +62,9 @@ gst_gl_effects_rgb_to_curve (GstGLEffects * effects,
|
||||||
|
|
||||||
gl->TexImage1D (GL_TEXTURE_1D, 0, GL_RGB,
|
gl->TexImage1D (GL_TEXTURE_1D, 0, GL_RGB,
|
||||||
curve->width, 0, GL_RGB, GL_UNSIGNED_BYTE, curve->pixel_data);
|
curve->width, 0, GL_RGB, GL_UNSIGNED_BYTE, curve->pixel_data);
|
||||||
|
|
||||||
gl->Disable (GL_TEXTURE_1D);
|
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
if (USING_GLES2 (context) || USING_OPENGL3 (context)) {
|
if (USING_GLES2 (context) || USING_OPENGL3 (context)) {
|
||||||
gl->Enable (GL_TEXTURE_2D);
|
|
||||||
gl->BindTexture (GL_TEXTURE_2D, effects->curve[curve_index]);
|
gl->BindTexture (GL_TEXTURE_2D, effects->curve[curve_index]);
|
||||||
gl->TexParameteri (GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_NEAREST);
|
gl->TexParameteri (GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_NEAREST);
|
||||||
gl->TexParameteri (GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_NEAREST);
|
gl->TexParameteri (GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_NEAREST);
|
||||||
|
@ -77,37 +73,27 @@ gst_gl_effects_rgb_to_curve (GstGLEffects * effects,
|
||||||
|
|
||||||
gl->TexImage2D (GL_TEXTURE_2D, 0, GL_RGB,
|
gl->TexImage2D (GL_TEXTURE_2D, 0, GL_RGB,
|
||||||
curve->width, 1, 0, GL_RGB, GL_UNSIGNED_BYTE, curve->pixel_data);
|
curve->width, 1, 0, GL_RGB, GL_UNSIGNED_BYTE, curve->pixel_data);
|
||||||
gl->Disable (GL_TEXTURE_2D);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
gl->ActiveTexture (GL_TEXTURE0);
|
gl->ActiveTexture (GL_TEXTURE0);
|
||||||
gl->Enable (GL_TEXTURE_2D);
|
|
||||||
gl->BindTexture (GL_TEXTURE_2D, texture);
|
gl->BindTexture (GL_TEXTURE_2D, texture);
|
||||||
|
|
||||||
gst_gl_shader_set_uniform_1i (shader, "tex", 0);
|
gst_gl_shader_set_uniform_1i (shader, "tex", 0);
|
||||||
|
|
||||||
gl->Disable (GL_TEXTURE_2D);
|
|
||||||
|
|
||||||
#if GST_GL_HAVE_OPENGL
|
#if GST_GL_HAVE_OPENGL
|
||||||
if (USING_OPENGL (context)) {
|
if (USING_OPENGL (context)) {
|
||||||
gl->ActiveTexture (GL_TEXTURE1);
|
gl->ActiveTexture (GL_TEXTURE1);
|
||||||
gl->Enable (GL_TEXTURE_1D);
|
|
||||||
gl->BindTexture (GL_TEXTURE_1D, effects->curve[curve_index]);
|
gl->BindTexture (GL_TEXTURE_1D, effects->curve[curve_index]);
|
||||||
|
|
||||||
gst_gl_shader_set_uniform_1i (shader, "curve", 1);
|
gst_gl_shader_set_uniform_1i (shader, "curve", 1);
|
||||||
|
|
||||||
gl->Disable (GL_TEXTURE_1D);
|
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
if (USING_GLES2 (context) || USING_OPENGL3 (context)) {
|
if (USING_GLES2 (context) || USING_OPENGL3 (context)) {
|
||||||
gl->ActiveTexture (GL_TEXTURE1);
|
gl->ActiveTexture (GL_TEXTURE1);
|
||||||
gl->Enable (GL_TEXTURE_2D);
|
|
||||||
gl->BindTexture (GL_TEXTURE_2D, effects->curve[curve_index]);
|
gl->BindTexture (GL_TEXTURE_2D, effects->curve[curve_index]);
|
||||||
|
|
||||||
gst_gl_shader_set_uniform_1i (shader, "curve", 1);
|
gst_gl_shader_set_uniform_1i (shader, "curve", 1);
|
||||||
|
|
||||||
gl->Disable (GL_TEXTURE_2D);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
gst_gl_filter_draw_texture (filter, texture, width, height);
|
gst_gl_filter_draw_texture (filter, texture, width, height);
|
||||||
|
|
|
@ -49,7 +49,6 @@ gst_gl_effects_sin_callback (gint width, gint height, guint texture,
|
||||||
gst_gl_shader_use (shader);
|
gst_gl_shader_use (shader);
|
||||||
|
|
||||||
gl->ActiveTexture (GL_TEXTURE0);
|
gl->ActiveTexture (GL_TEXTURE0);
|
||||||
gl->Enable (GL_TEXTURE_2D);
|
|
||||||
gl->BindTexture (GL_TEXTURE_2D, texture);
|
gl->BindTexture (GL_TEXTURE_2D, texture);
|
||||||
|
|
||||||
gst_gl_shader_set_uniform_1i (shader, "tex", 0);
|
gst_gl_shader_set_uniform_1i (shader, "tex", 0);
|
||||||
|
|
|
@ -48,9 +48,7 @@ gst_gl_effects_sobel_callback_desaturate (gint width, gint height,
|
||||||
gst_gl_shader_use (shader);
|
gst_gl_shader_use (shader);
|
||||||
|
|
||||||
gl->ActiveTexture (GL_TEXTURE0);
|
gl->ActiveTexture (GL_TEXTURE0);
|
||||||
gl->Enable (GL_TEXTURE_2D);
|
|
||||||
gl->BindTexture (GL_TEXTURE_2D, texture);
|
gl->BindTexture (GL_TEXTURE_2D, texture);
|
||||||
gl->Disable (GL_TEXTURE_2D);
|
|
||||||
|
|
||||||
gst_gl_shader_set_uniform_1i (shader, "tex", 0);
|
gst_gl_shader_set_uniform_1i (shader, "tex", 0);
|
||||||
|
|
||||||
|
@ -81,9 +79,7 @@ gst_gl_effects_sobel_callback_hconv (gint width, gint height, guint texture,
|
||||||
gst_gl_shader_use (shader);
|
gst_gl_shader_use (shader);
|
||||||
|
|
||||||
gl->ActiveTexture (GL_TEXTURE0);
|
gl->ActiveTexture (GL_TEXTURE0);
|
||||||
gl->Enable (GL_TEXTURE_2D);
|
|
||||||
gl->BindTexture (GL_TEXTURE_2D, texture);
|
gl->BindTexture (GL_TEXTURE_2D, texture);
|
||||||
gl->Disable (GL_TEXTURE_2D);
|
|
||||||
|
|
||||||
gst_gl_shader_set_uniform_1i (shader, "tex", 0);
|
gst_gl_shader_set_uniform_1i (shader, "tex", 0);
|
||||||
gst_gl_shader_set_uniform_1f (shader, "width", width);
|
gst_gl_shader_set_uniform_1f (shader, "width", width);
|
||||||
|
@ -115,9 +111,7 @@ gst_gl_effects_sobel_callback_vconv (gint width, gint height, guint texture,
|
||||||
gst_gl_shader_use (shader);
|
gst_gl_shader_use (shader);
|
||||||
|
|
||||||
gl->ActiveTexture (GL_TEXTURE0);
|
gl->ActiveTexture (GL_TEXTURE0);
|
||||||
gl->Enable (GL_TEXTURE_2D);
|
|
||||||
gl->BindTexture (GL_TEXTURE_2D, texture);
|
gl->BindTexture (GL_TEXTURE_2D, texture);
|
||||||
gl->Disable (GL_TEXTURE_2D);
|
|
||||||
|
|
||||||
gst_gl_shader_set_uniform_1i (shader, "tex", 0);
|
gst_gl_shader_set_uniform_1i (shader, "tex", 0);
|
||||||
gst_gl_shader_set_uniform_1f (shader, "height", height);
|
gst_gl_shader_set_uniform_1f (shader, "height", height);
|
||||||
|
@ -149,9 +143,7 @@ gst_gl_effects_sobel_callback_length (gint width, gint height, guint texture,
|
||||||
gst_gl_shader_use (shader);
|
gst_gl_shader_use (shader);
|
||||||
|
|
||||||
gl->ActiveTexture (GL_TEXTURE0);
|
gl->ActiveTexture (GL_TEXTURE0);
|
||||||
gl->Enable (GL_TEXTURE_2D);
|
|
||||||
gl->BindTexture (GL_TEXTURE_2D, texture);
|
gl->BindTexture (GL_TEXTURE_2D, texture);
|
||||||
gl->Disable (GL_TEXTURE_2D);
|
|
||||||
|
|
||||||
gst_gl_shader_set_uniform_1i (shader, "tex", 0);
|
gst_gl_shader_set_uniform_1i (shader, "tex", 0);
|
||||||
gst_gl_shader_set_uniform_1i (shader, "invert", effects->invert);
|
gst_gl_shader_set_uniform_1i (shader, "invert", effects->invert);
|
||||||
|
|
|
@ -49,7 +49,6 @@ gst_gl_effects_square_callback (gint width, gint height, guint texture,
|
||||||
gst_gl_shader_use (shader);
|
gst_gl_shader_use (shader);
|
||||||
|
|
||||||
gl->ActiveTexture (GL_TEXTURE0);
|
gl->ActiveTexture (GL_TEXTURE0);
|
||||||
gl->Enable (GL_TEXTURE_2D);
|
|
||||||
gl->BindTexture (GL_TEXTURE_2D, texture);
|
gl->BindTexture (GL_TEXTURE_2D, texture);
|
||||||
|
|
||||||
gst_gl_shader_set_uniform_1i (shader, "tex", 0);
|
gst_gl_shader_set_uniform_1i (shader, "tex", 0);
|
||||||
|
|
|
@ -49,7 +49,6 @@ gst_gl_effects_squeeze_callback (gint width, gint height, guint texture,
|
||||||
gst_gl_shader_use (shader);
|
gst_gl_shader_use (shader);
|
||||||
|
|
||||||
gl->ActiveTexture (GL_TEXTURE0);
|
gl->ActiveTexture (GL_TEXTURE0);
|
||||||
gl->Enable (GL_TEXTURE_2D);
|
|
||||||
gl->BindTexture (GL_TEXTURE_2D, texture);
|
gl->BindTexture (GL_TEXTURE_2D, texture);
|
||||||
|
|
||||||
gst_gl_shader_set_uniform_1i (shader, "tex", 0);
|
gst_gl_shader_set_uniform_1i (shader, "tex", 0);
|
||||||
|
|
|
@ -48,7 +48,6 @@ gst_gl_effects_stretch_callback (gint width, gint height, guint texture,
|
||||||
gst_gl_shader_use (shader);
|
gst_gl_shader_use (shader);
|
||||||
|
|
||||||
gl->ActiveTexture (GL_TEXTURE0);
|
gl->ActiveTexture (GL_TEXTURE0);
|
||||||
gl->Enable (GL_TEXTURE_2D);
|
|
||||||
gl->BindTexture (GL_TEXTURE_2D, texture);
|
gl->BindTexture (GL_TEXTURE_2D, texture);
|
||||||
|
|
||||||
gst_gl_shader_set_uniform_1i (shader, "tex", 0);
|
gst_gl_shader_set_uniform_1i (shader, "tex", 0);
|
||||||
|
|
|
@ -49,7 +49,6 @@ gst_gl_effects_tunnel_callback (gint width, gint height, guint texture,
|
||||||
gst_gl_shader_use (shader);
|
gst_gl_shader_use (shader);
|
||||||
|
|
||||||
gl->ActiveTexture (GL_TEXTURE0);
|
gl->ActiveTexture (GL_TEXTURE0);
|
||||||
gl->Enable (GL_TEXTURE_2D);
|
|
||||||
gl->BindTexture (GL_TEXTURE_2D, texture);
|
gl->BindTexture (GL_TEXTURE_2D, texture);
|
||||||
|
|
||||||
gst_gl_shader_set_uniform_1i (shader, "tex", 0);
|
gst_gl_shader_set_uniform_1i (shader, "tex", 0);
|
||||||
|
|
|
@ -49,7 +49,6 @@ gst_gl_effects_twirl_callback (gint width, gint height, guint texture,
|
||||||
gst_gl_shader_use (shader);
|
gst_gl_shader_use (shader);
|
||||||
|
|
||||||
gl->ActiveTexture (GL_TEXTURE0);
|
gl->ActiveTexture (GL_TEXTURE0);
|
||||||
gl->Enable (GL_TEXTURE_2D);
|
|
||||||
gl->BindTexture (GL_TEXTURE_2D, texture);
|
gl->BindTexture (GL_TEXTURE_2D, texture);
|
||||||
|
|
||||||
gst_gl_shader_set_uniform_1i (shader, "tex", 0);
|
gst_gl_shader_set_uniform_1i (shader, "tex", 0);
|
||||||
|
|
|
@ -68,9 +68,7 @@ gst_gl_effects_xray_step_two (gint width, gint height, guint texture,
|
||||||
gst_gl_shader_use (shader);
|
gst_gl_shader_use (shader);
|
||||||
|
|
||||||
gl->ActiveTexture (GL_TEXTURE1);
|
gl->ActiveTexture (GL_TEXTURE1);
|
||||||
gl->Enable (GL_TEXTURE_2D);
|
|
||||||
gl->BindTexture (GL_TEXTURE_2D, texture);
|
gl->BindTexture (GL_TEXTURE_2D, texture);
|
||||||
gl->Disable (GL_TEXTURE_2D);
|
|
||||||
|
|
||||||
gst_gl_shader_set_uniform_1i (shader, "tex", 1);
|
gst_gl_shader_set_uniform_1i (shader, "tex", 1);
|
||||||
gst_gl_shader_set_uniform_1fv (shader, "kernel", 9, gauss_kernel);
|
gst_gl_shader_set_uniform_1fv (shader, "kernel", 9, gauss_kernel);
|
||||||
|
@ -105,9 +103,7 @@ gst_gl_effects_xray_step_three (gint width, gint height, guint texture,
|
||||||
gst_gl_shader_use (shader);
|
gst_gl_shader_use (shader);
|
||||||
|
|
||||||
gl->ActiveTexture (GL_TEXTURE1);
|
gl->ActiveTexture (GL_TEXTURE1);
|
||||||
gl->Enable (GL_TEXTURE_2D);
|
|
||||||
gl->BindTexture (GL_TEXTURE_2D, texture);
|
gl->BindTexture (GL_TEXTURE_2D, texture);
|
||||||
gl->Disable (GL_TEXTURE_2D);
|
|
||||||
|
|
||||||
gst_gl_shader_set_uniform_1i (shader, "tex", 1);
|
gst_gl_shader_set_uniform_1i (shader, "tex", 1);
|
||||||
gst_gl_shader_set_uniform_1fv (shader, "kernel", 9, gauss_kernel);
|
gst_gl_shader_set_uniform_1fv (shader, "kernel", 9, gauss_kernel);
|
||||||
|
@ -143,9 +139,7 @@ gst_gl_effects_xray_desaturate (gint width, gint height, guint texture,
|
||||||
gst_gl_shader_use (shader);
|
gst_gl_shader_use (shader);
|
||||||
|
|
||||||
gl->ActiveTexture (GL_TEXTURE1);
|
gl->ActiveTexture (GL_TEXTURE1);
|
||||||
gl->Enable (GL_TEXTURE_2D);
|
|
||||||
gl->BindTexture (GL_TEXTURE_2D, texture);
|
gl->BindTexture (GL_TEXTURE_2D, texture);
|
||||||
gl->Disable (GL_TEXTURE_2D);
|
|
||||||
|
|
||||||
gst_gl_shader_set_uniform_1i (shader, "tex", 1);
|
gst_gl_shader_set_uniform_1i (shader, "tex", 1);
|
||||||
gst_gl_filter_draw_texture (filter, texture, width, height);
|
gst_gl_filter_draw_texture (filter, texture, width, height);
|
||||||
|
@ -178,9 +172,7 @@ gst_gl_effects_xray_sobel_hconv (gint width, gint height, guint texture,
|
||||||
gst_gl_shader_use (shader);
|
gst_gl_shader_use (shader);
|
||||||
|
|
||||||
gl->ActiveTexture (GL_TEXTURE1);
|
gl->ActiveTexture (GL_TEXTURE1);
|
||||||
gl->Enable (GL_TEXTURE_2D);
|
|
||||||
gl->BindTexture (GL_TEXTURE_2D, texture);
|
gl->BindTexture (GL_TEXTURE_2D, texture);
|
||||||
gl->Disable (GL_TEXTURE_2D);
|
|
||||||
|
|
||||||
gst_gl_shader_set_uniform_1i (shader, "tex", 1);
|
gst_gl_shader_set_uniform_1i (shader, "tex", 1);
|
||||||
gst_gl_shader_set_uniform_1f (shader, "width", width);
|
gst_gl_shader_set_uniform_1f (shader, "width", width);
|
||||||
|
@ -215,9 +207,7 @@ gst_gl_effects_xray_sobel_vconv (gint width, gint height, guint texture,
|
||||||
gst_gl_shader_use (shader);
|
gst_gl_shader_use (shader);
|
||||||
|
|
||||||
gl->ActiveTexture (GL_TEXTURE1);
|
gl->ActiveTexture (GL_TEXTURE1);
|
||||||
gl->Enable (GL_TEXTURE_2D);
|
|
||||||
gl->BindTexture (GL_TEXTURE_2D, texture);
|
gl->BindTexture (GL_TEXTURE_2D, texture);
|
||||||
gl->Disable (GL_TEXTURE_2D);
|
|
||||||
|
|
||||||
gst_gl_shader_set_uniform_1i (shader, "tex", 1);
|
gst_gl_shader_set_uniform_1i (shader, "tex", 1);
|
||||||
gst_gl_shader_set_uniform_1f (shader, "height", height);
|
gst_gl_shader_set_uniform_1f (shader, "height", height);
|
||||||
|
@ -252,9 +242,7 @@ gst_gl_effects_xray_sobel_length (gint width, gint height, guint texture,
|
||||||
gst_gl_shader_use (shader);
|
gst_gl_shader_use (shader);
|
||||||
|
|
||||||
gl->ActiveTexture (GL_TEXTURE1);
|
gl->ActiveTexture (GL_TEXTURE1);
|
||||||
gl->Enable (GL_TEXTURE_2D);
|
|
||||||
gl->BindTexture (GL_TEXTURE_2D, texture);
|
gl->BindTexture (GL_TEXTURE_2D, texture);
|
||||||
gl->Disable (GL_TEXTURE_2D);
|
|
||||||
|
|
||||||
gst_gl_shader_set_uniform_1i (shader, "tex", 1);
|
gst_gl_shader_set_uniform_1i (shader, "tex", 1);
|
||||||
gst_gl_shader_set_uniform_1i (shader, "invert", TRUE);
|
gst_gl_shader_set_uniform_1i (shader, "invert", TRUE);
|
||||||
|
@ -289,16 +277,12 @@ gst_gl_effects_xray_step_five (gint width, gint height, guint texture,
|
||||||
gst_gl_shader_use (shader);
|
gst_gl_shader_use (shader);
|
||||||
|
|
||||||
gl->ActiveTexture (GL_TEXTURE2);
|
gl->ActiveTexture (GL_TEXTURE2);
|
||||||
gl->Enable (GL_TEXTURE_2D);
|
|
||||||
gl->BindTexture (GL_TEXTURE_2D, effects->midtexture[2]);
|
gl->BindTexture (GL_TEXTURE_2D, effects->midtexture[2]);
|
||||||
gl->Disable (GL_TEXTURE_2D);
|
|
||||||
|
|
||||||
gst_gl_shader_set_uniform_1i (shader, "base", 2);
|
gst_gl_shader_set_uniform_1i (shader, "base", 2);
|
||||||
|
|
||||||
gl->ActiveTexture (GL_TEXTURE1);
|
gl->ActiveTexture (GL_TEXTURE1);
|
||||||
gl->Enable (GL_TEXTURE_2D);
|
|
||||||
gl->BindTexture (GL_TEXTURE_2D, texture);
|
gl->BindTexture (GL_TEXTURE_2D, texture);
|
||||||
gl->Disable (GL_TEXTURE_2D);
|
|
||||||
|
|
||||||
gst_gl_shader_set_uniform_1f (shader, "alpha", (gfloat) 0.5f);
|
gst_gl_shader_set_uniform_1f (shader, "alpha", (gfloat) 0.5f);
|
||||||
gst_gl_shader_set_uniform_1i (shader, "blend", 1);
|
gst_gl_shader_set_uniform_1i (shader, "blend", 1);
|
||||||
|
|
|
@ -92,7 +92,6 @@ gst_gl_test_src_smpte (GstGLTestSrc * v, GstBuffer * buffer, int w, int h)
|
||||||
glClear (GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT);
|
glClear (GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT);
|
||||||
|
|
||||||
glDisable (GL_CULL_FACE);
|
glDisable (GL_CULL_FACE);
|
||||||
glDisable (GL_TEXTURE_2D);
|
|
||||||
|
|
||||||
glMatrixMode (GL_PROJECTION);
|
glMatrixMode (GL_PROJECTION);
|
||||||
glLoadIdentity ();
|
glLoadIdentity ();
|
||||||
|
@ -229,7 +228,6 @@ gst_gl_test_src_shader (GstGLTestSrc * v, GstBuffer * buffer, int w, int h)
|
||||||
|
|
||||||
gst_gl_context_clear_shader (v->context);
|
gst_gl_context_clear_shader (v->context);
|
||||||
gl->BindTexture (GL_TEXTURE_2D, 0);
|
gl->BindTexture (GL_TEXTURE_2D, 0);
|
||||||
gl->Disable (GL_TEXTURE_2D);
|
|
||||||
|
|
||||||
gst_gl_shader_use (v->shader);
|
gst_gl_shader_use (v->shader);
|
||||||
|
|
||||||
|
@ -322,7 +320,6 @@ gst_gl_test_src_checkers (GstGLTestSrc * v, gint checker_width)
|
||||||
|
|
||||||
gst_gl_context_clear_shader (v->context);
|
gst_gl_context_clear_shader (v->context);
|
||||||
gl->BindTexture (GL_TEXTURE_2D, 0);
|
gl->BindTexture (GL_TEXTURE_2D, 0);
|
||||||
gl->Disable (GL_TEXTURE_2D);
|
|
||||||
|
|
||||||
gst_gl_shader_use (v->shader);
|
gst_gl_shader_use (v->shader);
|
||||||
|
|
||||||
|
|
|
@ -290,8 +290,6 @@ gst_gl_deinterlace_callback (gint width, gint height, guint texture,
|
||||||
|
|
||||||
gst_gl_shader_use (deinterlace_filter->shader);
|
gst_gl_shader_use (deinterlace_filter->shader);
|
||||||
|
|
||||||
gl->Enable (GL_TEXTURE_2D);
|
|
||||||
|
|
||||||
if (G_UNLIKELY (deinterlace_filter->prev_tex == 0)) {
|
if (G_UNLIKELY (deinterlace_filter->prev_tex == 0)) {
|
||||||
gst_gl_context_gen_texture (GST_GL_BASE_FILTER (filter)->context,
|
gst_gl_context_gen_texture (GST_GL_BASE_FILTER (filter)->context,
|
||||||
&deinterlace_filter->prev_tex,
|
&deinterlace_filter->prev_tex,
|
||||||
|
@ -306,7 +304,6 @@ gst_gl_deinterlace_callback (gint width, gint height, guint texture,
|
||||||
|
|
||||||
gl->ActiveTexture (GL_TEXTURE0);
|
gl->ActiveTexture (GL_TEXTURE0);
|
||||||
gst_gl_shader_set_uniform_1i (deinterlace_filter->shader, "tex", 0);
|
gst_gl_shader_set_uniform_1i (deinterlace_filter->shader, "tex", 0);
|
||||||
gl->BindTexture (GL_TEXTURE_2D, texture);
|
|
||||||
|
|
||||||
gst_gl_shader_set_uniform_1f (deinterlace_filter->shader, "max_comb",
|
gst_gl_shader_set_uniform_1f (deinterlace_filter->shader, "max_comb",
|
||||||
5.0f / 255.0f);
|
5.0f / 255.0f);
|
||||||
|
@ -340,8 +337,6 @@ gst_gl_deinterlace_callback (gint width, gint height, guint texture,
|
||||||
gl->ClientActiveTexture (GL_TEXTURE0);
|
gl->ClientActiveTexture (GL_TEXTURE0);
|
||||||
gl->DisableClientState (GL_TEXTURE_COORD_ARRAY);
|
gl->DisableClientState (GL_TEXTURE_COORD_ARRAY);
|
||||||
|
|
||||||
gl->Disable (GL_TEXTURE_2D);
|
|
||||||
|
|
||||||
if (texture == filter->in_tex_id) {
|
if (texture == filter->in_tex_id) {
|
||||||
temp = filter->in_tex_id;
|
temp = filter->in_tex_id;
|
||||||
filter->in_tex_id = deinterlace_filter->prev_tex;
|
filter->in_tex_id = deinterlace_filter->prev_tex;
|
||||||
|
|
|
@ -303,16 +303,12 @@ gst_gl_differencematte_diff (gint width, gint height, guint texture,
|
||||||
gst_gl_shader_use (differencematte->shader[0]);
|
gst_gl_shader_use (differencematte->shader[0]);
|
||||||
|
|
||||||
gl->ActiveTexture (GL_TEXTURE0);
|
gl->ActiveTexture (GL_TEXTURE0);
|
||||||
gl->Enable (GL_TEXTURE_2D);
|
|
||||||
gl->BindTexture (GL_TEXTURE_2D, texture);
|
gl->BindTexture (GL_TEXTURE_2D, texture);
|
||||||
gl->Disable (GL_TEXTURE_2D);
|
|
||||||
|
|
||||||
gst_gl_shader_set_uniform_1i (differencematte->shader[0], "current", 0);
|
gst_gl_shader_set_uniform_1i (differencematte->shader[0], "current", 0);
|
||||||
|
|
||||||
gl->ActiveTexture (GL_TEXTURE1);
|
gl->ActiveTexture (GL_TEXTURE1);
|
||||||
gl->Enable (GL_TEXTURE_2D);
|
|
||||||
gl->BindTexture (GL_TEXTURE_2D, differencematte->savedbgtexture);
|
gl->BindTexture (GL_TEXTURE_2D, differencematte->savedbgtexture);
|
||||||
gl->Disable (GL_TEXTURE_2D);
|
|
||||||
|
|
||||||
gst_gl_shader_set_uniform_1i (differencematte->shader[0], "saved", 1);
|
gst_gl_shader_set_uniform_1i (differencematte->shader[0], "saved", 1);
|
||||||
|
|
||||||
|
@ -333,9 +329,7 @@ gst_gl_differencematte_hblur (gint width, gint height, guint texture,
|
||||||
gst_gl_shader_use (differencematte->shader[1]);
|
gst_gl_shader_use (differencematte->shader[1]);
|
||||||
|
|
||||||
gl->ActiveTexture (GL_TEXTURE0);
|
gl->ActiveTexture (GL_TEXTURE0);
|
||||||
gl->Enable (GL_TEXTURE_2D);
|
|
||||||
gl->BindTexture (GL_TEXTURE_2D, texture);
|
gl->BindTexture (GL_TEXTURE_2D, texture);
|
||||||
gl->Disable (GL_TEXTURE_2D);
|
|
||||||
|
|
||||||
gst_gl_shader_set_uniform_1i (differencematte->shader[1], "tex", 0);
|
gst_gl_shader_set_uniform_1i (differencematte->shader[1], "tex", 0);
|
||||||
|
|
||||||
|
@ -360,9 +354,7 @@ gst_gl_differencematte_vblur (gint width, gint height, guint texture,
|
||||||
gst_gl_shader_use (differencematte->shader[2]);
|
gst_gl_shader_use (differencematte->shader[2]);
|
||||||
|
|
||||||
gl->ActiveTexture (GL_TEXTURE0);
|
gl->ActiveTexture (GL_TEXTURE0);
|
||||||
gl->Enable (GL_TEXTURE_2D);
|
|
||||||
gl->BindTexture (GL_TEXTURE_2D, texture);
|
gl->BindTexture (GL_TEXTURE_2D, texture);
|
||||||
gl->Disable (GL_TEXTURE_2D);
|
|
||||||
|
|
||||||
gst_gl_shader_set_uniform_1i (differencematte->shader[2], "tex", 0);
|
gst_gl_shader_set_uniform_1i (differencematte->shader[2], "tex", 0);
|
||||||
|
|
||||||
|
@ -387,23 +379,17 @@ gst_gl_differencematte_interp (gint width, gint height, guint texture,
|
||||||
gst_gl_shader_use (differencematte->shader[3]);
|
gst_gl_shader_use (differencematte->shader[3]);
|
||||||
|
|
||||||
gl->ActiveTexture (GL_TEXTURE0);
|
gl->ActiveTexture (GL_TEXTURE0);
|
||||||
gl->Enable (GL_TEXTURE_2D);
|
|
||||||
gl->BindTexture (GL_TEXTURE_2D, texture);
|
gl->BindTexture (GL_TEXTURE_2D, texture);
|
||||||
gl->Disable (GL_TEXTURE_2D);
|
|
||||||
|
|
||||||
gst_gl_shader_set_uniform_1i (differencematte->shader[3], "blend", 0);
|
gst_gl_shader_set_uniform_1i (differencematte->shader[3], "blend", 0);
|
||||||
|
|
||||||
gl->ActiveTexture (GL_TEXTURE1);
|
gl->ActiveTexture (GL_TEXTURE1);
|
||||||
gl->Enable (GL_TEXTURE_2D);
|
|
||||||
gl->BindTexture (GL_TEXTURE_2D, differencematte->newbgtexture);
|
gl->BindTexture (GL_TEXTURE_2D, differencematte->newbgtexture);
|
||||||
gl->Disable (GL_TEXTURE_2D);
|
|
||||||
|
|
||||||
gst_gl_shader_set_uniform_1i (differencematte->shader[3], "base", 1);
|
gst_gl_shader_set_uniform_1i (differencematte->shader[3], "base", 1);
|
||||||
|
|
||||||
gl->ActiveTexture (GL_TEXTURE2);
|
gl->ActiveTexture (GL_TEXTURE2);
|
||||||
gl->Enable (GL_TEXTURE_2D);
|
|
||||||
gl->BindTexture (GL_TEXTURE_2D, differencematte->midtexture[2]);
|
gl->BindTexture (GL_TEXTURE_2D, differencematte->midtexture[2]);
|
||||||
gl->Disable (GL_TEXTURE_2D);
|
|
||||||
|
|
||||||
gst_gl_shader_set_uniform_1i (differencematte->shader[3], "alpha", 2);
|
gst_gl_shader_set_uniform_1i (differencematte->shader[3], "alpha", 2);
|
||||||
|
|
||||||
|
|
|
@ -329,9 +329,7 @@ gst_gl_filter_glass_draw_video_plane (GstGLFilter * filter,
|
||||||
};
|
};
|
||||||
|
|
||||||
gl->ActiveTexture (GL_TEXTURE0);
|
gl->ActiveTexture (GL_TEXTURE0);
|
||||||
gl->Enable (GL_TEXTURE_2D);
|
|
||||||
gl->BindTexture (GL_TEXTURE_2D, texture);
|
gl->BindTexture (GL_TEXTURE_2D, texture);
|
||||||
gl->Disable (GL_TEXTURE_2D);
|
|
||||||
|
|
||||||
gst_gl_shader_set_uniform_1i (glass_filter->shader, "tex", 0);
|
gst_gl_shader_set_uniform_1i (glass_filter->shader, "tex", 0);
|
||||||
gst_gl_shader_set_uniform_1f (glass_filter->shader, "yrot", rotation);
|
gst_gl_shader_set_uniform_1f (glass_filter->shader, "yrot", rotation);
|
||||||
|
@ -408,6 +406,5 @@ gst_gl_filter_glass_callback (gpointer stuff)
|
||||||
|
|
||||||
gst_gl_context_clear_shader (GST_GL_BASE_FILTER (filter)->context);
|
gst_gl_context_clear_shader (GST_GL_BASE_FILTER (filter)->context);
|
||||||
|
|
||||||
gl->Disable (GL_TEXTURE_2D);
|
|
||||||
gl->Disable (GL_BLEND);
|
gl->Disable (GL_BLEND);
|
||||||
}
|
}
|
||||||
|
|
|
@ -1523,14 +1523,12 @@ gst_glimage_sink_on_draw (GstGLImageSink * gl_sink)
|
||||||
|
|
||||||
/* make sure that the environnement is clean */
|
/* make sure that the environnement is clean */
|
||||||
gst_gl_context_clear_shader (gl_sink->context);
|
gst_gl_context_clear_shader (gl_sink->context);
|
||||||
|
gl->BindTexture (GL_TEXTURE_2D, 0);
|
||||||
#if GST_GL_HAVE_OPENGL
|
#if GST_GL_HAVE_OPENGL
|
||||||
if (USING_OPENGL (gl_sink->context))
|
if (USING_OPENGL (gl_sink->context))
|
||||||
gl->Disable (GL_TEXTURE_2D);
|
gl->Disable (GL_TEXTURE_2D);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
gl->BindTexture (GL_TEXTURE_2D, 0);
|
|
||||||
|
|
||||||
sample = gst_sample_new (gl_sink->stored_buffer,
|
sample = gst_sample_new (gl_sink->stored_buffer,
|
||||||
gl_sink->caps, &GST_BASE_SINK (gl_sink)->segment, NULL);
|
gl_sink->caps, &GST_BASE_SINK (gl_sink)->segment, NULL);
|
||||||
|
|
||||||
|
|
|
@ -242,7 +242,6 @@ gst_gl_mosaic_callback (gpointer stuff)
|
||||||
|
|
||||||
gst_gl_context_clear_shader (GST_GL_BASE_MIXER (mixer)->context);
|
gst_gl_context_clear_shader (GST_GL_BASE_MIXER (mixer)->context);
|
||||||
gl->BindTexture (GL_TEXTURE_2D, 0);
|
gl->BindTexture (GL_TEXTURE_2D, 0);
|
||||||
gl->Disable (GL_TEXTURE_2D);
|
|
||||||
|
|
||||||
gl->Enable (GL_DEPTH_TEST);
|
gl->Enable (GL_DEPTH_TEST);
|
||||||
|
|
||||||
|
|
|
@ -429,10 +429,6 @@ gst_gl_overlay_callback (gint width, gint height, guint texture, gpointer stuff)
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
if (gst_gl_context_get_gl_api (GST_GL_BASE_FILTER (filter)->context) &
|
|
||||||
GST_GL_API_OPENGL)
|
|
||||||
gl->Enable (GL_TEXTURE_2D);
|
|
||||||
|
|
||||||
gl->ActiveTexture (GL_TEXTURE0);
|
gl->ActiveTexture (GL_TEXTURE0);
|
||||||
gl->BindTexture (GL_TEXTURE_2D, texture);
|
gl->BindTexture (GL_TEXTURE_2D, texture);
|
||||||
|
|
||||||
|
|
|
@ -911,9 +911,6 @@ gst_gl_video_mixer_callback (gpointer stuff)
|
||||||
|
|
||||||
gst_gl_context_clear_shader (GST_GL_BASE_MIXER (mixer)->context);
|
gst_gl_context_clear_shader (GST_GL_BASE_MIXER (mixer)->context);
|
||||||
gl->BindTexture (GL_TEXTURE_2D, 0);
|
gl->BindTexture (GL_TEXTURE_2D, 0);
|
||||||
if (gst_gl_context_get_gl_api (GST_GL_BASE_MIXER (mixer)->context) &
|
|
||||||
GST_GL_API_OPENGL)
|
|
||||||
gl->Disable (GL_TEXTURE_2D);
|
|
||||||
|
|
||||||
gl->Disable (GL_DEPTH_TEST);
|
gl->Disable (GL_DEPTH_TEST);
|
||||||
gl->Disable (GL_CULL_FACE);
|
gl->Disable (GL_CULL_FACE);
|
||||||
|
|
|
@ -1134,16 +1134,13 @@ gst_gl_filter_draw_texture (GstGLFilter * filter, GLuint texture,
|
||||||
};
|
};
|
||||||
|
|
||||||
gl->ActiveTexture (GL_TEXTURE0);
|
gl->ActiveTexture (GL_TEXTURE0);
|
||||||
|
|
||||||
gl->Enable (GL_TEXTURE_2D);
|
|
||||||
gl->BindTexture (GL_TEXTURE_2D, texture);
|
gl->BindTexture (GL_TEXTURE_2D, texture);
|
||||||
|
|
||||||
gl->ClientActiveTexture (GL_TEXTURE0);
|
|
||||||
|
|
||||||
gl->EnableClientState (GL_VERTEX_ARRAY);
|
gl->EnableClientState (GL_VERTEX_ARRAY);
|
||||||
gl->EnableClientState (GL_TEXTURE_COORD_ARRAY);
|
|
||||||
|
|
||||||
gl->VertexPointer (2, GL_FLOAT, 0, &verts);
|
gl->VertexPointer (2, GL_FLOAT, 0, &verts);
|
||||||
|
|
||||||
|
gl->ClientActiveTexture (GL_TEXTURE0);
|
||||||
|
gl->EnableClientState (GL_TEXTURE_COORD_ARRAY);
|
||||||
gl->TexCoordPointer (2, GL_FLOAT, 0, &texcoords);
|
gl->TexCoordPointer (2, GL_FLOAT, 0, &texcoords);
|
||||||
|
|
||||||
gl->DrawArrays (GL_TRIANGLE_FAN, 0, 4);
|
gl->DrawArrays (GL_TRIANGLE_FAN, 0, 4);
|
||||||
|
|
|
@ -173,20 +173,20 @@ draw_render (gpointer data)
|
||||||
gl->MatrixMode (GL_PROJECTION);
|
gl->MatrixMode (GL_PROJECTION);
|
||||||
gl->LoadIdentity ();
|
gl->LoadIdentity ();
|
||||||
|
|
||||||
gl->Enable (GL_TEXTURE_2D);
|
gl->ActiveTexture (GL_TEXTURE_2D);
|
||||||
gl->BindTexture (GL_TEXTURE_2D, tex);
|
gl->BindTexture (GL_TEXTURE_2D, tex_id);
|
||||||
|
|
||||||
gl->EnableClientState (GL_VERTEX_ARRAY);
|
gl->EnableClientState (GL_VERTEX_ARRAY);
|
||||||
gl->EnableClientState (GL_TEXTURE_COORD_ARRAY);
|
|
||||||
gl->VertexPointer (2, GL_FLOAT, 0, &verts);
|
gl->VertexPointer (2, GL_FLOAT, 0, &verts);
|
||||||
|
|
||||||
|
gl->ClientActiveTexture (GL_TEXTURE0);
|
||||||
|
gl->EnableClientState (GL_TEXTURE_COORD_ARRAY);
|
||||||
gl->TexCoordPointer (2, GL_FLOAT, 0, &texcoords);
|
gl->TexCoordPointer (2, GL_FLOAT, 0, &texcoords);
|
||||||
|
|
||||||
gl->DrawArrays (GL_TRIANGLE_FAN, 0, 4);
|
gl->DrawArrays (GL_TRIANGLE_FAN, 0, 4);
|
||||||
|
|
||||||
gl->DisableClientState (GL_VERTEX_ARRAY);
|
gl->DisableClientState (GL_VERTEX_ARRAY);
|
||||||
gl->DisableClientState (GL_TEXTURE_COORD_ARRAY);
|
gl->DisableClientState (GL_TEXTURE_COORD_ARRAY);
|
||||||
|
|
||||||
gl->Disable (GL_TEXTURE_2D);
|
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
#if GST_GL_HAVE_GLES2
|
#if GST_GL_HAVE_GLES2
|
||||||
|
|
|
@ -168,20 +168,20 @@ draw_render (gpointer data)
|
||||||
gl->MatrixMode (GL_PROJECTION);
|
gl->MatrixMode (GL_PROJECTION);
|
||||||
gl->LoadIdentity ();
|
gl->LoadIdentity ();
|
||||||
|
|
||||||
gl->Enable (GL_TEXTURE_2D);
|
gl->ActiveTexture (GL_TEXTURE_2D);
|
||||||
gl->BindTexture (GL_TEXTURE_2D, tex_id);
|
gl->BindTexture (GL_TEXTURE_2D, tex_id);
|
||||||
|
|
||||||
gl->EnableClientState (GL_VERTEX_ARRAY);
|
gl->EnableClientState (GL_VERTEX_ARRAY);
|
||||||
gl->EnableClientState (GL_TEXTURE_COORD_ARRAY);
|
|
||||||
gl->VertexPointer (2, GL_FLOAT, 0, &verts);
|
gl->VertexPointer (2, GL_FLOAT, 0, &verts);
|
||||||
|
|
||||||
|
gl->ClientActiveTexture (GL_TEXTURE0);
|
||||||
|
gl->EnableClientState (GL_TEXTURE_COORD_ARRAY);
|
||||||
gl->TexCoordPointer (2, GL_FLOAT, 0, &texcoords);
|
gl->TexCoordPointer (2, GL_FLOAT, 0, &texcoords);
|
||||||
|
|
||||||
gl->DrawArrays (GL_TRIANGLE_FAN, 0, 4);
|
gl->DrawArrays (GL_TRIANGLE_FAN, 0, 4);
|
||||||
|
|
||||||
gl->DisableClientState (GL_VERTEX_ARRAY);
|
gl->DisableClientState (GL_VERTEX_ARRAY);
|
||||||
gl->DisableClientState (GL_TEXTURE_COORD_ARRAY);
|
gl->DisableClientState (GL_TEXTURE_COORD_ARRAY);
|
||||||
|
|
||||||
gl->Disable (GL_TEXTURE_2D);
|
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
#if GST_GL_HAVE_GLES2
|
#if GST_GL_HAVE_GLES2
|
||||||
|
|
Loading…
Reference in a new issue