summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTimur Pocheptsov <timur.pocheptsov@qt.io>2022-03-02 16:49:17 +0100
committerTimur Pocheptsov <timur.pocheptsov@qt.io>2022-03-21 15:27:09 +0100
commit72def95c8a949c7f855894c225472cd84dcbf443 (patch)
tree3bb202bea5bba601f94a4125885dc79b37817d1d
parentc9b32f7acd5b82cf27a16a7e00232884732e6a30 (diff)
downloadqtmultimedia-72def95c8a949c7f855894c225472cd84dcbf443.tar.gz
AVFCameraSession - don't use preview layer
It's not in use essentially and was a legacy when we, indeed, were adding it as a sub-layer in a view. Starting from macOS Monterey, creating such a layer using +layerWithSession: results in a broken AVCaptureSession - frames/sample buffers stop coming after the first 25 frames. Also, qt application may break other non-qt apps, having their own capture session/viewfinders frozen too. Fixes: QTBUG-99641 Change-Id: I75dfba5db0d50bd015fcd6904a0c5c8ea800230f Reviewed-by: Doris Verria <doris.verria@qt.io> Reviewed-by: Lars Knoll <lars.knoll@qt.io> (cherry picked from commit f7dc6003acfbbd93444c6ae99871404a4cc8f4d2) Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
-rw-r--r--src/multimedia/platform/darwin/camera/avfcamerasession.mm7
1 files changed, 1 insertions, 6 deletions
diff --git a/src/multimedia/platform/darwin/camera/avfcamerasession.mm b/src/multimedia/platform/darwin/camera/avfcamerasession.mm
index 1dedd801b..c1656c44c 100644
--- a/src/multimedia/platform/darwin/camera/avfcamerasession.mm
+++ b/src/multimedia/platform/darwin/camera/avfcamerasession.mm
@@ -523,13 +523,8 @@ void AVFCameraSession::updateAudioOutput()
void AVFCameraSession::updateVideoOutput()
{
- if (m_videoOutput) {
+ if (m_videoOutput)
m_videoOutput->setVideoSink(m_videoSink);
- if (m_videoSink) {
- AVCaptureVideoPreviewLayer *previewLayer = [AVCaptureVideoPreviewLayer layerWithSession:m_captureSession];
- m_videoOutput->setLayer(previewLayer);
- }
- }
}
void AVFCameraSession::requestCameraPermissionIfNeeded()