カメラ用に AVFoundation を使用する iPhone アプリを作成しており、カメラの UIImage をカメラ ロールに保存しようとしています。
現在、このようにしています...
[imageCaptureOutput captureStillImageAsynchronouslyFromConnection:[imageCaptureOutput.connections objectAtIndex:0]
completionHandler:^(CMSampleBufferRef imageDataSampleBuffer, NSError *error)
{
if (imageDataSampleBuffer != NULL)
{
NSData *imageData = [AVCaptureStillImageOutput jpegStillImageNSDataRepresentation:imageDataSampleBuffer];
UIImage *image = [[UIImage alloc] initWithData:imageData];
MyCameraAppDelegate *delegate = [[UIApplication sharedApplication] delegate];
[delegate processImage:image];
}
}];
私は WWDC チュートリアル ビデオを見てきましたが、2 行 (NSData... と UIImage...) は imageDataSampleBuffer から UIImage への長い道のりだと思います。
画像をライブラリに保存するのに時間がかかりすぎるようです。
これからUIImageを取得するための1行の遷移があるかどうかは誰にも分かりますか?
助けてくれてありがとう!
オリバー