What's New in QuickTime 5
| Previous | Chapter Contents | Chapter Top | Next |
QuickTime has added two new APIs that help applications specify the codec or effects components that they prefer to use when playing a movie. This supplements the normal behavior of relying on performance and compatibility as the criteria for choosing the codecs to be used.
Applications can use these APIs to access components that all work together as a set (for example, decompressors and effects all working on the same hardware).
Third-party codec providers no longer need to use decompression speed as the only way to have their codecs used in preference -- the application is now able to specify the ones it prefers. Note that applications that don't use these APIs will continue to rely on the normal behavior of the ICM.
Requests that a media handler favor specified codec components when selecting components with which to play media.
pascal ComponentResult MediaSetUserPreferredCodecs( MediaHandler mh, CodecComponentHandle
userPreferredCodecs );This method does not guarantee that the specified components will be used; other factors may take precedence. Components that are preferred may not be used if they can't be part of the chain required to play the media (for example, don't handle the pixel format, or the video output, and so on).
The components should be specified in order from most preferred to least preferred.
CodecComponentHandle userPreferredCodecs = nil;
ComponentDescription cd = { decompressorComponentType,
myPreferredCodecType,
myPreferredCodecManufacturer,
0, 0 };
CodecComponent c = FindNextComponent( 0, &cd );
MediaHandler myMedia;
OSErr err;
PtrToHand( &c, (Handle*)&userPreferredCodecs, sizeof(c) );
myMedia = GetMediaHandler( GetTrackMedia( track ) );
err = MediaSetUserPreferredCodecs( myMedia, userPreferredCodecs );
DisposeHandle( (Handle)userPreferredCodecs );Retrieves the list of components last passed to the media handler with MediaSetUserPreferredCodecs .
pascal ComponentResult MediaGetUserPreferredCodecs( MediaHandler mh, CodecComponentHandle
*userPreferredCodecs );What's New in QuickTime 5
| Previous | Chapter Contents | Chapter Top | Next |