Image Manager (CVCDriver.dll) 14.0

Interface for being notified when a driver event happened. More...

Typedefs

typedef void __stdcall * CVBDRIVER_NOTIFY_CB(CVNotifyEvent_t EventID, void *Buf, size_t Size, CVNotifyDatatype_t DataType, void *UserData)
 Callback function which is called with INotify related events.

This function can be registered by the NORegister function to get notifications. More...
 
typedef cvbval_t CVNotifyDatatype_t
 Defines the datatype for the INotify data. See CVNotifyDatatypes for possible types. More...
 
typedef cvbval_t CVNotifyEvent_t
 Defines the data type/IDs for the INotify events. See CVNotifyEventIDs for possible types. More...
 
typedef cvbval_t CVNotifyInfo_t
 Defines the data type for the INotify information. See CVNotifyInfoCmd for possible information commands. More...
 

Enumerations

enum  CVNotifyDatatypes {
  CVNO_DATA_VOID = -1 , CVNO_DATA_INTEGER64 = 0 , CVNO_DATA_FLOAT64 , CVNO_DATA_STRING ,
  CVNO_DATA_BINARY , CVNO_DATA_BOOL8 , CVNO_DATA_CUSTOM = 0x10000
}
 Defines the Notify data types. More...
 
enum  CVNotifyEventIDs {
  CVNO_REGISTRATION_INVALID = 0 , CVNO_EID_ERROR = 1 , CVNO_EID_DEVICE_DISCONNECTED = 2 , CVNO_EID_DEVICE_RECONNECT = 3 ,
  CVNO_EID_GEOMETRY_CHANGE = 4 , CVNO_EID_METADATA_CHANGE = 5 , CVNO_EID_CUSTOM = 0x10000
}
 An EventID references a single event source.

It is a number. The numbers below 0x1000 have a globally defined meaning. The numbers above are driver implementation private and may have other meanings with other sources. More...
 
enum  CVNotifyInfoCmd { CVNO_INFO_COUNT_REGISTERED , CVNO_INFO_COUNT_FIRED , CVNO_INFO_IS_AVAILABLE , NO_INFO_CUSTOM_CMD = 0x10000 }
 Defines the command for getting an information from the Notify interface. More...
 

Functions

cvbbool_t CanNotify (IMG Image)
 This function verifies whether the image supports the INotify interface. More...
 
cvbres_t NOGetDescription (IMG Image, size_t Index, char *DescriptiveName, size_t &Size, CVNotifyEvent_t &EventID)
 Inquire a readable description (name) and the event ID for a given Index. More...
 
cvbres_t NOGetNumSupported (IMG Image, size_t &NumEvents)
 Iniquire the number of supported event sources. More...
 
cvbres_t NOGetStatus (IMG Image, CVNotifyEvent_t eventID, CVNotifyInfo_t StatusCmd, cvbint64_t &Info)
 Inquire additional information on an event source. More...
 
cvbres_t NOIsCookieValid (IMG Image, intptr_t Cookie, cvbbool_t &IsValid)
 Inquire if a given Cookie is still referring to a registered callback. More...
 
cvbres_t NORegister (IMG Image, CVNotifyEvent_t EventID, CVBDRIVER_NOTIFY_CB pCB, void *UserData, intptr_t &Cookie)
 Register a callback for one (or more) events. More...
 
cvbres_t NOUnregister (IMG Image, intptr_t Cookie)
 Unregister a callback. More...
 

Detailed Description

Interface for being notified when a driver event happened.

Typedef Documentation

◆ CVBDRIVER_NOTIFY_CB

typedef void __stdcall * CVBDRIVER_NOTIFY_CB(CVNotifyEvent_t EventID, void *Buf, size_t Size, CVNotifyDatatype_t DataType, void *UserData)

Callback function which is called with INotify related events.

This function can be registered by the NORegister function to get notifications.

