运行以下代码
var sampleData = NSMutableArray()
for var i = sampleData.count-1 ; i >= 0 ; i-- {
let presentationTime : CMTime = CMSampleBufferGetPresentationTimeStamp(sampleData[i] as! CMSampleBuffer)
let imageBufferRef : CVPixelBufferRef = CMSampleBufferGetImageBuffer(sampleData[sampleData.count - i - 1] as! CMSampleBuffer)!
while (!writerInput.readyForMoreMediaData) {
NSThread.sleepForTimeInterval(0.1)
}
pixelBufferAdaptor.appendPixelBuffer(imageBufferRef, withPresentationTime: presentationTime)
}
产生以下错误:
objc[1670]: _objc_rootFinalize called with garbage collection off
Printing description of imageBufferRef:
(CVPixelBufferRef) imageBufferRef = out of scope
Printing description of presentationTime:
(CMTime) presentationTime = out of scope