OLD | NEW |
(Empty) | |
| 1 /* |
| 2 * Copyright 2016 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 |
| 11 #import <AVFoundation/AVFoundation.h> |
| 12 #import <Foundation/Foundation.h> |
| 13 |
| 14 #include "avfoundationvideocapturer.h" |
| 15 |
| 16 NS_ASSUME_NONNULL_BEGIN |
| 17 // This class is an implementation detail of AVFoundationVideoCapturer and handl
es |
| 18 // the ObjC integration with the AVFoundation APIs. |
| 19 // It is meant to be owned by an instance of AVFoundationVideoCapturer. |
| 20 // The reason for this is because other webrtc objects own cricket::VideoCapture
r, which is not |
| 21 // ref counted. To prevent bad behavior we do not expose this class directly. |
| 22 |
| 23 @interface RTCAVFoundationVideoCapturerInternal |
| 24 : NSObject<AVCaptureVideoDataOutputSampleBufferDelegate> |
| 25 |
| 26 @property(nonatomic, readonly) AVCaptureSession *captureSession; |
| 27 @property(nonatomic, readonly) dispatch_queue_t frameQueue; |
| 28 @property(nonatomic, readonly) BOOL canUseBackCamera; |
| 29 @property(nonatomic, assign) BOOL useBackCamera; // Defaults to NO. |
| 30 @property(atomic, assign) BOOL isRunning; // Whether the capture session is run
ning. |
| 31 @property(atomic, assign) BOOL hasStarted; // Whether we have an unmatched star
t. |
| 32 |
| 33 // We keep a pointer back to AVFoundationVideoCapturer to make callbacks on it |
| 34 // when we receive frames. This is safe because this object should be owned by |
| 35 // it. |
| 36 - (instancetype)initWithCapturer:(webrtc::AVFoundationVideoCapturer *)capturer; |
| 37 - (AVCaptureDevice *)getActiveCaptureDevice; |
| 38 |
| 39 - (nullable AVCaptureDevice *)frontCaptureDevice; |
| 40 - (nullable AVCaptureDevice *)backCaptureDevice; |
| 41 |
| 42 // Starts and stops the capture session asynchronously. We cannot do this |
| 43 // synchronously without blocking a WebRTC thread. |
| 44 - (void)start; |
| 45 - (void)stop; |
| 46 |
| 47 @end |
| 48 NS_ASSUME_NONNULL_END |
OLD | NEW |