Add
```
<ZGCaptureDeviceDataOutputPixelBufferDelegate>
```
```
- (id<ZGCaptureDevice>)captureDevice {
if (!_captureDevice) {
if (self.captureSourceType == ZGCustomVideoCaptureSourceTypeCamera) {
// BGRA32 or NV12
OSType pixelFormat = self.captureDataFormat == ZGCustomVideoCaptureDataFormatBGRA32 ? kCVPixelFormatType_32BGRA : kCVPixelFormatType_420YpCbCr8BiPlanarVideoRange;
_captureDevice = [[ZGCaptureDeviceCamera alloc] initWithPixelFormatType:pixelFormat];
} else if (self.captureSourceType == ZGCustomVideoCaptureSourceTypeImage) {
_captureDevice = [[ZGCaptureDeviceImage alloc] initWithMotionImage:[UIImage imageNamed:@"ZegoLogo"].CGImage contentSize:CGSizeMake(720, 1280)];
}
_captureDevice.delegate = self;
}
return _captureDevice;
}
```
在代理方法中调用美颜的方法,如下所示(The method of invoking beauty in the proxy method is shown below.):
```
- (void)captureDevice:(id<ZGCaptureDevice>)device didCapturedData:(CMSampleBufferRef)data {
if (self.captureBufferType == ZGCustomVideoCaptureBufferTypeCVPixelBuffer) {
// BufferType: CVPixelBuffer
CVPixelBufferRef buffer = CMSampleBufferGetImageBuffer(data);
CMTime timeStamp = CMSampleBufferGetPresentationTimeStamp(data);
OSType osType = CVPixelBufferGetPixelFormatType(buffer);
[self.beautyManager processWithPixelBuffer:buffer formatType:osType];
[[ZegoExpressEngine sharedEngine] sendCustomVideoCapturePixelBuffer:buffer timestamp:timeStamp];
} else if (self.captureBufferType == ZGCustomVideoCaptureBufferTypeEncodedFrame) {
[self.encoder encodeBuffer:data];
}
```
- 美狐SDK接入文档
- Meihu SDK Access Document
- (Untitled)
- 一、基础描述(Basic description)
- 1. 最新特性 (Latest features)
- 2. 支持平台 (Support platform)
- 二、集成步骤 (Integration steps)
- 3. 配置工程(Configuration Engineering)
- 4. 使用 MHUI (Use MHUI)
- 5. 腾讯直播 SDK/短视频SDK (Tencent live SDK / short video SDK)
- 6. 金山直播SDK (Jinshan)
- 7. 七牛直播SDK (Qiniu Live)
- 8. 七牛短视频SDK (Qiniu ShortVideo)
- 9. Movieous短视频 (Movieous short Video)
- 10. 即构直播SDK (Zego live)
- 11. 即构实时音视频SDK(Zego Real time audio and video)
- 12. 新版Zego(即构)实时音视频(New Zego Real time audio and video)
- 13. 网易直播 (NetEase live)
- 14. 腾讯互动直播 (Tencent interactive live broadcast)
- 15. 腾讯实时音视频(Tencent real-time audio and video)
- 16. 融云实时音视频 (SealRTC)
- 17. 声网视频通话 (Agora video call)
- 18. 声网直播 (Agora Live)
- 19. 阿里直播 (Ali Live)
- 20. 阿里音视频 SDK美颜
- 三、对接说明 (Docking instructions)
- 四、常见问题(common problem)
- 2. 美颜无效果(Beauty has no effect)
- 3. 贴纸下载失败(Sticker download failed)
- 4. 点击无法出现美颜菜单页(The beauty menu page cannot appear after clicking)
- 5. 英文版显示中文(The beauty menu page cannot appear after clicking)
- 6. 语言切换功能(Language switching function)