Release videoframe on painter stop()
authorWouter Huysentruit <wouter_huysentruit@hotmail.com>
Mon, 3 Mar 2014 19:21:26 +0000 (20:21 +0100)
committerThe Qt Project <gerrit-noreply@qt-project.org>
Thu, 6 Mar 2014 07:31:41 +0000 (08:31 +0100)
QVideoSurfaceGLPainter/QVideoSurfaceGlslPainter needs
to release the video frame on stop (just like
QVideoSurfaceGenericPainter already does).

Change-Id: Iaf3eb13eaf51fbc22fab6b1f80db8e8978ac328d
Reviewed-by: Yoann Lopes <yoann.lopes@digia.com>
src/multimediawidgets/qpaintervideosurface.cpp

index 8775791..e1dccb2 100644 (file)
@@ -247,6 +247,8 @@ public:
 
     bool isFormatSupported(const QVideoSurfaceFormat &format) const;
 
+    void stop();
+
     QAbstractVideoSurface::Error setCurrentFrame(const QVideoFrame &frame);
 
     QAbstractVideoSurface::Error paint(
@@ -351,6 +353,12 @@ bool QVideoSurfaceGLPainter::isFormatSupported(const QVideoSurfaceFormat &format
     return false;
 }
 
+
+void QVideoSurfaceGLPainter::stop()
+{
+    m_frame = QVideoFrame();
+}
+
 QAbstractVideoSurface::Error QVideoSurfaceGLPainter::setCurrentFrame(const QVideoFrame &frame)
 {
     m_frame = frame;
@@ -832,6 +840,8 @@ void QVideoSurfaceArbFpPainter::stop()
     m_textureCount = 0;
     m_programId = 0;
     m_handleType = QAbstractVideoBuffer::NoHandle;
+
+    QVideoSurfaceGLPainter::stop();
 }
 
 QAbstractVideoSurface::Error QVideoSurfaceArbFpPainter::paint(
@@ -1176,6 +1186,8 @@ void QVideoSurfaceGlslPainter::stop()
 
     m_textureCount = 0;
     m_handleType = QAbstractVideoBuffer::NoHandle;
+
+    QVideoSurfaceGLPainter::stop();
 }
 
 QAbstractVideoSurface::Error QVideoSurfaceGlslPainter::paint(