Skip to content

ClassData Functions

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

setClassData

setClassData

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

ParameterTypeDescription
theClassUnsigned intThe class being set. Use a unique 4-byte code.
infoPointer or handlethe class data to be set. It can be used as a pointer or a handle.

getClassData

getClassData

Description

Retrieves the class data for the given class.

int getClassData (
unsigned int theClass);

Parameters

ParameterTypeDescription
theClassUnsigned integerThe class for which to retrieve data.