diff options
author | Matthew Waters <matthew@centricular.com> | 2016-11-08 15:04:29 +1100 |
---|---|---|
committer | Matthew Waters <matthew@centricular.com> | 2016-11-08 15:14:27 +1100 |
commit | 5d22e0c8d093a3c2eca1d0da9c2d9890669a872b (patch) | |
tree | 13325a09553613d9fe0fbdad2a7eae14dc44324e /tests | |
parent | e811ed18bac7a2036cf3755300b48b7d89283e38 (diff) | |
download | gstreamer-plugins-bad-5d22e0c8d093a3c2eca1d0da9c2d9890669a872b.tar.gz |
examples/gl/qt: fix the examples for the use of newer API
gstgl doesn't undo/overwrite what GL state the examples are changing
anymore. As such, the examples need to reset the GL state themselves
to be able to play nice with libgstgl
Diffstat (limited to 'tests')
-rw-r--r-- | tests/examples/gl/qt/mousevideooverlay/pipeline.cpp | 6 | ||||
-rw-r--r-- | tests/examples/gl/qt/qglwidgetvideooverlay/pipeline.cpp | 4 | ||||
-rw-r--r-- | tests/examples/gl/qt/qglwtextureshare/qglrenderer.cpp | 4 |
3 files changed, 12 insertions, 2 deletions
diff --git a/tests/examples/gl/qt/mousevideooverlay/pipeline.cpp b/tests/examples/gl/qt/mousevideooverlay/pipeline.cpp index 51cc34567..28d8cf814 100644 --- a/tests/examples/gl/qt/mousevideooverlay/pipeline.cpp +++ b/tests/examples/gl/qt/mousevideooverlay/pipeline.cpp @@ -255,7 +255,11 @@ gboolean Pipeline::drawCallback (void * sink, void *context, GstSample * sample, glTexCoord2f(0.0f, 0.0f); glVertex3f(-1.0f, -1.0f, 1.0f); glTexCoord2f(0.0f, 1.0f); glVertex3f(-1.0f, 1.0f, 1.0f); glTexCoord2f(1.0f, 1.0f); glVertex3f(-1.0f, 1.0f, -1.0f); - glEnd(); + glEnd(); + + glLoadIdentity(); + glDisable(GL_DEPTH_TEST); + glBindTexture (GL_TEXTURE_2D, 0); gst_video_frame_unmap (&v_frame); diff --git a/tests/examples/gl/qt/qglwidgetvideooverlay/pipeline.cpp b/tests/examples/gl/qt/qglwidgetvideooverlay/pipeline.cpp index daf246a50..301d3b614 100644 --- a/tests/examples/gl/qt/qglwidgetvideooverlay/pipeline.cpp +++ b/tests/examples/gl/qt/qglwidgetvideooverlay/pipeline.cpp @@ -242,6 +242,10 @@ gboolean Pipeline::drawCallback (GstElement * gl_sink, void *context, GstSample glTexCoord2f(1.0, 1.0f); glVertex3f(-1.0f, 1.0f, -1.0f); glEnd(); + glLoadIdentity(); + glDisable(GL_DEPTH_TEST); + glBindTexture (GL_TEXTURE_2D, 0); + gst_video_frame_unmap (&v_frame); xrot+=0.03f; diff --git a/tests/examples/gl/qt/qglwtextureshare/qglrenderer.cpp b/tests/examples/gl/qt/qglwtextureshare/qglrenderer.cpp index ee9c61ea7..629cc895f 100644 --- a/tests/examples/gl/qt/qglwtextureshare/qglrenderer.cpp +++ b/tests/examples/gl/qt/qglwtextureshare/qglrenderer.cpp @@ -28,7 +28,7 @@ #include <GL/glx.h> #include <gst/video/video.h> -#include <gst/gl/gstglmemory.h> +#include <gst/gl/gl.h> #if GST_GL_HAVE_PLATFORM_GLX #include <QX11Info> @@ -266,6 +266,8 @@ QGLRenderer::paintGL () yrot += 0.2f; zrot += 0.4f; + glLoadIdentity(); + glDisable(GL_DEPTH_TEST); glBindTexture (GL_TEXTURE_2D, 0); gst_video_frame_unmap (&v_frame); |