2
我試圖在基於Swift的項目中設置視頻流查看器。Swift iOS AVSampleBufferDisplayLayer設置視頻圖層
我查看以下(目標C),這非常有幫助:How AVSampleBufferDisplayLayer displays H.264
在斯威夫特方面,我有該CMTimebaseCreateWithMasterClock需要CMTimebase相關元素爲類型UnsafeMutablePointer事實難度。有人能夠解釋如何轉換爲此並返回以解決以下代碼部分中的問題。
var controlTimebase : CMTimebase
var myAllocator : CFAllocator!
CMTimebaseCreateWithMasterClock(myAllocator, CMClockGetHostTimeClock(), CMTimebase)
// Problem is here...below is the expected format.
//CMTimebaseCreateWithMasterClock(allocator: CFAllocator!, masterClock: CMClock!, timebaseOut: UnsafeMutablePointer < Unmanaged <CMTimebase> ? >)
videoLayer.controlTimebase = controlTimebase