Sni*_*ten 3 iphone objective-c avfoundation
我尝试将样本缓冲区而不是UIImage保存到数组中,以便稍后进行转换.这样可以加快图像捕获速度,也可能无法获得内存警告.我只是无法弄清楚如何将它保存到数组然后再次使用它来调用[self imageFromSampleBuffer:sampleBuffer].我试过这样的东西,但是如何将数据转换回CMSampleBufferRef对象呢?
- (void)captureOutput:(AVCaptureOutput *)captureOutput
didOutputSampleBuffer:(CMSampleBufferRef)sampleBuffer
fromConnection:(AVCaptureConnection *)connection {
// Create a UIImage from the sample buffer data
// UIImage *image = [self imageFromSampleBuffer:sampleBuffer];
// [arrCaptures addObject:image];
[arrImageBuffer addObject:[NSData dataWithBytes:sampleBuffer length:sizeof(sampleBuffer)] ];}
Run Code Online (Sandbox Code Playgroud)
小智 5
为什么不直接使用CFArray并将CMSampleBufferRef对象放在那里?
归档时间: |
|
查看次数: |
2562 次 |
最近记录: |