title: Swift iOS AVSampleBufferDisplayLayer setting up the video layer
body: <p>I'm attempting to set up a video stream viewer in a Swift based project. </p>
  
  <p>I've reviewed the following (Objective C) which has been very helpful: <a href="https://stackoverflow.com/questions/26035380/how-avsamplebufferdisplaylayer-displays-h-264/26035381#26035381">How AVSampleBufferDisplayLayer displays H.264</a></p>
  
  <p>In a Swift context, I am having difficulty with the fact that the CMTimebaseCreateWithMasterClock requires the CMTimebase related element to be of type UnsafeMutablePointer. Would someone be able to explain how to convert to this and back to address the issue in the following code section.</p>
  
  <pre><code>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 &lt; Unmanaged &lt; CMTimebase &gt; ? &gt;)
  
  videoLayer.controlTimebase = controlTimebase 
  </code></pre>