| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright 2017 The WebRTC project authors. All Rights Reserved. | 2 * Copyright 2017 The WebRTC project authors. All Rights Reserved. |
| 3 * | 3 * |
| 4 * Use of this source code is governed by a BSD-style license | 4 * Use of this source code is governed by a BSD-style license |
| 5 * that can be found in the LICENSE file in the root of the source | 5 * that can be found in the LICENSE file in the root of the source |
| 6 * tree. An additional intellectual property rights grant can be found | 6 * tree. An additional intellectual property rights grant can be found |
| 7 * in the file PATENTS. All contributing project authors may | 7 * in the file PATENTS. All contributing project authors may |
| 8 * be found in the AUTHORS file in the root of the source tree. | 8 * be found in the AUTHORS file in the root of the source tree. |
| 9 */ | 9 */ |
| 10 | 10 |
| (...skipping 123 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 134 _currentDevice = device; | 134 _currentDevice = device; |
| 135 | 135 |
| 136 NSError *error = nil; | 136 NSError *error = nil; |
| 137 if (![_currentDevice lockForConfiguration:&error]) { | 137 if (![_currentDevice lockForConfiguration:&error]) { |
| 138 RTCLogError( | 138 RTCLogError( |
| 139 @"Failed to lock device %@. Error: %@", _currentDevi
ce, error.userInfo); | 139 @"Failed to lock device %@. Error: %@", _currentDevi
ce, error.userInfo); |
| 140 return; | 140 return; |
| 141 } | 141 } |
| 142 [self reconfigureCaptureSessionInput]; | 142 [self reconfigureCaptureSessionInput]; |
| 143 [self updateOrientation]; | 143 [self updateOrientation]; |
| 144 [self updateDeviceCaptureFormat:format fps:fps]; |
| 144 [_captureSession startRunning]; | 145 [_captureSession startRunning]; |
| 145 [self updateDeviceCaptureFormat:format fps:fps]; | |
| 146 [_currentDevice unlockForConfiguration]; | 146 [_currentDevice unlockForConfiguration]; |
| 147 _isRunning = YES; | 147 _isRunning = YES; |
| 148 }]; | 148 }]; |
| 149 } | 149 } |
| 150 | 150 |
| 151 - (void)stopCapture { | 151 - (void)stopCapture { |
| 152 _willBeRunning = NO; | 152 _willBeRunning = NO; |
| 153 [RTCDispatcher | 153 [RTCDispatcher |
| 154 dispatchAsyncOnType:RTCDispatcherTypeCaptureSession | 154 dispatchAsyncOnType:RTCDispatcherTypeCaptureSession |
| 155 block:^{ | 155 block:^{ |
| (...skipping 282 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 438 | 438 |
| 439 - (void)updateOrientation { | 439 - (void)updateOrientation { |
| 440 NSAssert([RTCDispatcher isOnQueueForType:RTCDispatcherTypeCaptureSession], | 440 NSAssert([RTCDispatcher isOnQueueForType:RTCDispatcherTypeCaptureSession], |
| 441 @"updateOrientation must be called on the capture queue."); | 441 @"updateOrientation must be called on the capture queue."); |
| 442 #if TARGET_OS_IPHONE | 442 #if TARGET_OS_IPHONE |
| 443 _orientation = [UIDevice currentDevice].orientation; | 443 _orientation = [UIDevice currentDevice].orientation; |
| 444 #endif | 444 #endif |
| 445 } | 445 } |
| 446 | 446 |
| 447 @end | 447 @end |
| OLD | NEW |