Callback Signaling Mechanism
The callback mechanism implies an event driven behavior. The following description uses the Surface Processing signal as an example of callback generating event.
The Surface Processing signal occurs when a transfer phase terminates. It is issued by a channel to indicate that the destination memory surface has been filled with an image coming from the source camera, and that this surface is available for image processing (see SurfaceState).
The image processing task is performed on this event by a special function called the callback function.
Callback mechanism
The callback function is called by the MultiCam driver, not by the user application. This ensures that the image-processing task is realized at the ideal instant, exactly when the surface becomes ready for processing.
MultiCam benefits from several built-in features to ease the implementation of the callback function.
- A dedicated thread is created for the callback function execution.
- The callback function prototype is declared in the MultiCam system C header file.
- Means are provided to designate the channel and the signal(s) issuing the callback function calls.
- The callback function argument provides all relevant information to the user-written code.
The MultiCam function to register a callback function to a channel or a processor is McRegisterCallback.