MultiCam Boards Documentation > MultiCam Documentation > MultiCam User Guide > MultiCam Basics > Signaling > Callback Signaling > Callback Signaling Information

Callback Signaling Information

Callback Function Prototype

The callback function prototype is declared in the MultiCam system's MultiCam.h header file as follows:

typedef void (MCAPI *PMCCALLBACK)(PMCSIGNALINFO SignalInfo);

Item

Type

Description

Function

PMCCALLBACK

Callback function

SignalInfo

PMCSIGNALINFO

Argument providing the signal information structure.

The user should define the callback function in the application code in accordance with this prototype.

The callback function is called by the MultiCam driver when a channel or a processor issues a pre-defined signal.

The pre-defined signal should be enabled with the SignalEnable parameter. It is allowed to enable several signals.

If more than one enabled signals are issued simultaneously from an object, the callback function is successively called for each signal occurrence.

When the signal occurs, the callback dedicated thread is released, and the callback function is automatically invoked. The thread is restored to an idle condition when the callback function is exited.

The function has a single argument, which is a structure passing information on the signal that caused the callback function. This structure has the signal information type.

If the callback signaling mechanism is used, the waiting and advanced signaling mechanisms cannot be used.

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: McRegisterCallback.

Context

Context is an argument of the callback registration function as well as a member of the signal information structure available to the callback function.

The user is free to use this item at the registration time to hold any identifying information he may find useful.

When the callback function is executed, the user gets back the context information as it was passed to the registration function.