-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathAVCaptureImageControllerOSX.m
More file actions
74 lines (61 loc) · 1.6 KB
/
AVCaptureImageControllerOSX.m
File metadata and controls
74 lines (61 loc) · 1.6 KB
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
71
72
73
74
#import "AVCaptureImageControllerOSX.h"
#import "AVCaptureImageModel.h"
#if !TARGET_OS_IPHONE
@interface AVCaptureImageControllerOSX()
@end
@implementation AVCaptureImageControllerOSX
- (void)dealloc
{
ARC_SUPERDEALLOC(self);
}
- (void)captureDisplayErrorOnMainQueue:(NSError *)error messageTitle:(NSString *)messageTitle
{
dispatch_async(dispatch_get_main_queue(), ^(void) {
NSLOG_METHOD(error);
});
}
- (void)captureSetup
{
__captureIsUsingFrontFacingCamera = YES;
[super captureSetup];
}
- (CALayer*)capturePreviewRootLayer
{
NSView* capturePreviewView = (NSView*)self.outletCapturePreviewView;
REQUIRED_DEBUG(self.outletCapturePreviewView!=nil) && REQUIRED_DEBUG(capturePreviewView.layer!=nil);
return (capturePreviewView.layer);
}
- (void)captureSetupSessionOutputForVideoCapture:(AVCaptureSession*)session
{
[super captureSetupSessionOutputForVideoCapture:session];
[[self.captureVideoDataOutput connectionWithMediaType:AVMediaTypeVideo] setEnabled:NO];
}
- (void)captureTeardown
{
[super captureTeardown];
}
-(void) captureWriteImageData:(NSData*)imageData imageMetadata:(id)imageMetadata
{
#if 0
NSLOG_METHOD(imageData);
if (REQUIRED_DEBUG(imageData!=nil))
{
ARC_RETAIN(imageData);
dispatch_async(dispatch_get_main_queue(),^{
NSImage* image = [[NSImage alloc] initWithData:imageData];
if (REQUIRED_DEBUG(image!=nil))
{
if (REQUIRED_DEBUG(self.outletImageView!=nil))
[self.outletImageView setImage:image];
ARC_RELEASE(image);
}
ARC_RELEASE(imageData);
});
}
#endif
}
- (IBAction)actionCaptureSwitchFrontAndBackCameras:(id)sender
{
}
@end
#endif /* !TARGET_OS_IPHONE */