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:
@@ -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());
|
||||
|
||||
Reference in New Issue
Block a user