Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(86)

Side by Side Diff: webrtc/sdk/objc/Framework/Classes/avfoundationvideocapturer.mm

Issue 2411953002: Reland of Make cricket::VideoFrame inherit webrtc::VideoFrame. (Closed)
Patch Set: Fix for windows build. Created 4 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « webrtc/media/media.gyp ('k') | webrtc/video_frame.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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/base/bind.h" 27 #include "webrtc/base/bind.h"
28 #include "webrtc/base/checks.h" 28 #include "webrtc/base/checks.h"
29 #include "webrtc/base/logging.h"
29 #include "webrtc/base/thread.h" 30 #include "webrtc/base/thread.h"
30 #include "webrtc/common_video/include/corevideo_frame_buffer.h" 31 #include "webrtc/common_video/include/corevideo_frame_buffer.h"
31 #include "webrtc/common_video/rotation.h" 32 #include "webrtc/common_video/rotation.h"
32 33
33 // TODO(denicija): add support for higher frame rates. 34 // TODO(denicija): add support for higher frame rates.
34 // See http://crbug/webrtc/6355 for more info. 35 // See http://crbug/webrtc/6355 for more info.
35 static const int kFramesPerSecond = 30; 36 static const int kFramesPerSecond = 30;
36 37
37 static inline BOOL IsMediaSubTypeSupported(FourCharCode mediaSubType) { 38 static inline BOOL IsMediaSubTypeSupported(FourCharCode mediaSubType) {
38 return (mediaSubType == kCVPixelFormatType_420YpCbCr8PlanarFullRange || 39 return (mediaSubType == kCVPixelFormatType_420YpCbCr8PlanarFullRange ||
(...skipping 782 matching lines...) Expand 10 before | Expand all | Expand 10 after
821 scaled_buffer->DataV(), scaled_buffer->StrideV(), 822 scaled_buffer->DataV(), scaled_buffer->StrideV(),
822 rotated_buffer->MutableDataY(), rotated_buffer->StrideY(), 823 rotated_buffer->MutableDataY(), rotated_buffer->StrideY(),
823 rotated_buffer->MutableDataU(), rotated_buffer->StrideU(), 824 rotated_buffer->MutableDataU(), rotated_buffer->StrideU(),
824 rotated_buffer->MutableDataV(), rotated_buffer->StrideV(), 825 rotated_buffer->MutableDataV(), rotated_buffer->StrideV(),
825 crop_width, crop_height, 826 crop_width, crop_height,
826 static_cast<libyuv::RotationMode>(rotation)); 827 static_cast<libyuv::RotationMode>(rotation));
827 buffer = rotated_buffer; 828 buffer = rotated_buffer;
828 } 829 }
829 } 830 }
830 831
831 OnFrame(cricket::WebRtcVideoFrame(buffer, rotation, 832 OnFrame(webrtc::VideoFrame(buffer, rotation, translated_camera_time_us),
832 translated_camera_time_us, 0),
833 captured_width, captured_height); 833 captured_width, captured_height);
834 } 834 }
835 835
836 } // namespace webrtc 836 } // namespace webrtc
OLDNEW
« no previous file with comments | « webrtc/media/media.gyp ('k') | webrtc/video_frame.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698