欢迎光临
我们一直在努力

XDCaptureService 最易使用的相机组件

建站超值云服务器,限时71元/月

XDCaptureService 最易使用的相机组件

项目介绍:

<audio controls="controls" style="display: none;"></audio>

简介

XDCaptureService是一个简易及稳定的相机组件,能够帮助你快速构建你的音视频场景,组件支持拍照、录像、人脸检测、景深数据捕获、ISO、白平衡、聚焦等功能

源码地址

https://github.com/caixindong/XDCaptureService

使用

启动组件

@property (nonatomic, strong) XDCaptureService *service;
self.service = [[XDCaptureService alloc] init];
_service.delegate = self;

[_service startRunning];

代理实现

@protocol XDCaptureServiceDelegate <NSObject>

@optional
//service lifecylce
- (void)captureServiceDidStartService:(XDCaptureService *)service;

- (void)captureService:(XDCaptureService *)service serviceDidFailWithError:(NSError *)error;

- (void)captureServiceDidStopService:(XDCaptureService *)service;

- (void)captureService:(XDCaptureService *)service getPreviewLayer:(AVCaptureVideoPreviewLayer *)previewLayer;

- (void)captureService:(XDCaptureService *)service outputSampleBuffer:(CMSampleBufferRef)sampleBuffer;

//record module
- (void)captureServiceRecorderDidStart:(XDCaptureService *)service ;

- (void)captureService:(XDCaptureService *)service recorderDidFailWithError:(NSError *)error;

- (void)captureServiceRecorderDidStop:(XDCaptureService *)service;

//photo capture
- (void)captureService:(XDCaptureService *)service capturePhoto:(UIImage *)photo;

//face detect
- (void)captureService:(XDCaptureService *)service outputFaceDetectData:(NSArray <AVMetadataFaceObject*>*) faces;

//depth map
- (void)captureService:(XDCaptureService *)service captureTrueDepth:(AVDepthData *)depthData API_AVAILABLE(ios(11.0));

@end

更多细节

更多细节可以查看项目里的Example过程。

赞(0)
版权申明:本站文章部分自网络,如有侵权,请联系:west999com@outlook.com 特别注意:本站所有转载文章言论不代表本站观点! 本站所提供的图片等素材,版权归原作者所有,如需使用,请与原作者联系。未经允许不得转载:IDC资讯中心 » XDCaptureService 最易使用的相机组件
分享到: 更多 (0)