react-native-camera/ios/RCTCameraManager.h

85 lines
3.2 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>
@property (nonatomic) dispatch_queue_t sessionQueue;
@property (nonatomic) AVCaptureSession *session;
@property (nonatomic) AVCaptureDeviceInput *audioCaptureDeviceInput;
@property (nonatomic) AVCaptureDeviceInput *videoCaptureDeviceInput;
@property (nonatomic) AVCaptureStillImageOutput *stillImageOutput;
@property (nonatomic) AVCaptureMovieFileOutput *movieFileOutput;
2015-04-19 22:53:30 +00:00
@property (nonatomic) AVCaptureMetadataOutput *metadataOutput;
@property (nonatomic) id runtimeErrorHandlingObserver;
@property (nonatomic) NSInteger presetCamera;
2015-04-17 00:16:35 +00:00
@property (nonatomic) AVCaptureVideoPreviewLayer *previewLayer;
@property (nonatomic) 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