summaryrefslogtreecommitdiffstats
path: root/src/imports/multimedia/qsgvideonode_i420.cpp
diff options
context:
space:
mode:
authorMithra Pattison <mithra.pattison@nokia.com>2012-05-30 15:31:39 +1000
committerQt by Nokia <qt-info@nokia.com>2012-06-25 06:39:11 +0200
commit5705f70da1e0a4a8838f9c4dfda1e847807d0ebe (patch)
treeca294fdbc593c69ccbb1f90a5182a74bf1674cf7 /src/imports/multimedia/qsgvideonode_i420.cpp
parent1b7da9e0adf8a2638061d75e2697177be20ddc72 (diff)
Add default initialisation to various multimedia classes
Change-Id: I902de05984fdae152e2678e4cf2d401a0b670703 Reviewed-by: Jonas Rabbe <jonas.rabbe@gmail.com>
Diffstat (limited to 'src/imports/multimedia/qsgvideonode_i420.cpp')
-rw-r--r--src/imports/multimedia/qsgvideonode_i420.cpp12
1 files changed, 8 insertions, 4 deletions
diff --git a/src/imports/multimedia/qsgvideonode_i420.cpp b/src/imports/multimedia/qsgvideonode_i420.cpp
index ef075eb95..2cd040695 100644
--- a/src/imports/multimedia/qsgvideonode_i420.cpp
+++ b/src/imports/multimedia/qsgvideonode_i420.cpp
@@ -174,7 +174,9 @@ public:
QVideoSurfaceFormat m_format;
QSize m_textureSize;
- GLuint m_textureIds[3];
+
+ static const uint Num_Texture_IDs = 3;
+ GLuint m_textureIds[Num_Texture_IDs];
qreal m_opacity;
QMatrix4x4 m_colorMatrix;
@@ -187,6 +189,8 @@ QSGVideoMaterial_YUV420::QSGVideoMaterial_YUV420(const QVideoSurfaceFormat &form
m_format(format),
m_opacity(1.0)
{
+ memset(m_textureIds, 0, sizeof(m_textureIds));
+
switch (format.yCbCrColorSpace()) {
case QVideoSurfaceFormat::YCbCr_JPEG:
m_colorMatrix = QMatrix4x4(
@@ -217,7 +221,7 @@ QSGVideoMaterial_YUV420::QSGVideoMaterial_YUV420(const QVideoSurfaceFormat &form
QSGVideoMaterial_YUV420::~QSGVideoMaterial_YUV420()
{
if (!m_textureSize.isEmpty())
- glDeleteTextures(3, m_textureIds);
+ glDeleteTextures(Num_Texture_IDs, m_textureIds);
}
void QSGVideoMaterial_YUV420::bind()
@@ -233,8 +237,8 @@ void QSGVideoMaterial_YUV420::bind()
// Frame has changed size, recreate textures...
if (m_textureSize != m_frame.size()) {
if (!m_textureSize.isEmpty())
- glDeleteTextures(3, m_textureIds);
- glGenTextures(3, m_textureIds);
+ glDeleteTextures(Num_Texture_IDs, m_textureIds);
+ glGenTextures(Num_Texture_IDs, m_textureIds);
m_textureSize = m_frame.size();
}