Registration of Callback Function
A callback function should be registered to a channel or processor object before use. Only one callback function per object is supported.
Registering the callback function results into the creation in the application process of a separate thread dedicated to the callback function. This thread is maintained in a idle state until a signal occurs. There can be only one dedicated thread per channel or processor object.
A dedicated MultiCam function is provided for callback registration called McRegisterCallback. Here is the prototype.
MCSTATUS McRegisterCallback (
MCHANDLE Instance,
PMCCALLBACK CallBackFunction,
PVOID Context
);
Item |
Type |
Description |
McRegisterCallback |
MCSTATUS |
MultiCam API function. |
Instance |
MCHANDLE |
Argument designating the channel or processor object to which the callback function is to be registered. |
CallbackFunction |
PMCCALLBACK |
Argument pointing to the callback function defined by the user.If NULL, the callback function is removed from the specified object (un-registration). |
Context |
PVOID |
Argument allowing for passing a user-defined value to the callback function. |
Return Value |
MCSTATUS |
MC_OK or error code. |