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>
This commit is contained in:
Yoann Lopes
2013-01-16 13:06:51 +01:00
committed by The Qt Project
parent ae64113c2f
commit 02fb5bea9b

View File

@@ -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();