forked from thisandagain/cam
-
Notifications
You must be signed in to change notification settings - Fork 0
/
DIYCam.h
70 lines (51 loc) · 1.63 KB
/
DIYCam.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
//
// DIYCam.h
// DIYCam
//
// Created by Andrew Sliwinski on 5/29/12.
// Copyright (c) 2012 DIY, Co. All rights reserved.
//
#import <Foundation/Foundation.h>
#import <AVFoundation/AVFoundation.h>
#import <AssetsLibrary/AssetsLibrary.h>
#import <MobileCoreServices/UTCoreTypes.h>
#import "DIYCamDefaults.h"
#import "DIYCamUtilities.h"
#import "UIImage+Resize.h"
#import "UIImage+Save.h"
//
@class DIYCam;
@protocol DIYCamDelegate <NSObject>
@required
- (void)camReady:(DIYCam *)cam;
- (void)camDidFail:(DIYCam *)cam withError:(NSError *)error;
- (void)camCaptureStarted:(DIYCam *)cam;
- (void)camCaptureStopped:(DIYCam *)cam;
- (void)camCaptureProcessing:(DIYCam *)cam;
- (void)camCaptureComplete:(DIYCam *)cam withAsset:(NSDictionary *)asset;
@end
//
@interface DIYCam : NSObject <AVCaptureFileOutputRecordingDelegate>
{
@private AVCaptureDeviceInput *videoInput;
@private AVCaptureDeviceInput *audioInput;
@private AVCaptureStillImageOutput *stillImageOutput;
@private AVCaptureMovieFileOutput *movieFileOutput;
@private AVAssetImageGenerator *thumbnailGenerator;
@private ALAssetsLibrary *library;
@private NSOperationQueue *queue;
}
@property (nonatomic, assign) id <DIYCamDelegate> delegate;
@property (nonatomic, retain) AVCaptureSession *session;
@property (nonatomic, assign) AVCaptureVideoPreviewLayer *preview;
@property (nonatomic, assign) BOOL isRecording;
#pragma mark - Setup
- (void)setup;
#pragma mark - Photo
- (void)startPhotoCapture;
#pragma mark - Video
- (void)startVideoCapture;
- (void)stopVideoCapture;
#pragma mark - Utilities
- (NSString *)createAssetFilePath:(NSString *)extension;
@end