当前位置 : 主页 > 手机开发 > ios >

ios – 无需压缩即可捕获UIImage(来自CMSampleBufferRef)?

来源:互联网 收集:自由互联 发布时间:2021-06-11
我需要从CMSampleBufferRef中的未压缩图像数据中获取UI Image.我正在使用代码: captureStillImageOutput captureStillImageAsynchronouslyFromConnection:connection completionHandler:^(CMSampleBufferRef imageSampleBuffer, NSE
我需要从CMSampleBufferRef中的未压缩图像数据中获取UI Image.我正在使用代码:

captureStillImageOutput captureStillImageAsynchronouslyFromConnection:connection
 completionHandler:^(CMSampleBufferRef imageSampleBuffer, NSError *error) 
{
    // that famous function from Apple docs found on a lot of websites
    // does NOT work for still images
    UIImage *capturedImage = [self imageFromSampleBuffer:imageSampleBuffer]; 
}

http://developer.apple.com/library/ios/#qa/qa1702/_index.html是imageFromSampleBuffer函数的链接.

但它不能正常工作.

网友评论