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) \ | 415 #if defined(WEBRTC_IOS) |
416 && __IPHONE_OS_VERSION_MAX_ALLOWED >= __IPHONE_7_0 | 416 captureSession.usesApplicationAudioSession = NO; |
417 NSString *version = [[UIDevice currentDevice] systemVersion]; | |
418 if ([version integerValue] >= 7) { | |
419 captureSession.usesApplicationAudioSession = NO; | |
420 } | |
421 #endif | 417 #endif |
422 | |
423 // Add the output. | 418 // Add the output. |
424 AVCaptureVideoDataOutput *videoDataOutput = [self videoDataOutput]; | 419 AVCaptureVideoDataOutput *videoDataOutput = [self videoDataOutput]; |
425 if (![captureSession canAddOutput:videoDataOutput]) { | 420 if (![captureSession canAddOutput:videoDataOutput]) { |
426 RTCLogError(@"Video data output unsupported."); | 421 RTCLogError(@"Video data output unsupported."); |
427 return NO; | 422 return NO; |
428 } | 423 } |
429 [captureSession addOutput:videoDataOutput]; | 424 [captureSession addOutput:videoDataOutput]; |
430 | 425 |
431 // Get the front and back cameras. If there isn't a front camera | 426 // Get the front and back cameras. If there isn't a front camera |
432 // give up. | 427 // give up. |
(...skipping 325 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
758 buffer = rotated_buffer; | 753 buffer = rotated_buffer; |
759 } | 754 } |
760 } | 755 } |
761 | 756 |
762 OnFrame(cricket::WebRtcVideoFrame(buffer, rotation, | 757 OnFrame(cricket::WebRtcVideoFrame(buffer, rotation, |
763 translated_camera_time_us, 0), | 758 translated_camera_time_us, 0), |
764 captured_width, captured_height); | 759 captured_width, captured_height); |
765 } | 760 } |
766 | 761 |
767 } // namespace webrtc | 762 } // namespace webrtc |
OLD | NEW |