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

Side by Side Diff: webrtc/modules/video_capture/objc/device_info_objc.mm

Issue 2309253005: Unify the macOS and iOS capturer implementations (Closed)
Patch Set: remove added presubmit filter 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
OLDNEW
1 /* 1 /*
2 * Copyright (c) 2013 The WebRTC project authors. All Rights Reserved. 2 * Copyright (c) 2013 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 #if !defined(__has_feature) || !__has_feature(objc_arc) 11 #if !defined(__has_feature) || !__has_feature(objc_arc)
12 #error "This file requires ARC support." 12 #error "This file requires ARC support."
13 #endif 13 #endif
14 14
15 #import <AVFoundation/AVFoundation.h> 15 #import <AVFoundation/AVFoundation.h>
16 16
17 #import "webrtc/modules/video_capture/ios/device_info_ios_objc.h" 17 #import "webrtc/modules/video_capture/objc/device_info_objc.h"
18 #include "webrtc/modules/video_capture/video_capture_config.h" 18 #include "webrtc/modules/video_capture/video_capture_config.h"
19 19
20 @implementation DeviceInfoIosObjC 20 @implementation DeviceInfoIosObjC
21 21
22 + (int)captureDeviceCount { 22 + (int)captureDeviceCount {
23 return [[AVCaptureDevice devicesWithMediaType:AVMediaTypeVideo] count]; 23 return [[AVCaptureDevice devicesWithMediaType:AVMediaTypeVideo] count];
24 } 24 }
25 25
26 + (AVCaptureDevice*)captureDeviceForIndex:(int)index { 26 + (AVCaptureDevice*)captureDeviceForIndex:(int)index {
27 return [[AVCaptureDevice devicesWithMediaType:AVMediaTypeVideo] 27 return [[AVCaptureDevice devicesWithMediaType:AVMediaTypeVideo]
(...skipping 48 matching lines...) Expand 10 before | Expand all | Expand 10 after
76 capability.interlaced = false; 76 capability.interlaced = false;
77 } else if ([preset isEqualToString:AVCaptureSessionPreset1280x720]) { 77 } else if ([preset isEqualToString:AVCaptureSessionPreset1280x720]) {
78 capability.width = 1280; 78 capability.width = 1280;
79 capability.height = 720; 79 capability.height = 720;
80 capability.maxFPS = 30; 80 capability.maxFPS = 30;
81 capability.expectedCaptureDelay = 81 capability.expectedCaptureDelay =
82 webrtc::videocapturemodule::kDefaultCaptureDelay; 82 webrtc::videocapturemodule::kDefaultCaptureDelay;
83 capability.rawType = webrtc::kVideoNV12; 83 capability.rawType = webrtc::kVideoNV12;
84 capability.codecType = webrtc::kVideoCodecUnknown; 84 capability.codecType = webrtc::kVideoCodecUnknown;
85 capability.interlaced = false; 85 capability.interlaced = false;
86 } else if ([preset isEqualToString:AVCaptureSessionPreset1920x1080]) {
87 capability.width = 1920;
88 capability.height = 1080;
89 capability.maxFPS = 30;
90 capability.expectedCaptureDelay =
91 webrtc::videocapturemodule::kDefaultCaptureDelay;
92 capability.rawType = webrtc::kVideoNV12;
93 capability.codecType = webrtc::kVideoCodecUnknown;
94 capability.interlaced = false;
95 } 86 }
96 87
97 return capability; 88 return capability;
98 } 89 }
99 90
100 @end 91 @end
OLDNEW
« no previous file with comments | « webrtc/modules/video_capture/objc/device_info_objc.h ('k') | webrtc/modules/video_capture/objc/rtc_video_capture_objc.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698