CameraCapture.h 939 B

123456789101112131415161718192021222324
  1. #pragma once
  2. #import <AVFoundation/AVFoundation.h>
  3. @interface CameraCaptureController : NSObject<AVCaptureVideoDataOutputSampleBufferDelegate>
  4. - (bool)initCapture:(AVCaptureDevice*)device width:(int)width height:(int)height fps:(float)fps;
  5. - (void)captureOutput:(AVCaptureOutput*)captureOutput didOutputSampleBuffer:(CMSampleBufferRef)sampleBuffer fromConnection:(AVCaptureConnection*)connection;
  6. - (void)start;
  7. - (void)pause;
  8. - (void)stop;
  9. @property (nonatomic, retain) AVCaptureDevice* captureDevice;
  10. @property (nonatomic, retain) AVCaptureSession* captureSession;
  11. @property (nonatomic, retain) AVCaptureDeviceInput* captureInput;
  12. @property (nonatomic, retain) AVCaptureVideoDataOutput* captureOutput;
  13. // override these two for custom preset/fps selection
  14. // they will be called on inited capture
  15. - (NSString*)pickPresetFromWidth:(int)w height:(int)h;
  16. - (AVFrameRateRange*)pickFrameRateRange:(float)fps;
  17. @end