From 02fb5bea9bb0828a9f56989f6e48835eddd3310d Mon Sep 17 00:00:00 2001 From: Yoann Lopes Date: Wed, 16 Jan 2013 13:06:51 +0100 Subject: [PATCH] Make sure QVideoSurfaceGLPainter always uses a valid texture. QVideoSurfaceGLPainter should not assume that the GL texture provided by the QVideoFrame is fully initialized for drawing. Change-Id: I752ecf69a3cf1faf0a7cf8f84b372c3b347824be Reviewed-by: Gunnar Sletta --- src/multimediawidgets/qpaintervideosurface.cpp | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/multimediawidgets/qpaintervideosurface.cpp b/src/multimediawidgets/qpaintervideosurface.cpp index c678c23..e925f57 100644 --- a/src/multimediawidgets/qpaintervideosurface.cpp +++ b/src/multimediawidgets/qpaintervideosurface.cpp @@ -357,6 +357,11 @@ QAbstractVideoSurface::Error QVideoSurfaceGLPainter::setCurrentFrame(const QVide if (m_handleType == QAbstractVideoBuffer::GLTextureHandle) { m_textureIds[0] = frame.handle().toInt(); + glBindTexture(GL_TEXTURE_2D, m_textureIds[0]); + glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_LINEAR); + glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_LINEAR); + glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, GL_CLAMP_TO_EDGE); + glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, GL_CLAMP_TO_EDGE); } else if (m_frame.map(QAbstractVideoBuffer::ReadOnly)) { m_context->makeCurrent(); -- 2.7.4