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 |
| 36 height:(int)height |
| 37 fps:(int)fps { |
| 38 self.capturer->AdaptOutputFormat(width, height, fps); |
| 39 } |
| 40 |
35 - (BOOL)canUseBackCamera { | 41 - (BOOL)canUseBackCamera { |
36 return self.capturer->CanUseBackCamera(); | 42 return self.capturer->CanUseBackCamera(); |
37 } | 43 } |
38 | 44 |
39 - (BOOL)useBackCamera { | 45 - (BOOL)useBackCamera { |
40 return self.capturer->GetUseBackCamera(); | 46 return self.capturer->GetUseBackCamera(); |
41 } | 47 } |
42 | 48 |
43 - (void)setUseBackCamera:(BOOL)useBackCamera { | 49 - (void)setUseBackCamera:(BOOL)useBackCamera { |
44 self.capturer->SetUseBackCamera(useBackCamera); | 50 self.capturer->SetUseBackCamera(useBackCamera); |
45 } | 51 } |
46 | 52 |
47 - (AVCaptureSession *)captureSession { | 53 - (AVCaptureSession *)captureSession { |
48 return self.capturer->GetCaptureSession(); | 54 return self.capturer->GetCaptureSession(); |
49 } | 55 } |
50 | 56 |
51 - (webrtc::AVFoundationVideoCapturer *)capturer { | 57 - (webrtc::AVFoundationVideoCapturer *)capturer { |
52 return _capturer; | 58 return _capturer; |
53 } | 59 } |
54 | 60 |
55 @end | 61 @end |
OLD | NEW |