diff options
author | Timur Pocheptsov <timur.pocheptsov@theqtcompany.com> | 2016-07-22 14:29:45 +0200 |
---|---|---|
committer | Timur Pocheptsov <timur.pocheptsov@theqtcompany.com> | 2016-07-26 13:01:56 +0000 |
commit | 7788feea5d55418ab61681e122c1d2d29f7bddce (patch) | |
tree | 7e79602d22aef1bb079b70b55ffca2ea54a888f4 /LICENSE.FDL | |
parent | ab940d8fe9affd2ae1bb9cdf0e3f9d41fa49a662 (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 'LICENSE.FDL')
0 files changed, 0 insertions, 0 deletions