我想使用AVFoundation框架从AVCaptureStillImageOutput快速捕获一系列静止图像,就像某些相机的突发模式。我想使用完成处理程序,保存CMSampleBufferRef供以后处理
[stillImageOutput captureStillImageAsynchronouslyFromConnection:videoConnection
completionHandler: ^(CMSampleBufferRef imageSampleBuffer, NSError *error) {
并将imageSampleBuffer传递给NSOperation对象以供以后处理。但我无法找到一种方法来保留NSOperation类中的缓冲区。
[stillImageOutput captureStillImageAsynchronouslyFromConnection:videoConnection
completionHandler: ^(CMSampleBufferRef imageSampleBuffer, NSError *error) {
//Add to queue
SaveImageDataOperation *saveOperation = [[SaveImageDataOperation alloc] initWithImageBuffer:imageSampleBuffer];
[_saveDataQueue addOperation:saveOperation];
[saveOperation release];
//Continue
[self captureCompleted];
}];
有没有人知道我在这里做错了什么?有没有更好的方法来做到这一点?