我正在將我的電影播放器遷移到64位。Snow Leopard:QuickTime API的64位替代品
目前它能夠使用QuickTime API和FFmpeg解碼影片。
爲了用QuickTime解碼API創建一個QTOpenGLTextureContext
提供QTVisualContextRef
,然後我得到使用QTVisualContextCopyImageForTime
CVOpenGLTextureRef
類型的解碼的幀。
現在我想讓我的應用程序64位,因此我不能再使用QuickTime API,因爲這個功能不是64位。
所以我傳遞給QTKit,我開始使用方法frameImageAtTime:withAttributes:error:
解碼幀,它給出了各種圖像格式的解碼幀。目前我做了返回一個CVOpenGLTextureRef
爲了使用我的顯示程序的所有實際結構。 該方法實際工作,我可以擺脫32位QTVisualContextRef
。
問題是,這種方法是非常慢!它無法實時播放Apple h264電影預告片。它需要4倍於舊方法輸出CVOpenGLTextureRef
所需的時間!
我嘗試了所有其他圖像類型是frameImageAtTime:withAttributes:error:
可以輸出處理,而不success..it甚至有時慢..
給定的屬性有:
[_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];
哪個纔是真正的替代對於QuickTime API是64位?有沒有?
我不能改變媒體播放器的主體結構,所以我必須獲得CVOpenGLTextureRef
或CVPixelBufferRef
或CIImage*
我希望你能幫幫我!
我知道我可以使用AVFoundation,但該框架僅適用於Lion,我希望我的應用程序與Snow Leopard兼容 – Andrea3000