Creating Data Handler Components

This section describes the requirements for creating a data handler component. The functional interface that your component must support is described in Using Data Handler Components.

You should consider developing your own data handler component only if you are planning to provide a new type of movie container or a container that requires special data handling techniques. For example, if you are planning to develop a networked multimedia server, you would most likely need to develop a new data handler that could support the special protocols required by your server. By encapsulating that protocol support in a data handler, QuickTime applications can access the movie data on your server without having to implement any special support. In this way, your server becomes a seamless part of the user’s system.

Before reading this section, you should be familiar with how to create QuickTime components.

General Information

All data handler components have a component type value of 'dhlr', which is defined by the dataHandlerType constant. Data handler components use the value of the component subtype field to indicate the type of data reference they support. As a result of this convention, note that all data handlers that share a component subtype value must be able to recognize and work with data references of the same type. For example, file system data handlers always carry a component subtype value of 'alis', which indicates that their data references are file system aliases (note that this is true for QuickTime on Macintosh and under Windows, even though there is not, properly, a file system alias under Windows). Apple’s memory-based data handler for Macintosh has a component subtype value of 'hndl'.

#define dataHandlerType 'dhlr'
#define rAliasType      'alis'

Apple has not defined any special manufacturer field values or component flags values for data handler components. Developers may use the manufacturer field value to select your data handler from among all the data handlers that support a given type of data reference.

Apple has defined a functional interface for data handler components. You can use the following constants to refer to the request codes for each of the functions that your component must support:

enum {
    kDataHGetDataSelect        = 2,    /* DataHGetData */
    kDataHPutDataSelect        = 3,    /* DataHPutData */
    kDataHFlushDataSelect      = 4,    /* DataHFlushData */
    kDataHOpenForWriteSelect   = 5,    /* DataHOpenForWrite */
    kDataHCloseForWriteSelect  = 6,    /* DataHCloseForWrite */
    kDataHOpenForReadSelect    = 8,    /* DataHOpenForRead */
    kDataHCloseForReadSelect   = 9,    /* DataHCloseForRead */
    kDataHSetDatRefSelect      = 10,   /* DataHSetDataRef */
    kDataHGetDataRefSelect     = 11,   /* DataHGetDataRef */
    kDataHCompareDataRefSelect = 12,   /* DataHCompareDataRef */
    kDataHTaskSelect           = 13,   /* DataHTask */
    kDataHScheduleDataSelect   = 14,   /* DataHScheduleData */
    kDataHFinishDataSelect     = 15,   /* DataHFinishData */
    kDataHFlushCacheSelect     = 16,   /* DataHFlushCache */
    kDataHResolveDataRefSelect = 17,   /* DataHResolveDataRef */
    kDataHGetFileSizeSelect    = 18,   /* DataHGetFileSize */
    kDataHCanUseDataRefSelect  = 19,   /* DataHCanUseDataRef */
    kDataHGetVoumeListSelect   = 20,   /* DataHGetVolumeList */
    kDataHWriteSelect=         = 21,   /* DataHWrite */
    kDataHPreextendSelect      = 22,   /* DataHPreextend */
    kDataHSetFileSizeSelect    = 23,   /* DataHSetFileSize */
    kDataHGetFreeSpaceSelect   = 24,   /* DataHGetFreeSpace */
    kDataHCreateFileSelect     = 25,   /* DataHCreateFile */
    kDataHGetPreferredBlockSizeSelect = 26,
                                        /*DataHGetPreferredBlockSize */ 
    kDataHGetDeviceIndexSelect = 27,   /* DataHGetDeviceIndex */
    /* 28 and 29 unused */
    kDataHGetScheduleAheadTimeSelect= 30,
                                        /* DataHGetScheduleAheadTime */ 
    kDataHSetOSFileRefSelect   = 516,  /* DataHSetOSFileRef */
    kDataHGetOSFileRefSelect   = 517,  /* DataHGetOSFileRef */
    kDataHPlaybackHintsSelect  = 3+0x100/* DataHPlaybackHints */
};

Supported Functions

This section lists the functions that may be supported by data handler components.