Timur Pocheptsov 7788feea5d 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>
2016-07-26 13:01:56 +00:00
2016-05-23 18:31:50 +00:00
2016-05-04 04:28:10 +00:00
2012-09-03 19:53:28 +02:00
2015-02-12 10:27:47 +00:00
Description
No description provided
17 MiB
Languages
C++ 90.5%
Objective-C++ 5.8%
QMake 1%
Objective-C 0.9%
QML 0.5%
Other 1%