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 611 matching lines...) Loading... |
622 - (void)updateOrientation { | 622 - (void)updateOrientation { |
623 #if TARGET_OS_IPHONE | 623 #if TARGET_OS_IPHONE |
624 switch ([UIDevice currentDevice].orientation) { | 624 switch ([UIDevice currentDevice].orientation) { |
625 case UIDeviceOrientationPortrait: | 625 case UIDeviceOrientationPortrait: |
626 _rotation = webrtc::kVideoRotation_90; | 626 _rotation = webrtc::kVideoRotation_90; |
627 break; | 627 break; |
628 case UIDeviceOrientationPortraitUpsideDown: | 628 case UIDeviceOrientationPortraitUpsideDown: |
629 _rotation = webrtc::kVideoRotation_270; | 629 _rotation = webrtc::kVideoRotation_270; |
630 break; | 630 break; |
631 case UIDeviceOrientationLandscapeLeft: | 631 case UIDeviceOrientationLandscapeLeft: |
632 _rotation = webrtc::kVideoRotation_180; | 632 _rotation = _capturer->GetUseBackCamera() ? webrtc::kVideoRotation_0 |
| 633 : webrtc::kVideoRotation_180; |
633 break; | 634 break; |
634 case UIDeviceOrientationLandscapeRight: | 635 case UIDeviceOrientationLandscapeRight: |
635 _rotation = webrtc::kVideoRotation_0; | 636 _rotation = _capturer->GetUseBackCamera() ? webrtc::kVideoRotation_180 |
| 637 : webrtc::kVideoRotation_0; |
636 break; | 638 break; |
637 case UIDeviceOrientationFaceUp: | 639 case UIDeviceOrientationFaceUp: |
638 case UIDeviceOrientationFaceDown: | 640 case UIDeviceOrientationFaceDown: |
639 case UIDeviceOrientationUnknown: | 641 case UIDeviceOrientationUnknown: |
640 // Ignore. | 642 // Ignore. |
641 break; | 643 break; |
642 } | 644 } |
643 #endif | 645 #endif |
644 } | 646 } |
645 | 647 |
(...skipping 179 matching lines...) Loading... |
825 buffer = rotated_buffer; | 827 buffer = rotated_buffer; |
826 } | 828 } |
827 } | 829 } |
828 | 830 |
829 OnFrame(cricket::WebRtcVideoFrame(buffer, rotation, | 831 OnFrame(cricket::WebRtcVideoFrame(buffer, rotation, |
830 translated_camera_time_us, 0), | 832 translated_camera_time_us, 0), |
831 captured_width, captured_height); | 833 captured_width, captured_height); |
832 } | 834 } |
833 | 835 |
834 } // namespace webrtc | 836 } // namespace webrtc |
OLD | NEW |