2015-04-01 01:02:57 +00:00
|
|
|
#import "RCTViewManager.h"
|
2015-04-02 09:40:03 +00:00
|
|
|
#import <AVFoundation/AVFoundation.h>
|
|
|
|
|
|
|
|
@class RCTCamera;
|
2015-04-01 01:02:57 +00:00
|
|
|
|
2015-05-01 21:33:23 +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
|
|
|
|
};
|
|
|
|
|
|
|
|
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-04-19 22:53:30 +00:00
|
|
|
@interface RCTCameraManager : RCTViewManager<AVCaptureMetadataOutputObjectsDelegate>
|
2015-04-02 09:40:03 +00:00
|
|
|
|
2015-04-11 02:56:30 +00:00
|
|
|
@property (nonatomic) dispatch_queue_t sessionQueue;
|
|
|
|
@property (nonatomic) AVCaptureSession *session;
|
|
|
|
@property (nonatomic) AVCaptureDeviceInput *captureDeviceInput;
|
|
|
|
@property (nonatomic) AVCaptureStillImageOutput *stillImageOutput;
|
2015-04-19 22:53:30 +00:00
|
|
|
@property (nonatomic) AVCaptureMetadataOutput *metadataOutput;
|
2015-04-11 02:56:30 +00:00
|
|
|
@property (nonatomic) id runtimeErrorHandlingObserver;
|
|
|
|
@property (nonatomic) NSInteger presetCamera;
|
2015-04-17 00:16:35 +00:00
|
|
|
@property (nonatomic) AVCaptureVideoPreviewLayer *previewLayer;
|
2015-04-02 09:40:03 +00:00
|
|
|
|
2015-04-17 00:16:35 +00:00
|
|
|
- (void)changeAspect:(NSString *)aspect;
|
2015-04-11 02:56:30 +00:00
|
|
|
- (void)changeCamera:(NSInteger)camera;
|
|
|
|
- (void)changeOrientation:(NSInteger)orientation;
|
2015-05-30 16:36:55 +00:00
|
|
|
- (void)changeFlashMode:(NSInteger)flashMode;
|
2015-04-11 02:56:30 +00:00
|
|
|
- (AVCaptureDevice *)deviceWithMediaType:(NSString *)mediaType preferringPosition:(AVCaptureDevicePosition)position;
|
2015-05-01 21:33:23 +00:00
|
|
|
- (void)capture:(NSDictionary*)options callback:(RCTResponseSenderBlock)callback;
|
2015-04-11 02:56:30 +00:00
|
|
|
|
2015-04-02 09:40:03 +00:00
|
|
|
@end
|