summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorYoann Lopes <yoann.lopes@digia.com>2013-01-16 13:06:51 +0100
committerThe Qt Project <gerrit-noreply@qt-project.org>2013-01-16 18:02:27 +0100
commit02fb5bea9bb0828a9f56989f6e48835eddd3310d (patch)
treea0464a7595d0345f6ec82b8dcf0beea2ba0cc25b /src
parentae64113c2fd8150748feedda9b49d84c54d85814 (diff)
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 <gunnar.sletta@digia.com>
Diffstat (limited to 'src')
-rw-r--r--src/multimediawidgets/qpaintervideosurface.cpp5
1 files changed, 5 insertions, 0 deletions
diff --git a/src/multimediawidgets/qpaintervideosurface.cpp b/src/multimediawidgets/qpaintervideosurface.cpp
index c678c230f..e925f577f 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();