Attention
The list below descripes the specific constant declarations and typedefs. There are declared in the header file iCVCDriver.h .
Parameters
[in]EventIDID identifying a single event source.
[in]BufDatabuffer associated with that event.
[in]SizeSize of Buf in bytes.
[in]DataTypeDatatype (see CVNotifyDatatype_t for more information).
[in]UserDataPointer to private data provided at callback registration with NORegister.
Supported platforms:
Win32
Win64
Linux
Examples:
Visual C++ - VC Movie2 Player Example CSharp - C# Movie2 Player Example
Sample Code in Visual C++:
void CVCMovie2PlayerExampleDlg::ImageUpdatedCvimagectrl1()
{
if(CanNotify((IMG)m_cvImg.GetImage()))
{
// Check If MetaData is available in the video file. If yes Register the MetaDataAvailable callback
// If no Output message in StatusUserText.
__int64 info;
HRESULT res = NOGetStatus((IMG)m_cvImg.GetImage(),
info);
if(info == 1)
res = NORegister((IMG)m_cvImg.GetImage(),
&CVCMovie2PlayerExampleDlg::MetaDataAvailable,
this,
m_MetaDataAvailableCallbackCookie);
else
m_cvDisp.SetStatusUserText("No MetaData available");
}
}
void CALLBACK CVCMovie2PlayerExampleDlg::MetaDataAvailable( CVNotifyEvent_t EventID, void *Buf, size_t Size,
CVNotifyDatatype_t DataType, void *UserData)
{
CVCMovie2PlayerExampleDlg* dlg = reinterpret_cast<CVCMovie2PlayerExampleDlg*>(UserData);
dlg->m_cvDisp.SetStatusUserText(reinterpret_cast<char*>(Buf));
}
cvbres_t NOGetStatus(IMG Image, CVNotifyEvent_t eventID, CVNotifyInfo_t StatusCmd, cvbint64_t &Info)
Inquire additional information on an event source.
Definition: NotifyExports.cpp:208
cvbbool_t CanNotify(IMG Image)
This function verifies whether the image supports the INotify interface.
Definition: NotifyExports.cpp:39
cvbres_t NORegister(IMG Image, CVNotifyEvent_t EventID, CVBDRIVER_NOTIFY_CB pCB, void *UserData, intptr_t &Cookie)
Register a callback for one (or more) events.
Definition: NotifyExports.cpp:75
cvbval_t CVNotifyEvent_t
Defines the data type/IDs for the INotify events. See CVNotifyEventIDs for possible types.
Definition: CVTypesDriver.h:237
cvbval_t CVNotifyDatatype_t
Defines the datatype for the INotify data. See CVNotifyDatatypes for possible types.
Definition: CVTypesDriver.h:202
@ CVNO_INFO_IS_AVAILABLE
Availability of the event at the time of the status inquiry.
Definition: CVTypesDriver.h:157
@ CVNO_EID_METADATA_CHANGE
New metadata available. The metadata is provided as string int the provided buffer of the callback.
Definition: CVTypesDriver.h:226
Sample Code in CSharp:
private void m_cvImage_ImageUpdated(object sender, EventArgs e)
{
if (Cvb.Driver.INotify.CanNotify(m_cvImage.Image))
{
// Check If MetaData is available in the video file. If yes Register the MetaDataAvailable callback
// If no Output message in StatusUserText.
Cvb.Driver.INotify.NOGetStatus(m_cvImage.Image,
Cvb.Driver.INotify.CVNotifyEventID.METADATA_CHANGE,
Cvb.Driver.INotify.CVNotifyInfoCmd.IS_AVAILABLE,
out info);
if (info == 1)
Cvb.Driver.INotify.NORegister(m_cvImage.Image,
Cvb.Driver.INotify.CVNotifyEventID.METADATA_CHANGE,
MetaDataChangedDelegate,
this.Handle,
out m_MetaDataCallbackCookie);
else
_MetaDataTextBox.Text = "No MetaData available";
}
}
private delegate void MetaDataDelegate();
public void MetaDataChanged_Event(Cvb.Driver.INotify.CVNotifyEventID eventID,IntPtr buffer,
int Size,Cvb.Driver.INotify.CVNotifyDataType DataType,IntPtr UserData)
{
if (DataType == Cvb.Driver.INotify.CVNotifyDataType.STRING)
{
Form1 mainForm = (Form1)Control.FromHandle(UserData);
string myString = System.Runtime.InteropServices.Marshal.PtrToStringAnsi(buffer);
// note: the MetaDataChanged Callback is most likely raised in a thread
// context *different* from the user interface thread and there-
// fore the user interface should not be influenced directly when
// processing this event, but rather through BeginInvoke
this.BeginInvoke(new MetaDataDelegate(delegate()
{
// Add Information to the Display UserText
mainForm._MetaDataTextBox.Text = myString;
}));
}
}

