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 14 matching lines...) Expand all Loading... | |
25 // the source, it should be ok to keep a raw pointer to the | 25 // the source, it should be ok to keep a raw pointer to the |
26 // capturer. | 26 // capturer. |
27 _capturer = new webrtc::AVFoundationVideoCapturer(); | 27 _capturer = new webrtc::AVFoundationVideoCapturer(); |
28 rtc::scoped_refptr<webrtc::VideoTrackSourceInterface> source = | 28 rtc::scoped_refptr<webrtc::VideoTrackSourceInterface> source = |
29 factory.nativeFactory->CreateVideoSource( | 29 factory.nativeFactory->CreateVideoSource( |
30 _capturer, constraints.nativeConstraints.get()); | 30 _capturer, constraints.nativeConstraints.get()); |
31 | 31 |
32 return [super initWithNativeVideoSource:source]; | 32 return [super initWithNativeVideoSource:source]; |
33 } | 33 } |
34 | 34 |
35 - (void)adaptOutputFormatToWidth:(int)width height:(int)height fps:(int)fps { | |
magjed_webrtc
2016/11/23 13:53:40
nit: I'm not sure if you need to line up the colon
kthelgason
2016/11/23 14:01:48
The styleguide reads to me like you only need to d
magjed_webrtc
2016/11/24 13:04:31
Acknowledged.
tkchin_webrtc
2016/11/30 22:08:52
there is some leeway here. I would prefer them on
kthelgason
2016/12/01 09:16:59
Acknowledged.
| |
36 self.capturer->AdaptOutputFormat(width, height, fps); | |
37 } | |
38 | |
35 - (BOOL)canUseBackCamera { | 39 - (BOOL)canUseBackCamera { |
36 return self.capturer->CanUseBackCamera(); | 40 return self.capturer->CanUseBackCamera(); |
37 } | 41 } |
38 | 42 |
39 - (BOOL)useBackCamera { | 43 - (BOOL)useBackCamera { |
40 return self.capturer->GetUseBackCamera(); | 44 return self.capturer->GetUseBackCamera(); |
41 } | 45 } |
42 | 46 |
43 - (void)setUseBackCamera:(BOOL)useBackCamera { | 47 - (void)setUseBackCamera:(BOOL)useBackCamera { |
44 self.capturer->SetUseBackCamera(useBackCamera); | 48 self.capturer->SetUseBackCamera(useBackCamera); |
45 } | 49 } |
46 | 50 |
47 - (AVCaptureSession *)captureSession { | 51 - (AVCaptureSession *)captureSession { |
48 return self.capturer->GetCaptureSession(); | 52 return self.capturer->GetCaptureSession(); |
49 } | 53 } |
50 | 54 |
51 - (webrtc::AVFoundationVideoCapturer *)capturer { | 55 - (webrtc::AVFoundationVideoCapturer *)capturer { |
52 return _capturer; | 56 return _capturer; |
53 } | 57 } |
54 | 58 |
55 @end | 59 @end |
OLD | NEW |