Skip to main content

MseqHookFunction

BoardSupported
Host SystemYes
V4L2Yes
Clarity UHDYes
Concord PoENo
GenTLYes
GevIQYes
GigE VisionYes
IndioNo
Iris GTXYes
Radient eV-CLYes
Rapixo CLYes
Rapixo CoFYes
Rapixo CXPYes
USB3 VisionYes

Hook a function to a sequence event.

Syntax

void MseqHookFunction(
AIL_ID ContextSeqId, //in
AIL_INT HookType, //in
AIL_SEQ_HOOK_FUNCTION_PTR HookHandlerPtr, //in
void * UserDataPtr //in-out
)

Description

This function allows you to attach or detach a user-defined function to a specified sequence event. Once a hook-handler function is defined and hooked to an event, it is automatically called when the event occurs.

You can hook more than one function to an event by making separate calls to MseqHookFunction for each function that you want to hook. Aurora Imaging Library automatically chains and keeps an internal list of all these hooked functions. When a function is hooked, this new function is added to the end of the list. When the event happens, all user-defined functions in the list will be executed in the same order that they were hooked to the event. You can also remove any function from the list; in this case, Aurora Imaging Library preserves the order of the remaining functions in the list.

You can obtain more information about the event from within the hook-handler function using MseqGetHookInfo.

Parameters

ContextSeqId (in, AIL_ID)

Specifies the identifier of the sequence context. The sequence context must have been previously allocated using MseqAlloc.

HookType (in, AIL_INT)

Specifies the sequence event to which to hook the function. This parameter can be set to one of the following values:

For specifying the sequence event to which to hook the function

ValueDescription
M_FRAME_ENDHooks the function to the event that occurs when a frame has finished being processed.

For the HookType parameter

ValueDescription
M_UNHOOKUnhooks the specified function if hooked to the specified event. When you use M_UNHOOK, you must provide the same values for all the parameters as when you originally hooked the function.

HookHandlerPtr (in, AIL_SEQ_HOOK_FUNCTION_PTR)

Specifies the address of the function that should be called when the specified event occurs.

UserDataPtr *(in-out, void)

Specifies the address of the user data that you want to make available to the hook-handler function. This address is passed to the hook-handler function, through its UserDataPtr parameter, when the specified event occurs. Set this parameter to M_NULL if not used.

Copyright © 2026 Zebra Technologies.