Chromium Code Reviews| 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 |
| 11 #include "avfoundationvideocapturer.h" | 11 #include "avfoundationvideocapturer.h" |
| 12 | 12 |
| 13 #import <AVFoundation/AVFoundation.h> | 13 #import <AVFoundation/AVFoundation.h> |
| 14 #import <Foundation/Foundation.h> | 14 #import <Foundation/Foundation.h> |
| 15 #if TARGET_OS_IPHONE | 15 #if TARGET_OS_IPHONE |
| 16 #import <UIKit/UIKit.h> | 16 #import <UIKit/UIKit.h> |
| 17 #endif | 17 #endif |
| 18 | 18 |
| 19 #import "RTCDispatcher+Private.h" | 19 #import "RTCDispatcher+Private.h" |
| 20 #import "WebRTC/RTCLogging.h" | 20 #import "WebRTC/RTCLogging.h" |
| 21 #if TARGET_OS_IPHONE | 21 #if TARGET_OS_IPHONE |
| 22 #import "WebRTC/UIDevice+RTCDevice.h" | 22 #import "WebRTC/UIDevice+RTCDevice.h" |
| 23 #endif | 23 #endif |
| 24 | 24 |
| 25 #include "libyuv/rotate.h" | 25 #include "libyuv/rotate.h" |
| 26 | 26 |
| 27 #include "webrtc/api/video/rotation.h" | |
| 27 #include "webrtc/base/bind.h" | 28 #include "webrtc/base/bind.h" |
| 28 #include "webrtc/base/checks.h" | 29 #include "webrtc/base/checks.h" |
| 29 #include "webrtc/base/logging.h" | 30 #include "webrtc/base/logging.h" |
| 30 #include "webrtc/base/thread.h" | 31 #include "webrtc/base/thread.h" |
| 31 #include "webrtc/common_video/include/corevideo_frame_buffer.h" | 32 #include "webrtc/common_video/include/corevideo_frame_buffer.h" |
|
the sun
2016/11/24 10:36:59
Should corevideo_frame_buffer move here? The "sdk/
nisse-webrtc
2016/11/25 08:58:03
I agree that makes some sense. But it's for someon
| |
| 32 #include "webrtc/common_video/rotation.h" | |
| 33 | 33 |
| 34 // TODO(denicija): add support for higher frame rates. | 34 // TODO(denicija): add support for higher frame rates. |
| 35 // See http://crbug/webrtc/6355 for more info. | 35 // See http://crbug/webrtc/6355 for more info. |
| 36 static const int kFramesPerSecond = 30; | 36 static const int kFramesPerSecond = 30; |
| 37 | 37 |
| 38 static inline BOOL IsMediaSubTypeSupported(FourCharCode mediaSubType) { | 38 static inline BOOL IsMediaSubTypeSupported(FourCharCode mediaSubType) { |
| 39 return (mediaSubType == kCVPixelFormatType_420YpCbCr8PlanarFullRange || | 39 return (mediaSubType == kCVPixelFormatType_420YpCbCr8PlanarFullRange || |
| 40 mediaSubType == kCVPixelFormatType_420YpCbCr8BiPlanarVideoRange); | 40 mediaSubType == kCVPixelFormatType_420YpCbCr8BiPlanarVideoRange); |
| 41 } | 41 } |
| 42 | 42 |
| (...skipping 778 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 821 buffer->width(), buffer->height(), | 821 buffer->width(), buffer->height(), |
| 822 static_cast<libyuv::RotationMode>(rotation)); | 822 static_cast<libyuv::RotationMode>(rotation)); |
| 823 buffer = rotated_buffer; | 823 buffer = rotated_buffer; |
| 824 } | 824 } |
| 825 | 825 |
| 826 OnFrame(webrtc::VideoFrame(buffer, rotation, translated_camera_time_us), | 826 OnFrame(webrtc::VideoFrame(buffer, rotation, translated_camera_time_us), |
| 827 captured_width, captured_height); | 827 captured_width, captured_height); |
| 828 } | 828 } |
| 829 | 829 |
| 830 } // namespace webrtc | 830 } // namespace webrtc |
| OLD | NEW |