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>
This commit is contained in:
Yoann Lopes
2015-06-01 16:31:44 +02:00
parent 1508f775ac
commit 9f97abb092

View File

@@ -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());