Jon Hjelle | 7ac8bab | 2016-01-21 11:44:55 -0800 | [diff] [blame] | 1 | /* |
| 2 | * Copyright 2015 The WebRTC project authors. All Rights Reserved. |
| 3 | * |
| 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 |
| 6 | * tree. An additional intellectual property rights grant can be found |
| 7 | * in the file PATENTS. All contributing project authors may |
| 8 | * be found in the AUTHORS file in the root of the source tree. |
| 9 | */ |
| 10 | |
tkchin | 9eeb624 | 2016-04-27 01:54:20 -0700 | [diff] [blame] | 11 | #import <WebRTC/RTCMacros.h> |
| 12 | #import <WebRTC/RTCVideoSource.h> |
Jon Hjelle | 7ac8bab | 2016-01-21 11:44:55 -0800 | [diff] [blame] | 13 | |
| 14 | @class AVCaptureSession; |
| 15 | @class RTCMediaConstraints; |
| 16 | @class RTCPeerConnectionFactory; |
| 17 | |
| 18 | NS_ASSUME_NONNULL_BEGIN |
| 19 | |
| 20 | /** |
sakal | 2d4040e | 2017-07-27 07:48:57 -0700 | [diff] [blame] | 21 | * DEPRECATED Use RTCCameraVideoCapturer instead. |
| 22 | * |
Jon Hjelle | 7ac8bab | 2016-01-21 11:44:55 -0800 | [diff] [blame] | 23 | * RTCAVFoundationVideoSource is a video source that uses |
| 24 | * webrtc::AVFoundationVideoCapturer. We do not currently provide a wrapper for |
| 25 | * that capturer because cricket::VideoCapturer is not ref counted and we cannot |
| 26 | * guarantee its lifetime. Instead, we expose its properties through the ref |
| 27 | * counted video source interface. |
| 28 | */ |
tkchin | 8b577ed | 2016-04-19 10:04:41 -0700 | [diff] [blame] | 29 | RTC_EXPORT |
Jon Hjelle | 7ac8bab | 2016-01-21 11:44:55 -0800 | [diff] [blame] | 30 | @interface RTCAVFoundationVideoSource : RTCVideoSource |
| 31 | |
Tze Kwang Chin | f3cb49f | 2016-03-22 10:57:40 -0700 | [diff] [blame] | 32 | - (instancetype)init NS_UNAVAILABLE; |
Jon Hjelle | 7ac8bab | 2016-01-21 11:44:55 -0800 | [diff] [blame] | 33 | |
kthelgason | 2bc324c | 2016-12-01 01:36:16 -0800 | [diff] [blame] | 34 | /** |
| 35 | * Calling this function will cause frames to be scaled down to the |
| 36 | * requested resolution. Also, frames will be cropped to match the |
| 37 | * requested aspect ratio, and frames will be dropped to match the |
| 38 | * requested fps. The requested aspect ratio is orientation agnostic and |
| 39 | * will be adjusted to maintain the input orientation, so it doesn't |
| 40 | * matter if e.g. 1280x720 or 720x1280 is requested. |
| 41 | */ |
| 42 | - (void)adaptOutputFormatToWidth:(int)width height:(int)height fps:(int)fps; |
| 43 | |
hjon | a1cf366 | 2016-03-14 20:55:22 -0700 | [diff] [blame] | 44 | /** Returns whether rear-facing camera is available for use. */ |
| 45 | @property(nonatomic, readonly) BOOL canUseBackCamera; |
| 46 | |
Jon Hjelle | 7ac8bab | 2016-01-21 11:44:55 -0800 | [diff] [blame] | 47 | /** Switches the camera being used (either front or back). */ |
| 48 | @property(nonatomic, assign) BOOL useBackCamera; |
| 49 | |
| 50 | /** Returns the active capture session. */ |
| 51 | @property(nonatomic, readonly) AVCaptureSession *captureSession; |
| 52 | |
| 53 | @end |
| 54 | |
Jon Hjelle | 7ac8bab | 2016-01-21 11:44:55 -0800 | [diff] [blame] | 55 | NS_ASSUME_NONNULL_END |