2011-09-17 60 views
1

我正在將我的電影播放器​​遷移到64位。Snow Leopard:QuickTime API的64位替代品

目前它能夠使用QuickTime API和FFmpeg解碼影片。

爲了用QuickTime解碼API創建一個QTOpenGLTextureContext提供QTVisualContextRef,然後我得到使用QTVisualContextCopyImageForTimeCVOpenGLTextureRef類型的解碼的幀。

現在我想讓我的應用程序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位?有沒有?

我不能改變媒體播放器的主體結構,所以我必須獲得CVOpenGLTextureRefCVPixelBufferRefCIImage*

我希望你能幫幫我!

+0

我知道我可以使用AVFoundation,但該框架僅適用於Lion,我希望我的應用程序與Snow Leopard兼容 – Andrea3000

回答

1

QuickTime的替換是AVFoundation。它可能暫時不包含你所需要的全部,但這是未來。

+0

我很害怕這樣.. 我會搬到獅子然後..非常感謝你很多;-) – Andrea3000