|
OverviewFor maximum performance, video decompressor components should be marked as multi-buffer aware by setting the By setting this flag, the decompressor informs the Image Compression Manager that it is able to draw each frame to a new pixel buffer. This contract with the Image Compression Manager reduces the amount of buffer copies necessary to play through Core Video. What You Need To DoIn your image decompressor's Listing 1: ImageCodecInitialize function. ComponentResult MyDecompressor_Initialize(MyDecompressorGlobals *storage, ImageSubCodecDecompressCapabilities *cap) { // Specify the size of the ImageSubCodecDecompressRecord structure cap->decompressRecordSize = sizeof(MyDecompressRecord); // Say we can support asynchronous decompression - With the help of the base // image decompressor, any image decompressor that uses only interrupt-safe // calls for decompression operations can support asynchronous decompression cap->canAsync = true; // set other capabilities as appropriate . . . // subCodecIsMultiBufferAware added in QuickTime 7 // tell the base codec that we are "multi-buffer aware" - This promises that we // always draw using ImageSubCodecDecompressRecord.baseAddr/rowBytes // passed to our ImageCodecDrawBand function, and that we always overwrite every // pixel in the buffer - it is important to set this in order to get optimal // performance when playing through Core Video // // add this line of code cap->subCodecIsMultiBufferAware = true; . . . } By setting this flag, a decompressor MUST honor a contract with the Image Compression Manager and be able to do the following:
Decompressors that do not set this flag will use a compatibility mode which involves an extra buffer copy per frame when playing to a multi-buffer destination through Core Video. Some old decompressors (particularly those that do not perform motion compensation), do not write every pixel of difference frames, relying on the old pixels staying present. These decompressors should NOT set the Compatibility NotesWhile Sample CodeThe ExampleIPBCodec sample demonstrates modern (QuickTime 7 and greater) techniques for writing both Image Compressors and Decompressors. Document Revision History
Posted: 2005-07-12 |
|