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 390 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
401 } | 401 } |
402 | 402 |
403 #pragma mark - Private, called inside capture queue | 403 #pragma mark - Private, called inside capture queue |
404 | 404 |
405 - (void)updateDeviceCaptureFormat:(AVCaptureDeviceFormat *)format fps:(NSInteger
)fps { | 405 - (void)updateDeviceCaptureFormat:(AVCaptureDeviceFormat *)format fps:(NSInteger
)fps { |
406 NSAssert([RTCDispatcher isOnQueueForType:RTCDispatcherTypeCaptureSession], | 406 NSAssert([RTCDispatcher isOnQueueForType:RTCDispatcherTypeCaptureSession], |
407 @"updateDeviceCaptureFormat must be called on the capture queue."); | 407 @"updateDeviceCaptureFormat must be called on the capture queue."); |
408 @try { | 408 @try { |
409 _currentDevice.activeFormat = format; | 409 _currentDevice.activeFormat = format; |
410 _currentDevice.activeVideoMinFrameDuration = CMTimeMake(1, fps); | 410 _currentDevice.activeVideoMinFrameDuration = CMTimeMake(1, fps); |
411 _currentDevice.activeVideoMaxFrameDuration = CMTimeMake(1, fps); | |
412 } @catch (NSException *exception) { | 411 } @catch (NSException *exception) { |
413 RTCLogError(@"Failed to set active format!\n User info:%@", exception.userIn
fo); | 412 RTCLogError(@"Failed to set active format!\n User info:%@", exception.userIn
fo); |
414 return; | 413 return; |
415 } | 414 } |
416 } | 415 } |
417 | 416 |
418 - (void)reconfigureCaptureSessionInput { | 417 - (void)reconfigureCaptureSessionInput { |
419 NSAssert([RTCDispatcher isOnQueueForType:RTCDispatcherTypeCaptureSession], | 418 NSAssert([RTCDispatcher isOnQueueForType:RTCDispatcherTypeCaptureSession], |
420 @"reconfigureCaptureSessionInput must be called on the capture queue.
"); | 419 @"reconfigureCaptureSessionInput must be called on the capture queue.
"); |
421 NSError *error = nil; | 420 NSError *error = nil; |
(...skipping 17 matching lines...) Expand all Loading... |
439 | 438 |
440 - (void)updateOrientation { | 439 - (void)updateOrientation { |
441 NSAssert([RTCDispatcher isOnQueueForType:RTCDispatcherTypeCaptureSession], | 440 NSAssert([RTCDispatcher isOnQueueForType:RTCDispatcherTypeCaptureSession], |
442 @"updateOrientation must be called on the capture queue."); | 441 @"updateOrientation must be called on the capture queue."); |
443 #if TARGET_OS_IPHONE | 442 #if TARGET_OS_IPHONE |
444 _orientation = [UIDevice currentDevice].orientation; | 443 _orientation = [UIDevice currentDevice].orientation; |
445 #endif | 444 #endif |
446 } | 445 } |
447 | 446 |
448 @end | 447 @end |
OLD | NEW |