From 42e032bdc11fbd6cc87e27df6e8359c5882bfe23 Mon Sep 17 00:00:00 2001 From: Wouter Huysentruit Date: Mon, 3 Mar 2014 20:21:26 +0100 Subject: Release videoframe on painter stop() QVideoSurfaceGLPainter/QVideoSurfaceGlslPainter needs to release the video frame on stop (just like QVideoSurfaceGenericPainter already does). Change-Id: Iaf3eb13eaf51fbc22fab6b1f80db8e8978ac328d Reviewed-by: Yoann Lopes --- src/multimediawidgets/qpaintervideosurface.cpp | 12 ++++++++++++ 1 file changed, 12 insertions(+) (limited to 'src/multimediawidgets') diff --git a/src/multimediawidgets/qpaintervideosurface.cpp b/src/multimediawidgets/qpaintervideosurface.cpp index 87757914f..e1dccb2bd 100644 --- a/src/multimediawidgets/qpaintervideosurface.cpp +++ b/src/multimediawidgets/qpaintervideosurface.cpp @@ -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( -- cgit v1.2.3