summaryrefslogtreecommitdiffstats
path: root/src/plugins/videonode/imx6
diff options
context:
space:
mode:
Diffstat (limited to 'src/plugins/videonode/imx6')
-rw-r--r--src/plugins/videonode/imx6/qsgvivantevideomaterial.cpp15
-rw-r--r--src/plugins/videonode/imx6/qsgvivantevideomaterial.h4
2 files changed, 19 insertions, 0 deletions
diff --git a/src/plugins/videonode/imx6/qsgvivantevideomaterial.cpp b/src/plugins/videonode/imx6/qsgvivantevideomaterial.cpp
index 0ed4e1adc..44f9f4d12 100644
--- a/src/plugins/videonode/imx6/qsgvivantevideomaterial.cpp
+++ b/src/plugins/videonode/imx6/qsgvivantevideomaterial.cpp
@@ -56,6 +56,9 @@
QSGVivanteVideoMaterial::QSGVivanteVideoMaterial() :
mOpacity(1.0),
+ mWidth(0),
+ mHeight(0),
+ mFormat(QVideoFrame::Format_Invalid),
mCurrentTexture(0)
{
#ifdef QT_VIVANTE_VIDEO_DEBUG
@@ -147,6 +150,18 @@ GLuint QSGVivanteVideoMaterial::vivanteMapping(QVideoFrame vF)
return 0;
}
+ if (mWidth != vF.width() || mHeight != vF.height() || mFormat != vF.pixelFormat()) {
+ mWidth = vF.width();
+ mHeight = vF.height();
+ mFormat = vF.pixelFormat();
+ for (GLuint id : mBitsToTextureMap.values()) {
+#ifdef QT_VIVANTE_VIDEO_DEBUG
+ qDebug() << "delete texture: " << id;
+#endif
+ glDeleteTextures(1, &id);
+ }
+ mBitsToTextureMap.clear();
+ }
if (vF.map(QAbstractVideoBuffer::ReadOnly)) {
diff --git a/src/plugins/videonode/imx6/qsgvivantevideomaterial.h b/src/plugins/videonode/imx6/qsgvivantevideomaterial.h
index 9d792b788..0c1c4450e 100644
--- a/src/plugins/videonode/imx6/qsgvivantevideomaterial.h
+++ b/src/plugins/videonode/imx6/qsgvivantevideomaterial.h
@@ -70,6 +70,10 @@ public:
private:
qreal mOpacity;
+ int mWidth;
+ int mHeight;
+ QVideoFrame::PixelFormat mFormat;
+
QMap<const uchar*, GLuint> mBitsToTextureMap;
QVideoFrame mCurrentFrame, mNextFrame;
GLuint mCurrentTexture;