BDFaceVideoCaptureDevice.h
1.09 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
//
// BDFaceVideoCaptureDevice.h
// IDLFaceSDKDemoOC
//
// Created by 阿凡树 on 2017/5/23.
// Copyright © 2017年 Baidu. All rights reserved.
//
// 相机视频流处理类
// 初始化之后,设定delegate,即可从代理里面获取到每一个分帧的image
//
#import <Foundation/Foundation.h>
#import <UIKit/UIKit.h>
#import <AVFoundation/AVFoundation.h>
@protocol CaptureDataOutputProtocol;
@interface BDFaceVideoCaptureDevice : NSObject
@property (nonatomic, readwrite, weak) id<CaptureDataOutputProtocol> delegate;
@property (nonatomic, readwrite, assign) BOOL runningStatus;
/**
* 设定使用前置摄像头或者后置摄像头
* AVCaptureDevicePositionFront 前置摄像头(默认)
* AVCaptureDevicePositionBack 后置摄像头
*/
@property (nonatomic, readwrite, assign) AVCaptureDevicePosition position;
- (void)startSession;
- (void)stopSession;
- (void)resetSession;
@end
@protocol CaptureDataOutputProtocol <NSObject>
/**
* 回调每一个分帧的image
*/
- (void)captureOutputSampleBuffer:(CMSampleBufferRef)sampleBuffer image:(UIImage *)image;
- (void)captureError;
@end