summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--ext/gl/effects/gstgleffectblur.c4
-rw-r--r--ext/gl/effects/gstgleffectbulge.c1
-rw-r--r--ext/gl/effects/gstgleffectfisheye.c1
-rw-r--r--ext/gl/effects/gstgleffectglow.c9
-rw-r--r--ext/gl/effects/gstgleffectlaplacian.c2
-rw-r--r--ext/gl/effects/gstgleffectlumatocurve.c14
-rw-r--r--ext/gl/effects/gstgleffectmirror.c2
-rw-r--r--ext/gl/effects/gstgleffectrgbtocurve.c14
-rw-r--r--ext/gl/effects/gstgleffectsin.c1
-rw-r--r--ext/gl/effects/gstgleffectsobel.c8
-rw-r--r--ext/gl/effects/gstgleffectsquare.c1
-rw-r--r--ext/gl/effects/gstgleffectsqueeze.c1
-rw-r--r--ext/gl/effects/gstgleffectstretch.c1
-rw-r--r--ext/gl/effects/gstgleffecttunnel.c1
-rw-r--r--ext/gl/effects/gstgleffecttwirl.c1
-rw-r--r--ext/gl/effects/gstgleffectxray.c16
-rw-r--r--ext/gl/gltestsrc.c3
-rw-r--r--ext/gl/gstgldeinterlace.c5
-rw-r--r--ext/gl/gstgldifferencematte.c14
-rw-r--r--ext/gl/gstglfilterglass.c3
-rw-r--r--ext/gl/gstglimagesink.c4
-rw-r--r--ext/gl/gstglmosaic.c1
-rw-r--r--ext/gl/gstgloverlay.c4
-rw-r--r--ext/gl/gstglvideomixer.c3
-rw-r--r--gst-libs/gst/gl/gstglfilter.c9
-rw-r--r--tests/check/libs/gstglcontext.c10
-rw-r--r--tests/check/libs/gstglupload.c8
27 files changed, 13 insertions, 128 deletions
diff --git a/ext/gl/effects/gstgleffectblur.c b/ext/gl/effects/gstgleffectblur.c
index 07eb38dc1..8042b279c 100644
--- a/ext/gl/effects/gstgleffectblur.c
+++ b/ext/gl/effects/gstgleffectblur.c
@@ -62,9 +62,7 @@ gst_gl_effects_blur_callback_hconv (gint width, gint height, guint texture,
gst_gl_shader_use (shader);
gl->ActiveTexture (GL_TEXTURE0);
- gl->Enable (GL_TEXTURE_2D);
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_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);
gl->ActiveTexture (GL_TEXTURE0);
- gl->Enable (GL_TEXTURE_2D);
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_1f (shader, "gauss_height", height);
diff --git a/ext/gl/effects/gstgleffectbulge.c b/ext/gl/effects/gstgleffectbulge.c
index 2e210251e..f228867fa 100644
--- a/ext/gl/effects/gstgleffectbulge.c
+++ b/ext/gl/effects/gstgleffectbulge.c
@@ -49,7 +49,6 @@ gst_gl_effects_bulge_callback (gint width, gint height, guint texture,
gst_gl_shader_use (shader);
gl->ActiveTexture (GL_TEXTURE0);
- gl->Enable (GL_TEXTURE_2D);
gl->BindTexture (GL_TEXTURE_2D, texture);
gst_gl_shader_set_uniform_1i (shader, "tex", 0);
diff --git a/ext/gl/effects/gstgleffectfisheye.c b/ext/gl/effects/gstgleffectfisheye.c
index c94cd42c0..2be8609c0 100644
--- a/ext/gl/effects/gstgleffectfisheye.c
+++ b/ext/gl/effects/gstgleffectfisheye.c
@@ -49,7 +49,6 @@ gst_gl_effects_fisheye_callback (gint width, gint height, guint texture,
gst_gl_shader_use (shader);
gl->ActiveTexture (GL_TEXTURE0);
- gl->Enable (GL_TEXTURE_2D);
gl->BindTexture (GL_TEXTURE_2D, texture);
gst_gl_shader_set_uniform_1i (shader, "tex", 0);
diff --git a/ext/gl/effects/gstgleffectglow.c b/ext/gl/effects/gstgleffectglow.c
index b3877150a..97277b8cc 100644
--- a/ext/gl/effects/gstgleffectglow.c
+++ b/ext/gl/effects/gstgleffectglow.c
@@ -53,7 +53,6 @@ gst_gl_effects_glow_step_one (gint width, gint height, guint texture,
gst_gl_shader_use (shader);
gl->ActiveTexture (GL_TEXTURE0);
- gl->Enable (GL_TEXTURE_2D);
gl->BindTexture (GL_TEXTURE_2D, texture);
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);
gl->ActiveTexture (GL_TEXTURE1);
- gl->Enable (GL_TEXTURE_2D);
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_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);
gl->ActiveTexture (GL_TEXTURE1);
- gl->Enable (GL_TEXTURE_2D);
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_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);
gl->ActiveTexture (GL_TEXTURE2);
- gl->Enable (GL_TEXTURE_2D);
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_1i (shader, "base", 2);
gl->ActiveTexture (GL_TEXTURE1);
- gl->Enable (GL_TEXTURE_2D);
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_1i (shader, "blend", 1);
diff --git a/ext/gl/effects/gstgleffectlaplacian.c b/ext/gl/effects/gstgleffectlaplacian.c
index b9dabcb14..a6eadccf6 100644
--- a/ext/gl/effects/gstgleffectlaplacian.c
+++ b/ext/gl/effects/gstgleffectlaplacian.c
@@ -51,9 +51,7 @@ gst_gl_effects_laplacian_callback (gint width, gint height, guint texture,
gst_gl_shader_use (shader);
gl->ActiveTexture (GL_TEXTURE0);
- gl->Enable (GL_TEXTURE_2D);
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_1f (shader, "height", height);
diff --git a/ext/gl/effects/gstgleffectlumatocurve.c b/ext/gl/effects/gstgleffectlumatocurve.c
index 0a925fe3c..f4e303c7f 100644
--- a/ext/gl/effects/gstgleffectlumatocurve.c
+++ b/ext/gl/effects/gstgleffectlumatocurve.c
@@ -56,7 +56,6 @@ gst_gl_effects_luma_to_curve (GstGLEffects * effects,
#if GST_GL_HAVE_OPENGL
if (USING_OPENGL (context)) {
- gl->Enable (GL_TEXTURE_1D);
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_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,
curve->width, 0, GL_RGB, GL_UNSIGNED_BYTE, curve->pixel_data);
-
- gl->Disable (GL_TEXTURE_1D);
}
#endif
if (USING_GLES2 (context) || USING_OPENGL3 (context)) {
- gl->Enable (GL_TEXTURE_2D);
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_MAG_FILTER, GL_NEAREST);
@@ -79,37 +75,27 @@ gst_gl_effects_luma_to_curve (GstGLEffects * effects,
gl->TexImage2D (GL_TEXTURE_2D, 0, GL_RGB,
curve->width, 1, 0, GL_RGB, GL_UNSIGNED_BYTE, curve->pixel_data);
- gl->Disable (GL_TEXTURE_2D);
}
}
gl->ActiveTexture (GL_TEXTURE2);
- gl->Enable (GL_TEXTURE_2D);
gl->BindTexture (GL_TEXTURE_2D, texture);
gst_gl_shader_set_uniform_1i (shader, "tex", 2);
- gl->Disable (GL_TEXTURE_2D);
-
#if GST_GL_HAVE_OPENGL
if (USING_OPENGL (context)) {
gl->ActiveTexture (GL_TEXTURE1);
- gl->Enable (GL_TEXTURE_1D);
gl->BindTexture (GL_TEXTURE_1D, effects->curve[curve_index]);
gst_gl_shader_set_uniform_1i (shader, "curve", 1);
-
- gl->Disable (GL_TEXTURE_1D);
}
#endif
if (USING_GLES2 (context) || USING_OPENGL3 (context)) {
gl->ActiveTexture (GL_TEXTURE1);
- gl->Enable (GL_TEXTURE_2D);
gl->BindTexture (GL_TEXTURE_2D, effects->curve[curve_index]);
gst_gl_shader_set_uniform_1i (shader, "curve", 1);
-
- gl->Disable (GL_TEXTURE_2D);
}
gst_gl_filter_draw_texture (filter, texture, width, height);
diff --git a/ext/gl/effects/gstgleffectmirror.c b/ext/gl/effects/gstgleffectmirror.c
index 7a88f07ab..4f5d473ec 100644
--- a/ext/gl/effects/gstgleffectmirror.c
+++ b/ext/gl/effects/gstgleffectmirror.c
@@ -49,8 +49,6 @@ gst_gl_effects_mirror_callback (gint width, gint height, guint texture,
gst_gl_shader_use (shader);
gl->ActiveTexture (GL_TEXTURE0);
- if (USING_OPENGL (context))
- gl->Enable (GL_TEXTURE_2D);
gl->BindTexture (GL_TEXTURE_2D, texture);
gst_gl_shader_set_uniform_1i (shader, "tex", 0);
diff --git a/ext/gl/effects/gstgleffectrgbtocurve.c b/ext/gl/effects/gstgleffectrgbtocurve.c
index b34a3f31b..b2d84e12e 100644
--- a/ext/gl/effects/gstgleffectrgbtocurve.c
+++ b/ext/gl/effects/gstgleffectrgbtocurve.c
@@ -54,7 +54,6 @@ gst_gl_effects_rgb_to_curve (GstGLEffects * effects,
gl->GenTextures (1, &effects->curve[curve_index]);
#if GST_GL_HAVE_OPENGL
if (USING_OPENGL (context)) {
- gl->Enable (GL_TEXTURE_1D);
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_MAG_FILTER, GL_NEAREST);
@@ -63,12 +62,9 @@ gst_gl_effects_rgb_to_curve (GstGLEffects * effects,
gl->TexImage1D (GL_TEXTURE_1D, 0, GL_RGB,
curve->width, 0, GL_RGB, GL_UNSIGNED_BYTE, curve->pixel_data);
-
- gl->Disable (GL_TEXTURE_1D);
}
#endif
if (USING_GLES2 (context) || USING_OPENGL3 (context)) {
- gl->Enable (GL_TEXTURE_2D);
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_MAG_FILTER, GL_NEAREST);
@@ -77,37 +73,27 @@ gst_gl_effects_rgb_to_curve (GstGLEffects * effects,
gl->TexImage2D (GL_TEXTURE_2D, 0, GL_RGB,
curve->width, 1, 0, GL_RGB, GL_UNSIGNED_BYTE, curve->pixel_data);
- gl->Disable (GL_TEXTURE_2D);
}
}
gl->ActiveTexture (GL_TEXTURE0);
- gl->Enable (GL_TEXTURE_2D);
gl->BindTexture (GL_TEXTURE_2D, texture);
gst_gl_shader_set_uniform_1i (shader, "tex", 0);
- gl->Disable (GL_TEXTURE_2D);
-
#if GST_GL_HAVE_OPENGL
if (USING_OPENGL (context)) {
gl->ActiveTexture (GL_TEXTURE1);
- gl->Enable (GL_TEXTURE_1D);
gl->BindTexture (GL_TEXTURE_1D, effects->curve[curve_index]);
gst_gl_shader_set_uniform_1i (shader, "curve", 1);
-
- gl->Disable (GL_TEXTURE_1D);
}
#endif
if (USING_GLES2 (context) || USING_OPENGL3 (context)) {
gl->ActiveTexture (GL_TEXTURE1);
- gl->Enable (GL_TEXTURE_2D);
gl->BindTexture (GL_TEXTURE_2D, effects->curve[curve_index]);
gst_gl_shader_set_uniform_1i (shader, "curve", 1);
-
- gl->Disable (GL_TEXTURE_2D);
}
gst_gl_filter_draw_texture (filter, texture, width, height);
diff --git a/ext/gl/effects/gstgleffectsin.c b/ext/gl/effects/gstgleffectsin.c
index a28414d9f..302b2bbc9 100644
--- a/ext/gl/effects/gstgleffectsin.c
+++ b/ext/gl/effects/gstgleffectsin.c
@@ -49,7 +49,6 @@ gst_gl_effects_sin_callback (gint width, gint height, guint texture,
gst_gl_shader_use (shader);
gl->ActiveTexture (GL_TEXTURE0);
- gl->Enable (GL_TEXTURE_2D);
gl->BindTexture (GL_TEXTURE_2D, texture);
gst_gl_shader_set_uniform_1i (shader, "tex", 0);
diff --git a/ext/gl/effects/gstgleffectsobel.c b/ext/gl/effects/gstgleffectsobel.c
index fcb784770..a18dbd32c 100644
--- a/ext/gl/effects/gstgleffectsobel.c
+++ b/ext/gl/effects/gstgleffectsobel.c
@@ -48,9 +48,7 @@ gst_gl_effects_sobel_callback_desaturate (gint width, gint height,
gst_gl_shader_use (shader);
gl->ActiveTexture (GL_TEXTURE0);
- gl->Enable (GL_TEXTURE_2D);
gl->BindTexture (GL_TEXTURE_2D, texture);
- gl->Disable (GL_TEXTURE_2D);
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);
gl->ActiveTexture (GL_TEXTURE0);
- gl->Enable (GL_TEXTURE_2D);
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_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);
gl->ActiveTexture (GL_TEXTURE0);
- gl->Enable (GL_TEXTURE_2D);
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_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);
gl->ActiveTexture (GL_TEXTURE0);
- gl->Enable (GL_TEXTURE_2D);
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, "invert", effects->invert);
diff --git a/ext/gl/effects/gstgleffectsquare.c b/ext/gl/effects/gstgleffectsquare.c
index 40dd31369..1dc09a2cf 100644
--- a/ext/gl/effects/gstgleffectsquare.c
+++ b/ext/gl/effects/gstgleffectsquare.c
@@ -49,7 +49,6 @@ gst_gl_effects_square_callback (gint width, gint height, guint texture,
gst_gl_shader_use (shader);
gl->ActiveTexture (GL_TEXTURE0);
- gl->Enable (GL_TEXTURE_2D);
gl->BindTexture (GL_TEXTURE_2D, texture);
gst_gl_shader_set_uniform_1i (shader, "tex", 0);
diff --git a/ext/gl/effects/gstgleffectsqueeze.c b/ext/gl/effects/gstgleffectsqueeze.c
index 7ba5e52b0..249deff2e 100644
--- a/ext/gl/effects/gstgleffectsqueeze.c
+++ b/ext/gl/effects/gstgleffectsqueeze.c
@@ -49,7 +49,6 @@ gst_gl_effects_squeeze_callback (gint width, gint height, guint texture,
gst_gl_shader_use (shader);
gl->ActiveTexture (GL_TEXTURE0);
- gl->Enable (GL_TEXTURE_2D);
gl->BindTexture (GL_TEXTURE_2D, texture);
gst_gl_shader_set_uniform_1i (shader, "tex", 0);
diff --git a/ext/gl/effects/gstgleffectstretch.c b/ext/gl/effects/gstgleffectstretch.c
index 0c645f98f..8c3963610 100644
--- a/ext/gl/effects/gstgleffectstretch.c
+++ b/ext/gl/effects/gstgleffectstretch.c
@@ -48,7 +48,6 @@ gst_gl_effects_stretch_callback (gint width, gint height, guint texture,
gst_gl_shader_use (shader);
gl->ActiveTexture (GL_TEXTURE0);
- gl->Enable (GL_TEXTURE_2D);
gl->BindTexture (GL_TEXTURE_2D, texture);
gst_gl_shader_set_uniform_1i (shader, "tex", 0);
diff --git a/ext/gl/effects/gstgleffecttunnel.c b/ext/gl/effects/gstgleffecttunnel.c
index 3bacdae22..e4c879ff3 100644
--- a/ext/gl/effects/gstgleffecttunnel.c
+++ b/ext/gl/effects/gstgleffecttunnel.c
@@ -49,7 +49,6 @@ gst_gl_effects_tunnel_callback (gint width, gint height, guint texture,
gst_gl_shader_use (shader);
gl->ActiveTexture (GL_TEXTURE0);
- gl->Enable (GL_TEXTURE_2D);
gl->BindTexture (GL_TEXTURE_2D, texture);
gst_gl_shader_set_uniform_1i (shader, "tex", 0);
diff --git a/ext/gl/effects/gstgleffecttwirl.c b/ext/gl/effects/gstgleffecttwirl.c
index 2061c87cf..96dceea38 100644
--- a/ext/gl/effects/gstgleffecttwirl.c
+++ b/ext/gl/effects/gstgleffecttwirl.c
@@ -49,7 +49,6 @@ gst_gl_effects_twirl_callback (gint width, gint height, guint texture,
gst_gl_shader_use (shader);
gl->ActiveTexture (GL_TEXTURE0);
- gl->Enable (GL_TEXTURE_2D);
gl->BindTexture (GL_TEXTURE_2D, texture);
gst_gl_shader_set_uniform_1i (shader, "tex", 0);
diff --git a/ext/gl/effects/gstgleffectxray.c b/ext/gl/effects/gstgleffectxray.c
index 5f104df00..b25ecc16d 100644
--- a/ext/gl/effects/gstgleffectxray.c
+++ b/ext/gl/effects/gstgleffectxray.c
@@ -68,9 +68,7 @@ gst_gl_effects_xray_step_two (gint width, gint height, guint texture,
gst_gl_shader_use (shader);
gl->ActiveTexture (GL_TEXTURE1);
- gl->Enable (GL_TEXTURE_2D);
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_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);
gl->ActiveTexture (GL_TEXTURE1);
- gl->Enable (GL_TEXTURE_2D);
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_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);
gl->ActiveTexture (GL_TEXTURE1);
- gl->Enable (GL_TEXTURE_2D);
gl->BindTexture (GL_TEXTURE_2D, texture);
- gl->Disable (GL_TEXTURE_2D);
gst_gl_shader_set_uniform_1i (shader, "tex", 1);
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);
gl->ActiveTexture (GL_TEXTURE1);
- gl->Enable (GL_TEXTURE_2D);
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_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);
gl->ActiveTexture (GL_TEXTURE1);
- gl->Enable (GL_TEXTURE_2D);
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_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);
gl->ActiveTexture (GL_TEXTURE1);
- gl->Enable (GL_TEXTURE_2D);
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, "invert", TRUE);
@@ -289,16 +277,12 @@ gst_gl_effects_xray_step_five (gint width, gint height, guint texture,
gst_gl_shader_use (shader);
gl->ActiveTexture (GL_TEXTURE2);
- gl->Enable (GL_TEXTURE_2D);
gl->BindTexture (GL_TEXTURE_2D, effects->midtexture[2]);
- gl->Disable (GL_TEXTURE_2D);
gst_gl_shader_set_uniform_1i (shader, "base", 2);
gl->ActiveTexture (GL_TEXTURE1);
- gl->Enable (GL_TEXTURE_2D);
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_1i (shader, "blend", 1);
diff --git a/ext/gl/gltestsrc.c b/ext/gl/gltestsrc.c
index d5e75aa1e..c4a276536 100644
--- a/ext/gl/gltestsrc.c
+++ b/ext/gl/gltestsrc.c
@@ -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);
glDisable (GL_CULL_FACE);
- glDisable (GL_TEXTURE_2D);
glMatrixMode (GL_PROJECTION);
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);
gl->BindTexture (GL_TEXTURE_2D, 0);
- gl->Disable (GL_TEXTURE_2D);
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);
gl->BindTexture (GL_TEXTURE_2D, 0);
- gl->Disable (GL_TEXTURE_2D);
gst_gl_shader_use (v->shader);
diff --git a/ext/gl/gstgldeinterlace.c b/ext/gl/gstgldeinterlace.c
index ce66666fe..2d48749c5 100644
--- a/ext/gl/gstgldeinterlace.c
+++ b/ext/gl/gstgldeinterlace.c
@@ -290,8 +290,6 @@ gst_gl_deinterlace_callback (gint width, gint height, guint texture,
gst_gl_shader_use (deinterlace_filter->shader);
- gl->Enable (GL_TEXTURE_2D);
-
if (G_UNLIKELY (deinterlace_filter->prev_tex == 0)) {
gst_gl_context_gen_texture (GST_GL_BASE_FILTER (filter)->context,
&deinterlace_filter->prev_tex,
@@ -306,7 +304,6 @@ gst_gl_deinterlace_callback (gint width, gint height, guint texture,
gl->ActiveTexture (GL_TEXTURE0);
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",
5.0f / 255.0f);
@@ -340,8 +337,6 @@ gst_gl_deinterlace_callback (gint width, gint height, guint texture,
gl->ClientActiveTexture (GL_TEXTURE0);
gl->DisableClientState (GL_TEXTURE_COORD_ARRAY);
- gl->Disable (GL_TEXTURE_2D);
-
if (texture == filter->in_tex_id) {
temp = filter->in_tex_id;
filter->in_tex_id = deinterlace_filter->prev_tex;
diff --git a/ext/gl/gstgldifferencematte.c b/ext/gl/gstgldifferencematte.c
index 4f0a8f6be..fe9e24659 100644
--- a/ext/gl/gstgldifferencematte.c
+++ b/ext/gl/gstgldifferencematte.c
@@ -303,16 +303,12 @@ gst_gl_differencematte_diff (gint width, gint height, guint texture,
gst_gl_shader_use (differencematte->shader[0]);
gl->ActiveTexture (GL_TEXTURE0);
- gl->Enable (GL_TEXTURE_2D);
gl->BindTexture (GL_TEXTURE_2D, texture);
- gl->Disable (GL_TEXTURE_2D);
gst_gl_shader_set_uniform_1i (differencematte->shader[0], "current", 0);
gl->ActiveTexture (GL_TEXTURE1);
- gl->Enable (GL_TEXTURE_2D);
gl->BindTexture (GL_TEXTURE_2D, differencematte->savedbgtexture);
- gl->Disable (GL_TEXTURE_2D);
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]);
gl->ActiveTexture (GL_TEXTURE0);
- gl->Enable (GL_TEXTURE_2D);
gl->BindTexture (GL_TEXTURE_2D, texture);
- gl->Disable (GL_TEXTURE_2D);
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]);
gl->ActiveTexture (GL_TEXTURE0);
- gl->Enable (GL_TEXTURE_2D);
gl->BindTexture (GL_TEXTURE_2D, texture);
- gl->Disable (GL_TEXTURE_2D);
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]);
gl->ActiveTexture (GL_TEXTURE0);
- gl->Enable (GL_TEXTURE_2D);
gl->BindTexture (GL_TEXTURE_2D, texture);
- gl->Disable (GL_TEXTURE_2D);
gst_gl_shader_set_uniform_1i (differencematte->shader[3], "blend", 0);
gl->ActiveTexture (GL_TEXTURE1);
- gl->Enable (GL_TEXTURE_2D);
gl->BindTexture (GL_TEXTURE_2D, differencematte->newbgtexture);
- gl->Disable (GL_TEXTURE_2D);
gst_gl_shader_set_uniform_1i (differencematte->shader[3], "base", 1);
gl->ActiveTexture (GL_TEXTURE2);
- gl->Enable (GL_TEXTURE_2D);
gl->BindTexture (GL_TEXTURE_2D, differencematte->midtexture[2]);
- gl->Disable (GL_TEXTURE_2D);
gst_gl_shader_set_uniform_1i (differencematte->shader[3], "alpha", 2);
diff --git a/ext/gl/gstglfilterglass.c b/ext/gl/gstglfilterglass.c
index 0709954c9..863793c1f 100644
--- a/ext/gl/gstglfilterglass.c
+++ b/ext/gl/gstglfilterglass.c
@@ -329,9 +329,7 @@ gst_gl_filter_glass_draw_video_plane (GstGLFilter * filter,
};
gl->ActiveTexture (GL_TEXTURE0);
- gl->Enable (GL_TEXTURE_2D);
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_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);
- gl->Disable (GL_TEXTURE_2D);
gl->Disable (GL_BLEND);
}
diff --git a/ext/gl/gstglimagesink.c b/ext/gl/gstglimagesink.c
index f051176e3..4c2230346 100644
--- a/ext/gl/gstglimagesink.c
+++ b/ext/gl/gstglimagesink.c
@@ -1523,14 +1523,12 @@ gst_glimage_sink_on_draw (GstGLImageSink * gl_sink)
/* make sure that the environnement is clean */
gst_gl_context_clear_shader (gl_sink->context);
-
+ gl->BindTexture (GL_TEXTURE_2D, 0);
#if GST_GL_HAVE_OPENGL
if (USING_OPENGL (gl_sink->context))
gl->Disable (GL_TEXTURE_2D);
#endif
- gl->BindTexture (GL_TEXTURE_2D, 0);
-
sample = gst_sample_new (gl_sink->stored_buffer,
gl_sink->caps, &GST_BASE_SINK (gl_sink)->segment, NULL);
diff --git a/ext/gl/gstglmosaic.c b/ext/gl/gstglmosaic.c
index 726674b4d..0a9834138 100644
--- a/ext/gl/gstglmosaic.c
+++ b/ext/gl/gstglmosaic.c
@@ -242,7 +242,6 @@ gst_gl_mosaic_callback (gpointer stuff)
gst_gl_context_clear_shader (GST_GL_BASE_MIXER (mixer)->context);
gl->BindTexture (GL_TEXTURE_2D, 0);
- gl->Disable (GL_TEXTURE_2D);
gl->Enable (GL_DEPTH_TEST);
diff --git a/ext/gl/gstgloverlay.c b/ext/gl/gstgloverlay.c
index 8c8638d4b..720962165 100644
--- a/ext/gl/gstgloverlay.c
+++ b/ext/gl/gstgloverlay.c
@@ -429,10 +429,6 @@ gst_gl_overlay_callback (gint width, gint height, guint texture, gpointer stuff)
}
#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->BindTexture (GL_TEXTURE_2D, texture);
diff --git a/ext/gl/gstglvideomixer.c b/ext/gl/gstglvideomixer.c
index f39313772..d27396f4c 100644
--- a/ext/gl/gstglvideomixer.c
+++ b/ext/gl/gstglvideomixer.c
@@ -911,9 +911,6 @@ gst_gl_video_mixer_callback (gpointer stuff)
gst_gl_context_clear_shader (GST_GL_BASE_MIXER (mixer)->context);
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_CULL_FACE);
diff --git a/gst-libs/gst/gl/gstglfilter.c b/gst-libs/gst/gl/gstglfilter.c
index 5dced6dab..11fad7ca8 100644
--- a/gst-libs/gst/gl/gstglfilter.c
+++ b/gst-libs/gst/gl/gstglfilter.c
@@ -1134,16 +1134,13 @@ gst_gl_filter_draw_texture (GstGLFilter * filter, GLuint texture,
};
gl->ActiveTexture (GL_TEXTURE0);
-
- gl->Enable (GL_TEXTURE_2D);
gl->BindTexture (GL_TEXTURE_2D, texture);
- gl->ClientActiveTexture (GL_TEXTURE0);
-
gl->EnableClientState (GL_VERTEX_ARRAY);
- gl->EnableClientState (GL_TEXTURE_COORD_ARRAY);
-
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->DrawArrays (GL_TRIANGLE_FAN, 0, 4);
diff --git a/tests/check/libs/gstglcontext.c b/tests/check/libs/gstglcontext.c
index 901db504e..94a5f95f3 100644
--- a/tests/check/libs/gstglcontext.c
+++ b/tests/check/libs/gstglcontext.c
@@ -173,20 +173,20 @@ draw_render (gpointer data)
gl->MatrixMode (GL_PROJECTION);
gl->LoadIdentity ();
- gl->Enable (GL_TEXTURE_2D);
- gl->BindTexture (GL_TEXTURE_2D, tex);
+ gl->ActiveTexture (GL_TEXTURE_2D);
+ gl->BindTexture (GL_TEXTURE_2D, tex_id);
gl->EnableClientState (GL_VERTEX_ARRAY);
- gl->EnableClientState (GL_TEXTURE_COORD_ARRAY);
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->DrawArrays (GL_TRIANGLE_FAN, 0, 4);
gl->DisableClientState (GL_VERTEX_ARRAY);
gl->DisableClientState (GL_TEXTURE_COORD_ARRAY);
-
- gl->Disable (GL_TEXTURE_2D);
}
#endif
#if GST_GL_HAVE_GLES2
diff --git a/tests/check/libs/gstglupload.c b/tests/check/libs/gstglupload.c
index 214d36a1f..11e2fe0de 100644
--- a/tests/check/libs/gstglupload.c
+++ b/tests/check/libs/gstglupload.c
@@ -168,20 +168,20 @@ draw_render (gpointer data)
gl->MatrixMode (GL_PROJECTION);
gl->LoadIdentity ();
- gl->Enable (GL_TEXTURE_2D);
+ gl->ActiveTexture (GL_TEXTURE_2D);
gl->BindTexture (GL_TEXTURE_2D, tex_id);
gl->EnableClientState (GL_VERTEX_ARRAY);
- gl->EnableClientState (GL_TEXTURE_COORD_ARRAY);
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->DrawArrays (GL_TRIANGLE_FAN, 0, 4);
gl->DisableClientState (GL_VERTEX_ARRAY);
gl->DisableClientState (GL_TEXTURE_COORD_ARRAY);
-
- gl->Disable (GL_TEXTURE_2D);
}
#endif
#if GST_GL_HAVE_GLES2