| 5 | #import <AVFoundation/AVFoundation.h> |
| 6 |
| 7 | #include <memory> |
| 8 | #include "api/scoped_refptr.h" |
| 9 | #include "api/media_stream_interface.h" |
| 10 |
| 11 |
| 12 | @protocol CapturerInterface |
| 13 | - (void)start; |
| 14 | - (void)stop; |
| 15 | - (void)setIsEnabled:(bool)isEnabled; |
| 16 | - (void)setUncroppedSink:(std::shared_ptr<rtc::VideoSinkInterface<webrtc::VideoFrame>>)sink; |
| 17 | - (void)setPreferredCaptureAspectRatio:(float)aspectRatio; |
| 18 | - (void)setOnFatalError:(std::function<void()>)error; |
| 19 | - (void)setOnPause:(std::function<void(bool)>)pause; |
| 20 | @end |
| 21 |
| 22 | @interface VideoCameraCapturer : NSObject<CapturerInterface> |
| 23 |
| 24 | + (NSArray<AVCaptureDevice *> *)captureDevices; |
| 25 | + (NSArray<AVCaptureDeviceFormat *> *)supportedFormatsForDevice:(AVCaptureDevice *)device; |
| 26 |
| 27 | - (instancetype)initWithSource:(rtc::scoped_refptr<webrtc::VideoTrackSourceInterface>)source isActiveUpdated:(void (^)(bool))isActiveUpdated; |
| 28 |
| 29 | - (void)setupCaptureWithDevice:(AVCaptureDevice *)device format:(AVCaptureDeviceFormat *)format fps:(NSInteger)fps; |
| 30 | - (void)setUncroppedSink:(std::shared_ptr<rtc::VideoSinkInterface<webrtc::VideoFrame>>)sink; |
| 31 | - (BOOL)deviceIsCaptureCompitable:(AVCaptureDevice *)device; |
| 32 |
| 33 | @end |
| 34 | #endif //WEBRTC_MAC |
| 35 | #endif |
| 36 |