◆ CVNotifyDatatype_t

typedef cvbval_t CVNotifyDatatype_t

Defines the datatype for the INotify data. See CVNotifyDatatypes for possible types.

Attention
The list below descripes the specific constant declarations and typedefs. There are declared in the header file iCVCDriver.* .

◆ CVNotifyEvent_t

typedef cvbval_t CVNotifyEvent_t

Defines the data type/IDs for the INotify events. See CVNotifyEventIDs for possible types.

Attention
The list below descripes the specific constant declarations and typedefs. There are declared in the header file iCVCDriver.* .

◆ CVNotifyInfo_t

typedef cvbval_t CVNotifyInfo_t

Defines the data type for the INotify information. See CVNotifyInfoCmd for possible information commands.

Attention
The list below descripes the specific constant declarations and typedefs. There are declared in the header file iCVCDriver.* .

Enumeration Type Documentation

◆ CVNotifyDatatypes

Defines the Notify data types.

Attention
The list below descripes the specific constant declarations and typedefs. There are declared in the header file iCVCDriver.* .
Enumerator
CVNO_DATA_VOID 

Void data.

CVNO_DATA_INTEGER64 

64-bit integer.

CVNO_DATA_FLOAT64 

64-bit floating-point value.

CVNO_DATA_STRING 

String value.

CVNO_DATA_BINARY 

Binary data.

CVNO_DATA_BOOL8 

8-bit bool data.

CVNO_DATA_CUSTOM 

Custom data.

◆ CVNotifyEventIDs

An EventID references a single event source.

It is a number. The numbers below 0x1000 have a globally defined meaning. The numbers above are driver implementation private and may have other meanings with other sources.

Attention
The list below descripes the specific constant declarations and typedefs. There are declared in the header file iCVCDriver.* .
Enumerator
CVNO_REGISTRATION_INVALID 

The registered callback is no longer registered (e.g. after device switch).

CVNO_EID_ERROR 

General Error. A description may be provided as string in the provided buffer in the callback.

CVNO_EID_DEVICE_DISCONNECTED 

Camera disconnect.

CVNO_EID_DEVICE_RECONNECT 

Camera reconnect.

CVNO_EID_GEOMETRY_CHANGE 

The image geometry/data type has been changed (e.g. IRImageRect or port switch).

CVNO_EID_METADATA_CHANGE 

New metadata available. The metadata is provided as string int the provided buffer of the callback.

CVNO_EID_CUSTOM 

Custom event id.

◆ CVNotifyInfoCmd

Defines the command for getting an information from the Notify interface.

Attention
The list below descripes the specific constant declarations and typedefs. There are declared in the header file iCVCDriver.* .
Enumerator
CVNO_INFO_COUNT_REGISTERED 

Number of callbacks registered.

CVNO_INFO_COUNT_FIRED 

Number of callbacks fired for a specific data type.

CVNO_INFO_IS_AVAILABLE 

Availability of the event at the time of the status inquiry.

NO_INFO_CUSTOM_CMD 

Custom information.

Function Documentation

◆ CanNotify()

cvbbool_t CanNotify ( IMG  Image)

This function verifies whether the image supports the INotify interface.

Parameters
[in]ImageHandle of image object.
Returns
TRUE if the image supports the Notify interface, FALSE otherwise.
Supported platforms:
Win32
Win64
Linux

◆ NOGetDescription()

cvbres_t NOGetDescription ( IMG  Image,
size_t  Index,
char *  DescriptiveName,
size_t &  Size,
CVNotifyEvent_t EventID 
)

