summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorYoann Lopes <yoann.lopes@theqtcompany.com>2015-06-01 16:31:44 +0200
committerYoann Lopes <yoann.lopes@theqtcompany.com>2015-06-02 22:29:48 +0000
commit9f97abb0922285e26de8927ea8e526f455d36ef4 (patch)
treeaa504b6f3f770abc0afc87616683d8bf1e2b4c4a
parent1508f775acfd7aad18e71dde35c3ff0c9b073fc1 (diff)
AVFoundation: fix a problem when changing the camera viewfinder size.
We need to restart the video surface when the frame size changes. Change-Id: I81af3cb40fb40f7d157174ac96d42213880fbacd Reviewed-by: Timur Pocheptsov <Timur.Pocheptsov@digia.com>
-rw-r--r--src/plugins/avfoundation/camera/avfcamerarenderercontrol.mm4
1 files changed, 3 insertions, 1 deletions
diff --git a/src/plugins/avfoundation/camera/avfcamerarenderercontrol.mm b/src/plugins/avfoundation/camera/avfcamerarenderercontrol.mm
index dd838d9b5..529541285 100644
--- a/src/plugins/avfoundation/camera/avfcamerarenderercontrol.mm
+++ b/src/plugins/avfoundation/camera/avfcamerarenderercontrol.mm
@@ -309,8 +309,10 @@ void AVFCameraRendererControl::handleViewfinderFrame()
}
if (m_surface && frame.isValid()) {
- if (m_surface->isActive() && m_surface->surfaceFormat().pixelFormat() != frame.pixelFormat())
+ if (m_surface->isActive() && (m_surface->surfaceFormat().pixelFormat() != frame.pixelFormat()
+ || m_surface->surfaceFormat().frameSize() != frame.size())) {
m_surface->stop();
+ }
if (!m_surface->isActive()) {
QVideoSurfaceFormat format(frame.size(), frame.pixelFormat());