QuickTime 7 introduces a replacement––NewMovieFromProperties–– for NewMovie, NewMovieFromDataRef,
and all other NewMovieFrom... functions.
In previous versions of QuickTime, you could use other functions
that create new movies, including NewMovieFromFile and NewMovieFromDataRef.
These functions accept flags that allow you to set some movie characteristics
at creation time, but other movie characteristics are always set
by default. For example, there must be a valid graphics port associated
with a movie created by these functions, even if the movie does
not output video.
NewMovieFromProperties allows you to
configure an extensible set of properties before creating a movie.
This has a number of advantages.
You can open a movie with exactly the properties you want, preventing QuickTime from taking undesired default actions.
You can also specify properties that the older functions do not know about, such as a visual context for the movie.
To instantiate a movie using NewMovieFromProperties,
follow these steps:
Pass in a CFString file path, a URL, or set up
a data reference, just as you would for NewMovieFromDataRef or
one of the other NewMovieFrom_ functions.
Next, set up a visual context for the movie to use by calling
a function that creates a context of a the desired type, such as QTOpenGLTextureContextCreate.
Similarly, you can set up an audio context if you want a device
other than the default device.
Call NewMovieFromProperties, passing in the
data reference for the movie and the QTVisualContextRef for
the visual context, plus any appropriate properties listed in the QTNewMoviePropertyArray.
Properties are passed in using a QTNewMoviePropertyElement struct,
which specifies the property class and property ID of each property.
The movie will automatically retain the visual context, so if your application does not need to work with the context directly, you may release it now.
For additional details, see:
QTNewMoviePropertyArray
Last updated: 2005-04-29