Inquire a readable description (name) and the event ID for a given Index.

This ID is used to register/unregister an event.

Parameters
[in]ImageHandle of image object.
[in]IndexIndex for the supported notify events list.
The range is from 0 to NotifyEventCount
[in,out]DescriptiveNameGets the human readable event name for the given index.
[in,out]SizeSize of Buffer in bytes.
[out]EventIDUnique number identifying a single source of events (see CVNotifyEvent_t)
Returns
>=0 : OK
<0 : an error occured
Supported platforms:
Win32
Win64
Linux
Related Topics:
NORegister
NOUnregister

◆ NOGetNumSupported()

cvbres_t NOGetNumSupported ( IMG  Image,
size_t &  NumEvents 
)

Iniquire the number of supported event sources.

Attention
The number of supported events must not change at runtime. If an event is not supported at a given time this can be inquired through the status.
Parameters
[in]ImageHandle of image object.
[out]NumEventsNumber of supported event sources.
Returns
>=0 : OK
<0 : an error occured
Supported platforms:
Win32
Win64
Linux

◆ NOGetStatus()

cvbres_t NOGetStatus ( IMG  Image,
CVNotifyEvent_t  eventID,
CVNotifyInfo_t  StatusCmd,
cvbint64_t &  Info 
)

Inquire additional information on an event source.

For example: Number of callbacks registered or number of times fired Availability at a certain time.

Parameters
[in]ImageHandle of image object.
[in]eventIDUnique number identifying a single source of events.
If a 0 is passed as argument the callback will receive ALL events from a driver instance (see CVNotifyEvent_t).
[in]StatusCmdPossible command to execute like CVNO_INFO_COUNT_REGISTERED (see CVNotifyInfo_t for more information).
[out]InfoA number referencing a certain information related to an EventID.
Returns
>=0 : OK
<0 : an error occured
Supported platforms:
Win32
Win64
Linux
Related Topics:
NORegister
NOUnregister

◆ NOIsCookieValid()

cvbres_t NOIsCookieValid ( IMG  Image,
intptr_t  Cookie,
cvbbool_t &  IsValid 
)

Inquire if a given Cookie is still referring to a registered callback.

Parameters
[in]ImageHandle of image object.
[in]CookieIs a unique handle referencing a single callback registration.
[out]IsValidTRUE, if cookie is valid, FALSE otherwise.
Returns
>=0 : OK
<0 : an error occured
Supported platforms:
Win32
Win64
Linux

◆ NORegister()

cvbres_t NORegister ( IMG  Image,
CVNotifyEvent_t  EventID,
CVBDRIVER_NOTIFY_CB  pCB,
void *  UserData,
intptr_t &  Cookie 
)

Register a callback for one (or more) events.

The callback stays registered until either the driver is unloaded, the NOUnregister function is called or the CVNO_REGISTRATION_INVALID (see CVNotifyEventIDs) is fired. With a driver unload the callback is unregistered automatically. After a reload of the driver the callback has to be registered again.

Parameters
[in]ImageHandle of image object.
[in]EventIDUnique number identifying a single source of events.
If a 0 is passed as argument the callback will receive ALL events from a driver instance (see CVNotifyEvent_t).
[in]pCBCallback function (see CVBDRIVER_NOTIFY_CB)
[in]UserDataUser provided pointer to private data which gets passed to the event callback function.
[out]CookieCookie referencing a single callback registration.
This cookie must be used to unregister the callback. The cookie might change from session to session.
Returns
>=0 : OK
<0 : an error occured
Supported platforms:
Win32
Win64
Linux
Related Topics:
NOUnregister

◆ NOUnregister()

cvbres_t NOUnregister ( IMG  Image,
intptr_t  Cookie 
)

Unregister a callback.

In case of a driver unload this unregister is done automatically.

Parameters
[in]ImageHandle of image object.
[in]CookieIs a unique handle referencing a single callback registration.
Returns
>=0 : OK
<0 : an error occured
Supported platforms:
Win32
Win64
Linux
Related Topics:
NORegister