我是新雨燕,我想调用函数CMCopyDictionaryOfAttachments
在(void)captureOutput:(AVCaptureOutput *)captureOutput didOutputSampleBuffer:(CMSampleBufferRef)sampleBuffer fromConnection:(AVCaptureConnection *)connection
代表我的如何CMSampleBuffer转换为CMAttachmentBearer在迅速
代码:
// MARK: Delegates
func captureOutput(captureOutput: AVCaptureOutput!, didOutputSampleBuffer sampleBuffer: CMSampleBuffer!, fromConnection connection: AVCaptureConnection!) {
// got an image
let pixelBuffer : CVPixelBufferRef = CMSampleBufferGetImageBuffer(sampleBuffer)
let attachments : CFDictionaryRef = CMCopyDictionaryOfAttachments(kCFAllocatorDefault, sampleBuffer, CMAttachmentMode(kCMAttachmentMode_ShouldPropagate)) as CFDictionaryRef!
}
这由Xcode中得到了一个错误:'CMSampleBuffer' is not identical to 'CMAttachmentBearer'
那么我怎样才能使用sampleBuffer作为目标,这个代码的作品,如果写在objective-c