react-native-camera/ios/RCTCameraManager.h

85 lines
3.3 KiB
C
Raw Normal View History

2015-04-01 01:02:57 +00:00
#import "RCTViewManager.h"
#import <AVFoundation/AVFoundation.h>
@class RCTCamera;
2015-04-01 01:02:57 +00:00
typedef NS_ENUM(NSInteger, RCTCameraAspect) {
RCTCameraAspectFill = 0,
RCTCameraAspectFit = 1,
RCTCameraAspectStretch = 2
};
typedef NS_ENUM(NSInteger, RCTCameraCaptureMode) {
RCTCameraCaptureModeStill = 0,
RCTCameraCaptureModeVideo = 1
};
typedef NS_ENUM(NSInteger, RCTCameraCaptureTarget) {
RCTCameraCaptureTargetMemory = 0,
RCTCameraCaptureTargetDisk = 1,
RCTCameraCaptureTargetTemp = 2,
RCTCameraCaptureTargetCameraRoll = 3
};
typedef NS_ENUM(NSInteger, RCTCameraOrientation) {
RCTCameraOrientationAuto = 0,
RCTCameraOrientationLandscapeLeft = AVCaptureVideoOrientationLandscapeLeft,
RCTCameraOrientationLandscapeRight = AVCaptureVideoOrientationLandscapeRight,
RCTCameraOrientationPortrait = AVCaptureVideoOrientationPortrait,
RCTCameraOrientationPortraitUpsideDown = AVCaptureVideoOrientationPortraitUpsideDown
};
typedef NS_ENUM(NSInteger, RCTCameraType) {
RCTCameraTypeFront = AVCaptureDevicePositionFront,
RCTCameraTypeBack = AVCaptureDevicePositionBack
};
2015-05-30 16:36:55 +00:00
typedef NS_ENUM(NSInteger, RCTCameraFlashMode) {
RCTCameraFlashModeOff = AVCaptureFlashModeOff,
RCTCameraFlashModeOn = AVCaptureFlashModeOn,
RCTCameraFlashModeAuto = AVCaptureFlashModeAuto
2015-05-30 16:36:55 +00:00
};
2015-06-15 18:58:36 +00:00
typedef NS_ENUM(NSInteger, RCTCameraTorchMode) {
RCTCameraTorchModeOff = AVCaptureTorchModeOff,
RCTCameraTorchModeOn = AVCaptureTorchModeOn,
RCTCameraTorchModeAuto = AVCaptureTorchModeAuto
2015-06-15 18:58:36 +00:00
};
@interface RCTCameraManager : RCTViewManager<AVCaptureMetadataOutputObjectsDelegate, AVCaptureFileOutputRecordingDelegate>
2016-03-23 19:13:35 +00:00
@property (nonatomic, strong) dispatch_queue_t sessionQueue;
@property (nonatomic, strong) AVCaptureSession *session;
@property (nonatomic, strong) AVCaptureDeviceInput *audioCaptureDeviceInput;
@property (nonatomic, strong) AVCaptureDeviceInput *videoCaptureDeviceInput;
@property (nonatomic, strong) AVCaptureStillImageOutput *stillImageOutput;
@property (nonatomic, strong) AVCaptureMovieFileOutput *movieFileOutput;
@property (nonatomic, strong) AVCaptureMetadataOutput *metadataOutput;
@property (nonatomic, strong) id runtimeErrorHandlingObserver;
@property (nonatomic, assign) NSInteger presetCamera;
@property (nonatomic, strong) AVCaptureVideoPreviewLayer *previewLayer;
@property (nonatomic, assign) NSInteger videoTarget;
2016-01-28 11:14:00 +00:00
@property (nonatomic, strong) RCTPromiseResolveBlock videoResolve;
@property (nonatomic, strong) RCTPromiseRejectBlock videoReject;
2015-10-10 22:23:27 +00:00
@property (nonatomic, strong) RCTCamera *camera;
2015-07-27 10:08:33 +00:00
2015-04-17 00:16:35 +00:00
- (void)changeAspect:(NSString *)aspect;
- (void)changeCamera:(NSInteger)camera;
- (void)changeOrientation:(NSInteger)orientation;
2015-05-30 16:36:55 +00:00
- (void)changeFlashMode:(NSInteger)flashMode;
2015-06-15 18:58:36 +00:00
- (void)changeTorchMode:(NSInteger)torchMode;
- (AVCaptureDevice *)deviceWithMediaType:(NSString *)mediaType preferringPosition:(AVCaptureDevicePosition)position;
2016-01-28 11:14:00 +00:00
- (void)capture:(NSDictionary*)options resolve:(RCTPromiseResolveBlock)resolve reject:(RCTPromiseRejectBlock)reject;
2016-02-01 03:27:46 +00:00
- (void)getFOV:(RCTPromiseResolveBlock)resolve reject:(RCTPromiseRejectBlock)reject;
- (void)hasFlash:(RCTPromiseResolveBlock)resolve reject:(RCTPromiseRejectBlock)reject;
- (void)initializeCaptureSessionInput:(NSString*)type;
- (void)stopCapture;
- (void)startSession;
- (void)stopSession;
2015-07-27 10:08:33 +00:00
- (void)focusAtThePoint:(CGPoint) atPoint;
- (void)zoom:(CGFloat)velocity reactTag:(NSNumber *)reactTag;
2015-07-27 10:08:33 +00:00
@end