AVFoundation没有获取样本缓冲区

时间:2015-07-17 18:49:16

标签: objective-c macos avfoundation

我正在尝试从样本缓冲区中获取图像,但该方法甚至没有触发。我做错了吗?

    - (void)captureOutput:(AVCaptureOutput *)captureOutput didOutputSampleBuffer:(CMSampleBufferRef)sampleBuffer
   fromConnection:(AVCaptureConnection *)connection {


NSLog(@"Sample Buffered");
CVImageBufferRef imageBuffer = CMSampleBufferGetImageBuffer(sampleBuffer);
IOSurfaceRef surface = CVPixelBufferGetIOSurface(imageBuffer);
CIImage* ciImage = [[CIImage alloc] initWithIOSurface:surface];
}

0 个答案:

没有答案