diff options
author | Qt Continuous Integration System <qt-info@nokia.com> | 2010-03-12 05:33:43 (GMT) |
---|---|---|
committer | Qt Continuous Integration System <qt-info@nokia.com> | 2010-03-12 05:33:43 (GMT) |
commit | fc3ef51ef7344e189699e62ec54f3ce469c553f9 (patch) | |
tree | b1b689337c81edbf3a4f5abfe26004c55e1c9b42 /src/multimedia | |
parent | 2504c2d4b1a7ae952005f9736c7f0399b31b1864 (diff) | |
parent | a3e2e9efd4ed4baed3b5ca71cf518b3d3fda4716 (diff) | |
download | Qt-fc3ef51ef7344e189699e62ec54f3ce469c553f9.zip Qt-fc3ef51ef7344e189699e62ec54f3ce469c553f9.tar.gz Qt-fc3ef51ef7344e189699e62ec54f3ce469c553f9.tar.bz2 |
Merge branch '4.7' of scm.dev.nokia.troll.no:qt/qt-multimedia-staging into 4.7-integration
* '4.7' of scm.dev.nokia.troll.no:qt/qt-multimedia-staging:
QPainterVideoSurface: assume yuv 420p and YV12 lines are 4 byte aligned.
Delayed initialization of gstreamer video widget.
Diffstat (limited to 'src/multimedia')
-rw-r--r-- | src/multimedia/base/qpaintervideosurface.cpp | 14 |
1 files changed, 10 insertions, 4 deletions
diff --git a/src/multimedia/base/qpaintervideosurface.cpp b/src/multimedia/base/qpaintervideosurface.cpp index fc3d493..ed93fad 100644 --- a/src/multimedia/base/qpaintervideosurface.cpp +++ b/src/multimedia/base/qpaintervideosurface.cpp @@ -434,6 +434,9 @@ void QVideoSurfaceGLPainter::initRgbTextureInfo( void QVideoSurfaceGLPainter::initYuv420PTextureInfo(const QSize &size) { + int w = (size.width() + 3) & ~3; + int w2 = (size.width()/2 + 3) & ~3; + m_yuv = true; m_textureInternalFormat = GL_LUMINANCE; m_textureFormat = GL_LUMINANCE; @@ -444,14 +447,17 @@ void QVideoSurfaceGLPainter::initYuv420PTextureInfo(const QSize &size) m_textureOffsets[0] = 0; m_textureWidths[1] = size.width() / 2; m_textureHeights[1] = size.height() / 2; - m_textureOffsets[1] = size.width() * size.height(); + m_textureOffsets[1] = w * size.height(); m_textureWidths[2] = size.width() / 2; m_textureHeights[2] = size.height() / 2; - m_textureOffsets[2] = size.width() * size.height() * 5 / 4; + m_textureOffsets[2] = w * size.height() + w2 * (size.height() / 2); } void QVideoSurfaceGLPainter::initYv12TextureInfo(const QSize &size) { + int w = (size.width() + 3) & ~3; + int w2 = (size.width()/2 + 3) & ~3; + m_yuv = true; m_textureInternalFormat = GL_LUMINANCE; m_textureFormat = GL_LUMINANCE; @@ -462,10 +468,10 @@ void QVideoSurfaceGLPainter::initYv12TextureInfo(const QSize &size) m_textureOffsets[0] = 0; m_textureWidths[1] = size.width() / 2; m_textureHeights[1] = size.height() / 2; - m_textureOffsets[1] = size.width() * size.height() * 5 / 4; + m_textureOffsets[1] = w * size.height() + w2 * (size.height() / 2); m_textureWidths[2] = size.width() / 2; m_textureHeights[2] = size.height() / 2; - m_textureOffsets[2] = size.width() * size.height(); + m_textureOffsets[2] = w * size.height(); } #ifndef QT_OPENGL_ES |