react-native-camera/RCTCameraManager.h

74 lines
2.7 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,
RCTCameraCaptureTargetCameraRoll = 2
};
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;
@property (nonatomic, strong) RCTResponseSenderBlock videoCallback;
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;
- (void)capture:(NSDictionary*)options callback:(RCTResponseSenderBlock)callback;
- (void)initializeCaptureSessionInput:(NSString*)type;
- (void)stopCapture;
@end