summaryrefslogtreecommitdiffstats
path: root/src/plugins/avfoundation/camera/avfmediarecordercontrol_ios.h
diff options
context:
space:
mode:
authorTimur Pocheptsov <timur.pocheptsov@theqtcompany.com>2016-07-22 14:29:45 +0200
committerTimur Pocheptsov <timur.pocheptsov@theqtcompany.com>2016-07-26 13:01:56 +0000
commit7788feea5d55418ab61681e122c1d2d29f7bddce (patch)
tree7e79602d22aef1bb079b70b55ffca2ea54a888f4 /src/plugins/avfoundation/camera/avfmediarecordercontrol_ios.h
parentab940d8fe9affd2ae1bb9cdf0e3f9d41fa49a662 (diff)
AVFMediaAssetWriter - fix race conditions
Apple recommends starting/setting up a session (AVCaptureSession) on a special queue and in the past we did this on the writer's queue. Unfortunately, we also can access the same session from a different thread and this results in race conditions and different weird crashes, for example, we're calling start/stopRunning from the writer's queue, while the session is being configured (in between beginConfiguration/commitConfiguration on the recorder control's thread). So we have to limit access to the session by the control's thread. Apple docs say we have to ensure all appendSampleBuffer calls done _before_ finishWriting. We ensure this by dispatching_sync an empty block on the writer's queue after store-release of m_state. We also do the same with video queue to ensure it does not try to access viewfinder's data after stop/abort executed. All these changes also make lock/mutex unneeded. Task-number: QTBUG-54890 Change-Id: I38e86c879b6b62306bdfbeade65405d6ac3be9f3 Reviewed-by: Yoann Lopes <yoann.lopes@qt.io>
Diffstat (limited to 'src/plugins/avfoundation/camera/avfmediarecordercontrol_ios.h')
-rw-r--r--src/plugins/avfoundation/camera/avfmediarecordercontrol_ios.h2
1 files changed, 0 insertions, 2 deletions
diff --git a/src/plugins/avfoundation/camera/avfmediarecordercontrol_ios.h b/src/plugins/avfoundation/camera/avfmediarecordercontrol_ios.h
index 33cb08804..589810b07 100644
--- a/src/plugins/avfoundation/camera/avfmediarecordercontrol_ios.h
+++ b/src/plugins/avfoundation/camera/avfmediarecordercontrol_ios.h
@@ -91,8 +91,6 @@ private:
void stopWriter();
AVFCameraService *m_service;
-
- AVFScopedPointer<dispatch_queue_t> m_writerQueue;
AVFScopedPointer<QT_MANGLE_NAMESPACE(AVFMediaAssetWriter)> m_writer;
QUrl m_outputLocation;