Important: The information in this document is obsolete and should not be used for new development.
QuickTime 5 includes the addition of two new functions –– CanQuickTimeOpenFile
and CanQuickTimeOpenDataRef,
discussed in this section. The CanQuickTimeOpenFile call determines
whether QuickTime can open a given file or, in general, files of
a given type. The CanQuickTimeOpenDataRef call is similar to CanQuickTimeOpenFile except
that it uses a data reference instead of a file.
The input flags for CanQuickTimeOpenFile and CanQuickTimeOpenFileDataRef are
defined as follows:
enum { |
kQTDontUseDataToFindImporter = 1L << 0, |
kQTDontLookForMovieImporterIfGraphicsImporterFound = 1L << 1, |
kQTAllowOpeningStillImagesAsMovies = 1L << 2, |
kQTAllowImportersThatWouldCreateNewFile = 1L << 3, |
kQTAllowAggressiveImporters = 1L << 4 |
}; |
Determines whether the file could be opened using a graphics importer or opened in place as a movie.
CanQuickTimeOpenFile (FSSpecPtr fileSpec, OSType fileType, OSType fileNameExtension, Boolean * outCanOpenWithGraphicsImporter, Boolean * outCanOpenAsMovie, Boolean * outPreferGraphicsImporter, UInt32 inFlags);
Points to an FSSpec identifying the file in question. If you just want to ask about a particular file type and/or file name suffix in general, pass NULL.
Contains the file type if already known, or
0 if not known. If fileSpec is provided
and fileType is 0, QuickTime
will call the File Manager to determine the file type. If you pass
NULL in fileSpec and 0 in fileNameExtension,
you must pass a file type here.
Contains the file name suffix if already
known, or 0 if not known. The file name suffix should be encoded
as an uppercase four-character-code with trailing spaces; for instance,
the suffix ".png" should be encoded as 'PNG', or
0x504e4720. If fileSpec is
provided and fileNameExtension is
0, QuickTime will examine fileSpec to
determine the file name suffix. If you pass NULL in fileSpec and
0 in fileType, you must
pass a file name suffix here.
Points to a boolean which will be set to true if the file can be opened using a graphics importer and false otherwise. If you do not want this information, pass NULL.
Points to a boolean which will be set to true if the file can be opened as a movie and false otherwise. If you do not want this information, pass NULL.
Points to a boolean which will be set to true if the file can be opened using a graphics importer and opened as a movie, but, all other things being equal, QuickTime recommends using a graphics importer. For example, QuickTime would recommend using a graphics importer for single-frame GIF files and opening as a movie for multiple-frame GIF files.
If you do not want this information, pass NULL.
Passing
a non-NULL pointer disables the kQTDontUseDataToFindImporter and kQTDontLookForMovieImporterIfGraphicsImporterFound flags,
if set.
Specifies flags which modify search behavior. Pass 0 for default behavior.
Flags available are:
kQTDontUseDataToFindImporter
Tells QuickTime not to use the data in the file to help in the search. This will speed up the search, especially in cases where a negative result is returned, but it will cause QuickTime to report that it can not open files which aren’t identified by a recognized file type or file name suffix.
kQTDontLookForMovieImporterIfGraphicsImporterFoundTells QuickTime to short-circuit its search as soon as it finds one way to open the file. Pass this flag if you want to know whether a file can be opened with a graphics importer or as a movie, but you don’t care which.
kQTAllowOpeningStillImagesAsMoviesTells QuickTime to consider opening still images as movies. If this flag is set, if a file can be opened using a graphics importer QuickTime will automatically say it can be opened as a movie.
kQTAllowImportersThatWouldCreateNewFileTells QuickTime to include importers which would create new files. If this flag is clear, QuickTime only includes importers which can import in place without needing to create new files.
kQTAllowAggressiveImportersTells QuickTime to include movie importers for file types like PICT and TEXT which aren’t traditionally thought of as movies.
If this flag is clear, QuickTime excludes these movie importers.
The possible error
codes are paramErr and memFullErr.
CanQuickTimeOpenFile determines
whether QuickTime can open a given file or, in general, files of
a given type.
You should pass NULL in parameters that do not interest you, since that will allow QuickTime to perform a faster search.
Movies.h
Determines whether the data reference could be opened using a graphics importer or opened in place as a movie.
CanQuickTimeOpenDataRef (Handle dataRef, OSType dataRefType, Boolean * outCanOpenWithGraphicsImporter, Boolean * outCanOpenAsMovie, Boolean * outPreferGraphicsImporter, UInt32 inFlags);
Similar to CanQuickTimeOpenFile except
that it uses a data reference instead of a file.
Movies.h
Last updated: 2001-10-01