CMSampleBufferRef转CIImage

来源:互联网 发布:宇宙人餐饮软件 编辑:程序博客网 时间:2024/04/30 20:08

CMSampleBufferRef  sampleBuffer;

CVPixelBufferRef pixelBuffer = CMSampleBufferGetImageBuffer(sampleBuffer);

CFDictionaryRef attachments = CMCopyDictionaryOfAttachments(kCFAllocatorDefault, sampleBuffer, kCMAttachmentMode_ShouldPropagate);

CIImage *convertedImage = [[CIImage alloc] initWithCVPixelBuffer:pixelBuffer options:(__bridge NSDictionary *)attachments];

0 0
原创粉丝点击