AVFrameworkを使用してカメラフレームをキャプチャしています。それらを処理してUIImageViewに表示したいのですが、問題が発生しています。私はコードを持っています:
// Delegate routine that is called when a sample buffer was written
- (void)captureOutput:(AVCaptureOutput *)captureOutput didOutputSampleBuffer:(CMSampleBufferRef)sampleBuffer fromConnection:(AVCaptureConnection *)connection
{
//NSLog(@"Capturing\n");
// Create a UIImage from the sample buffer data
UIImage *image = [self imageFromSampleBuffer:sampleBuffer];
NSLog(@"Image: %f %f\n", image.size.height, image.size.width);
[imageView setImage:image];
}
ただし、表示されません。正しいサイズがに表示されますNSLog
。
[imageView setImage:[UIImage imageNamed:@"SomethingElse.png"]];
viewDidLoadでは、画像が正しく表示されます(したがって、UIImageViewが正しく接続されていることがわかります)。
これが機能しない理由はありますか?私は今途方に暮れています。
乾杯、ブレット