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
This commit is contained in:
Matthew Waters 2016-11-08 15:04:29 +11:00 committed by Tim-Philipp Müller
parent 85feb6d6f2
commit 263255137e
3 changed files with 12 additions and 2 deletions

View file

@ -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, 0.0f); glVertex3f(-1.0f, -1.0f, 1.0f);
glTexCoord2f(0.0f, 1.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); 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); gst_video_frame_unmap (&v_frame);

View file

@ -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); glTexCoord2f(1.0, 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); gst_video_frame_unmap (&v_frame);
xrot+=0.03f; xrot+=0.03f;

View file

@ -28,7 +28,7 @@
#include <GL/glx.h> #include <GL/glx.h>
#include <gst/video/video.h> #include <gst/video/video.h>
#include <gst/gl/gstglmemory.h> #include <gst/gl/gl.h>
#if GST_GL_HAVE_PLATFORM_GLX #if GST_GL_HAVE_PLATFORM_GLX
#include <QX11Info> #include <QX11Info>
@ -266,6 +266,8 @@ QGLRenderer::paintGL ()
yrot += 0.2f; yrot += 0.2f;
zrot += 0.4f; zrot += 0.4f;
glLoadIdentity();
glDisable(GL_DEPTH_TEST);
glBindTexture (GL_TEXTURE_2D, 0); glBindTexture (GL_TEXTURE_2D, 0);
gst_video_frame_unmap (&v_frame); gst_video_frame_unmap (&v_frame);