title: Snow Leopard: 64-bit replacement for QuickTime API
body: <p>I'm migrating my movie player to 64-bit.</p>
  
  <p>At present it is capable of decoding movies with both QuickTime API and FFmpeg.</p>
  
  <p>To decode with QuickTime API I create a <code>QTOpenGLTextureContext</code> providing a <code>QTVisualContextRef</code> and then I obtain a decoded frame of type <code>CVOpenGLTextureRef</code> using <code>QTVisualContextCopyImageForTime</code>.</p>
  
  <p>Now I want to make my app 64-bit and therefore I can't use QuickTime API anymore because this functions aren't 64-bit.</p>
  
  <p>So I passed to QTKit and I started to decode frames using the method <code>frameImageAtTime:withAttributes:error:</code> which gives a decoded frame in various image format. At present I made it to return a <code>CVOpenGLTextureRef</code> in order to use all the actual structure of my display routine.
  The method actually works and I can get rid of the 32-bit <code>QTVisualContextRef</code>.</p>
  
  <p>The problem is that this method is tremendously SLOW!! It's not able to make a realtime playback of an Apple h264 movie trailer. It requires 4 times the time required by the old method to output the <code>CVOpenGLTextureRef</code>!</p>
  
  <p>I tried all of the other image type that <code>frameImageAtTime:withAttributes:error:</code> can handle in output, without success..it's even slower sometimes..</p>
  
  <p>The given attributes are:</p>
  
  <pre><code>[_imageAttr setObject:QTMovieFrameImageTypeCVOpenGLTextureRef forKey:QTMovieFrameImageType];
  [_imageAttr setObject:[NSValue valueWithPointer:[openGLContext CGLContextObj]] forKey:QTMovieFrameImageOpenGLContext];
  [_imageAttr setObject:[NSValue valueWithPointer:[openGLPixelFormat CGLPixelFormatObj]] forKey:QTMovieFrameImagePixelFormat];
  [_imageAttr setObject:[NSNumber numberWithBool:YES] forKey:QTMovieFrameImageSessionMode];
  [_imageAttr setObject:[NSNumber numberWithBool:YES] forKey:QTMovieFrameImageHighQuality];
  [_imageAttr setObject:[NSNumber numberWithBool:YES] forKey:QTMovieFrameImageDeinterlaceFields];
  </code></pre>
  
  <p>Which is the real replacement for the QuickTime API is 64-bit? Is there any?</p>
  
  <p>I can't change the main structure of the media player so I must obtain a <code>CVOpenGLTextureRef</code> or <code>CVPixelBufferRef</code> or <code>CIImage*</code></p>
  
  <p>I hope you can help me!</p>