OLD | NEW |
1 /* | 1 /* |
2 * Copyright 2015 The WebRTC project authors. All Rights Reserved. | 2 * Copyright 2015 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 394 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
405 } | 405 } |
406 }]; | 406 }]; |
407 } | 407 } |
408 | 408 |
409 #endif // TARGET_OS_IPHONE | 409 #endif // TARGET_OS_IPHONE |
410 | 410 |
411 #pragma mark - Private | 411 #pragma mark - Private |
412 | 412 |
413 - (BOOL)setupCaptureSession { | 413 - (BOOL)setupCaptureSession { |
414 AVCaptureSession *captureSession = [[AVCaptureSession alloc] init]; | 414 AVCaptureSession *captureSession = [[AVCaptureSession alloc] init]; |
415 #if defined(__IPHONE_7_0) && defined(__IPHONE_OS_VERSION_MAX_ALLOWED) \ | |
416 && __IPHONE_OS_VERSION_MAX_ALLOWED >= __IPHONE_7_0 | |
417 NSString *version = [[UIDevice currentDevice] systemVersion]; | |
418 if ([version integerValue] >= 7) { | |
419 captureSession.usesApplicationAudioSession = NO; | |
420 } | |
421 #endif | |
422 | 415 |
423 // Add the output. | 416 // Add the output. |
424 AVCaptureVideoDataOutput *videoDataOutput = [self videoDataOutput]; | 417 AVCaptureVideoDataOutput *videoDataOutput = [self videoDataOutput]; |
425 if (![captureSession canAddOutput:videoDataOutput]) { | 418 if (![captureSession canAddOutput:videoDataOutput]) { |
426 RTCLogError(@"Video data output unsupported."); | 419 RTCLogError(@"Video data output unsupported."); |
427 return NO; | 420 return NO; |
428 } | 421 } |
429 [captureSession addOutput:videoDataOutput]; | 422 [captureSession addOutput:videoDataOutput]; |
430 | 423 |
431 // Get the front and back cameras. If there isn't a front camera | 424 // Get the front and back cameras. If there isn't a front camera |
(...skipping 326 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
758 buffer = rotated_buffer; | 751 buffer = rotated_buffer; |
759 } | 752 } |
760 } | 753 } |
761 | 754 |
762 OnFrame(cricket::WebRtcVideoFrame(buffer, rotation, | 755 OnFrame(cricket::WebRtcVideoFrame(buffer, rotation, |
763 translated_camera_time_us, 0), | 756 translated_camera_time_us, 0), |
764 captured_width, captured_height); | 757 captured_width, captured_height); |
765 } | 758 } |
766 | 759 |
767 } // namespace webrtc | 760 } // namespace webrtc |
OLD | NEW |