Reconfigure capture session in a single transaction.
If we don't reconfigure capture session in a single transaction, RTCCameraPreviewView goes transparent when switching cameras. This is undesired behavior. BUG=webrtc:7177 Review-Url: https://codereview.webrtc.org/2811643006 Cr-Commit-Position: refs/heads/master@{#17664}
This commit is contained in:
parent
5e79b29313
commit
844d2b9670
@ -378,6 +378,7 @@ static inline BOOL IsMediaSubTypeSupported(FourCharCode mediaSubType) {
|
||||
RTCLogError(@"Failed to create front camera input: %@", error.localizedDescription);
|
||||
return;
|
||||
}
|
||||
[_captureSession beginConfiguration];
|
||||
for (AVCaptureDeviceInput *oldInput in [_captureSession.inputs copy]) {
|
||||
[_captureSession removeInput:oldInput];
|
||||
}
|
||||
@ -385,8 +386,8 @@ static inline BOOL IsMediaSubTypeSupported(FourCharCode mediaSubType) {
|
||||
[_captureSession addInput:input];
|
||||
} else {
|
||||
RTCLogError(@"Cannot add camera as an input to the session.");
|
||||
return;
|
||||
}
|
||||
[_captureSession commitConfiguration];
|
||||
}
|
||||
|
||||
- (void)updateOrientation {
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user