What's New in QuickTime 5
| Previous | Chapter Contents | Chapter Top | Next |
The Base Decompressor, which has been available since QuickTime 3.0, is designed to simplify the job of writing an Image Decompressor. It deals with the job of managing asynchronous scheduled decompression, manages the queue safely, and avoids synchronization issues.
In QuickTime 5, the Base Decompressor has been extended to simplify making an image decompressor component able to perform asynchronous decompression in a single MP task. The JPEG, H.263, Cinepak, and Video decompressors use this mechanism to run asynchronously. The H.263 compressor has been similarly modified to run asynchronously.
If you have a decompressor that uses the base codec, all you need to do to support the asynchronous MP mode is to implement the ImageCodecGetMPWorkFunction function.
Your implementation should call your base decompressor instance's ImageCodecGetBaseMPWorkFunction function, and pass to it a UPP for your DrawBand function:
pascal ComponentResult
ExampleCDGetMPWorkFunction(
ExampleSubDecompressorGlobals *storage,
ComponentMPWorkFunctionUPP *workFunction, void **refCon)
{
if( 0 == storage->drawBandUPP )
storage->drawBandUPP =
NewImageCodecMPDrawBandUPP( ExampleCDDrawBand);
return ImageCodecGetBaseMPWorkFunction(storage->delegateComponent,
workFunction, refCon,
storage->drawBandUPP, storage);
}If you implement the ImageCodecGetMPWorkFunction selector, your DrawBand function must be MP-safe. (MP safety is an even stricter condition than interrupt safety. As well as not calling routines that may move or purge memory, you may not make any calls which might cause 68K code to be executed. Ideally, your DrawBand function should not make any API calls whatsoever.)
What's New in QuickTime 5
| Previous | Chapter Contents | Chapter Top | Next |