Android: fix calling start() and stop() on the video surface.
authorYoann Lopes <yoann.lopes@digia.com>
Mon, 19 May 2014 10:48:59 +0000 (12:48 +0200)
committerThe Qt Project <gerrit-noreply@qt-project.org>
Fri, 30 May 2014 12:46:13 +0000 (14:46 +0200)
We restart the surface when the frame size changes, though we were
not using the correct function to get the surface's current frame size.
This was causing start() and stop() to be called for every frame.

Change-Id: I8ff4b4852cb7fcc92ac3b1b3ad7bf991d7bddc6b
Reviewed-by: Christian Stromme <christian.stromme@digia.com>
src/plugins/android/src/common/qandroidvideorendercontrol.cpp

index 5f14a46..1891e9d 100644 (file)
@@ -267,7 +267,7 @@ void QAndroidVideoRendererControl::onFrameAvailable()
     QVideoFrame frame(buffer, m_nativeSize, QVideoFrame::Format_BGR32);
 
     if (m_surface->isActive() && (m_surface->surfaceFormat().pixelFormat() != frame.pixelFormat()
-                                  || m_surface->nativeResolution() != frame.size())) {
+                                  || m_surface->surfaceFormat().frameSize() != frame.size())) {
         m_surface->stop();
     }