ClassData Functions
ClassData Functions
Section titled “ClassData Functions”All plugin types that support media can use these callbacks to share information associated with their classID.
For example, these plugins can confirm their hardware is present and operational using the ClassData functions.
They all call getClassData
during initialization. If getClassData
returns 0, the module checks for and initialize the hardware.
It then calls setClassData to store information about the current context. Use handles, not pointers, for storing info.
typedef struct { SetClassDataFunc setClassData; GetClassDataFunc getClassData;} ClassDataFuncs, *ClassDataFuncsPtr;
Methods
Section titled “Methods”setClassData
Section titled “setClassData”setClassData
Description
Section titled “Description”Writes class data, destroys previous data.
Note that all plugins that share the data must use the same data structure.
int setClassData ( unsigned int theClass, void *info);
Parameters
Section titled “Parameters”Parameter | Type | Description |
---|---|---|
theClass | Unsigned int | The class being set. Use a unique 4-byte code. |
info | Pointer or handle | the class data to be set. It can be used as a pointer or a handle. |
getClassData
Section titled “getClassData”getClassData
Description
Section titled “Description”Retrieves the class data for the given class.
int getClassData ( unsigned int theClass);
Parameters
Section titled “Parameters”Parameter | Type | Description |
---|---|---|
theClass | Unsigned integer | The class for which to retrieve data. |