Retired Document
Important: This document may not represent best practices for current development. Links to downloads and other resources may no longer be valid.
About Data Handler Components
A data handler component stores and retrieves time-based data on a storage device, such as a movie file, on behalf of another QuickTime component, typically a media handler component or a sequence grabber component. Different QuickTime components are used depending on whether you are retrieving or storing data.
Movie Playback
During data retrieval, such as playback of a movie, a media handler component isolates your application and the Movie Toolbox from the details of how to retrieve data from a particular storage medium. Therefore, unless you are writing your own media handler, you do not have to directly use data handler components in your application; the retrieval of your data will be taken care of for you by the media handler the Movie Toolbox calls. However, you can call the data handler directly if you need to explicitly tell the data handler something, such as to use less memory when caching QuickTime data. If you are reading from a non-Macintosh storage medium, or multiple storage media, you might need to write your own data handler.
Movie Capture
During data storage, such as the capture of video and sound into a movie file, a a sequence grabber component isolates your application from the details of how to capture the raw data from a particular device. Therefore, during movie capture you do not have to directly use data handler components in your application. The storage of your data will be taken care of for you by the sequence grabber component you call. If, however, you are storing data onto a non-Macintosh or proprietary storage medium, or multiple storage media, you might need to write your own data handler.
The sequence grabber component calls the appropriate channel component, such as a video, sound, or text channel component, to retrieve the raw data from an input device, such as a microphone.
Processing data
Data handlers do not know anything about the content of the data they process. It is the responsibility of the client (that is, a media handler component or a channel component) to process the data. In the case of a movie’s video data during movie playback, for example, the media handler takes the data from a data handler and uses the facilities of the Image Compression Manager to display the movie data on the computer screen.
While data handlers do not work with the content of the data they process, they must be aware of all of the details involved in storing and retrieving data from the storage medium they support. Apple provides several data handlers and a selection mechanism for choosing an appropriate handler. For example, one supports data access from HFS volumes and another supports the memory-based data handler, which allows QuickTime to retrieve movies from memory handles. These two data handler components use very different mechanisms to store and retrieve movie data.
You might need to write your own data handler when you are accessing a storage medium for which there is no Apple-supplied data handler or when playing movies from a multimedia server, as you will need to use a data handler that understands the network protocols and data formats necessary to communicate with that server.
Identifying Containers With Data References
A container is the system element that contains the movie data and can be any element that can contain data. For example, a container may be an in-memory data structure, a local disk file, or a file on a networked multimedia server. As is the case throughout QuickTime, all data handlers identify their movie-data containers with data references. Data references identify the location of the container and its type.
Different container types may require different types of references. For example, files are identified using aliases, while memory-based movies are identified by handles. The data reference data type is flexible enough to accommodate all these cases. The data handler component must specify the type of reference it requires and verify that the references supplied by client applications are valid. Data handler components use the component subtype value to specify the reference type they support.
Whenever an application opens a container, the Movie Toolbox determines the most appropriate data handler component to use in order to access that container. The Movie Toolbox makes this determination by querying the various data handlers installed on the user’s computer. If your application uses the Movie Toolbox, this selection process is transparent to your program. If you develop your own data handler, your component must support the selection functions.
Copyright © 2005, 2006 Apple Computer, Inc. All Rights Reserved. Terms of Use | Privacy Policy | Updated: 2006-01-10