| Log In | Not a Member? |
Contact ADC
|
|
Finding Movie Export ComponentsDispatch 6If you have code that must open a particular QuickTime export component to perform some operation, you should be as specific as possible in the ComponentDescription you use to find the component. In the past, developers using an earlier version of QuickTime put code in their applications to find a particular component only to find that a later version of QuickTime added a new export component that also met the conditions for which they searched. In particular, developers had added code to find the export component that expected a sound track and output an AIFF file. QuickTime registered this component using the following type/subtype/manufacturer: componentType - MovieExportType componentSubType - kQTFileTypeAIFF componentManufacturer - SoundMediaType In searching for this component, the developers had used a
ComponentDescription like the following with
ComponentDescription looking; Component foundComponent = 0; looking.componentType = MovieExportType; looking.componentSubType = kQTFileTypeAIFF; looking.componentManufacturer = 0; looking.componentFlags = 0; looking.componentFlagsMask = 0; foundComponent = FindNextComponent( 0, &looking ); ... use the component ... The componentManufacturer is set to 0 meaning that any value is allowed for the componentManufacturer field. This worked fine until QuickTime added the Music track to AIFF exporter. This new exporter was registered using the settings shown next: componentType - MovieExportType componentSubType - kQTFileTypeAIFF componentManufacturer - MusicMediaType When the above developer code ran with the newer version of QuickTime, it found the new component instead of the one expected. Not surprisingly, this wasn't expected. This could have been addressed earlier by being more specific in setting up the looking ComponentDescription. Above, if the line that set looking.componentManufacturer field was changed to: looking.componentManufacter = SoundMediaType; things would have worked from the beginning. How Export Components are registeredBefore QuickTime 3.0, export components were registered according to the following rules:
Among other things, the subtype
and manufacturer information is used by QuickTime to build the
list of export formats available in the
A problem with this registration mechanism is that it isn't possible to have more than one export component registered for a particular file type and for the same track type (or 0 if not track specific). So, it's possible to have one exporter that exports from a sound track to a AIFF file but not two. With QuickTime 3.0, a change was made to overcome this limitation.
Now, the componentManufacturer field can be assigned a unique OSType
that is neither a media handler type nor 0. If this is done, the
componentFlags field must have the
With this change, it is now possible to implement multiple export
components that export to the same file type. QuickTime transparently
handles finding components registered using either the older
mechanism or the newer mechanism. In general, this should cause no
problem for developers using Finding the QuickTime Movie and DV Export ComponentOnly two exporters shipping with QuickTime 3.0 use the new registration mechanism. In both cases, these are new exporters so will cause no compatibility problems for applications based upon earlier releases of QuickTime. All other export components are registered as they were before. The first component is the Movie to QuickTime Movie export component. It is registered using: componentType - MovieExportType componentSubType - MovieFileType componentManufacturer - kAppleManufacturer componentFlags - movieExportMustGetSourceMediaType and others The second is the DV export component and is registered using: componentType - MovieExportType componentSubType - kQTFileTypeDVC componentManufacturer - kAppleManufacturer componentFlags - movieExportMustGetSourceMediaType and others Applications that search for these components should search for these using the above information. As an example, to find the DV export component, you could use: looking.componentType = MovieExportType; looking.componentSubType = kQTFileTypeDVC; looking.componentManufacturer = kAppleManufacturer; looking.componentFlags = movieExportMustGetSourceMediaType; looking.componentFlagsMask = movieExportMustGetSourceMediaType; By setting the flags and flags mask to be movieExportMustGetSourceMediaType, this will only find the component that also has this bit set. This isn't strictly necessary but doesn't hurt. Where else is this used?Besides the newly added QuickTime movie export component, there are other export components available that use this registration mechanism. Specifically, there are a few QuickTime VR specific movie export components that also export QuickTime movie files (MovieFileType). Without the new way to register exporters, these components would have to set their componentSubTypes to something other than MovieFileType and there would be no way to know that these files export to movie files. By employing the new regisration mechanism, they can instead set their componentSubTypes to MovieFileType and change the manufacturer for each different component. Finding all the components that export to QuickTime movie files can be done easily like this:
See AlsoQuickTime 3 Reference - New registration mechanism Modification History4/16/98 - clf - First published |
|
Topics Previous | Next |