Ensure UIView.layer is accessed on main thread.
BUG=webrtc:7829 Review-Url: https://codereview.webrtc.org/3002583002 Cr-Commit-Position: refs/heads/master@{#19345}
This commit is contained in:
@ -27,11 +27,14 @@
|
|||||||
if (_captureSession == captureSession) {
|
if (_captureSession == captureSession) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
_captureSession = captureSession;
|
[RTCDispatcher dispatchAsyncOnType:RTCDispatcherTypeMain
|
||||||
AVCaptureVideoPreviewLayer *previewLayer = [self previewLayer];
|
|
||||||
[RTCDispatcher dispatchAsyncOnType:RTCDispatcherTypeCaptureSession
|
|
||||||
block:^{
|
block:^{
|
||||||
previewLayer.session = captureSession;
|
_captureSession = captureSession;
|
||||||
|
AVCaptureVideoPreviewLayer *previewLayer = [self previewLayer];
|
||||||
|
[RTCDispatcher dispatchAsyncOnType:RTCDispatcherTypeCaptureSession
|
||||||
|
block:^{
|
||||||
|
previewLayer.session = captureSession;
|
||||||
|
}];
|
||||||
}];
|
}];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user