blob: 6d369b34034ebca27a36645b645d244681d05805 [file] [log] [blame]
Jon Hjelle7ac8bab2016-01-21 11:44:55 -08001/*
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
tkchin9eeb6242016-04-27 01:54:20 -070011#import <WebRTC/RTCMacros.h>
12#import <WebRTC/RTCVideoSource.h>
Jon Hjelle7ac8bab2016-01-21 11:44:55 -080013
14@class AVCaptureSession;
15@class RTCMediaConstraints;
16@class RTCPeerConnectionFactory;
17
18NS_ASSUME_NONNULL_BEGIN
19
20/**
sakal2d4040e2017-07-27 07:48:57 -070021 * DEPRECATED Use RTCCameraVideoCapturer instead.
22 *
Jon Hjelle7ac8bab2016-01-21 11:44:55 -080023 * 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 */
tkchin8b577ed2016-04-19 10:04:41 -070029RTC_EXPORT
Jon Hjelle7ac8bab2016-01-21 11:44:55 -080030@interface RTCAVFoundationVideoSource : RTCVideoSource
31
Tze Kwang Chinf3cb49f2016-03-22 10:57:40 -070032- (instancetype)init NS_UNAVAILABLE;
Jon Hjelle7ac8bab2016-01-21 11:44:55 -080033
kthelgason2bc324c2016-12-01 01:36:16 -080034/**
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
hjona1cf3662016-03-14 20:55:22 -070044/** Returns whether rear-facing camera is available for use. */
45@property(nonatomic, readonly) BOOL canUseBackCamera;
46
Jon Hjelle7ac8bab2016-01-21 11:44:55 -080047/** 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 Hjelle7ac8bab2016-01-21 11:44:55 -080055NS_ASSUME_NONNULL_END