Movie2 (Movie2.dll) 15.0
Callback Functions

Typedefs

typedef void __stdcall * pfMovie2Error(MOVIE2RECORDER Recorder, cvbres_t ErrorCode, const char *szMessage, const char *szLocation, void *pUserData)
 Callback that will be raised by the Movie2 recorder whenever an internal error occurred. More...
 
typedef void __stdcall * pfMovie2ImageSnapped(MOVIE2RECORDER Recorder, void *pUserData)
 Callback that will be raised by the Movie2 recorder whenever a new image has been acquired. More...
 
typedef void __stdcall * pfMovie2ImageUpdated(MOVIE2RECORDER Recorder, void *pUserData)
 Callback that will be raised by the Movie2 recorder whenever the image handle in the recorder object changed its value. More...
 
typedef void __stdcall * pfMovie2ProvideMetaData(MOVIE2RECORDER Recorder, char *szMetaData, cvbval_t BufferSize, void *pUserData)
 Callback that will be raised by the Movie2 recorder whenever new MetaData can be passed to the current frame into the AVI container. More...
 

Detailed Description

Typedef Documentation

◆ pfMovie2Error

typedef void __stdcall * pfMovie2Error(MOVIE2RECORDER Recorder, cvbres_t ErrorCode, const char *szMessage, const char *szLocation, void *pUserData)

Callback that will be raised by the Movie2 recorder whenever an internal error occurred.

Callback has to be registered with Movie2RegisterErrorCallback and unregistered with Movie2UnregisterCallback.

Attention
This covers only those errors that cannot be reported by means of a return value.
Parameters
[in]RecorderHandle of recorder object on which callback is raised.
[in]ErrorCodeCVB error code.
[in]szMessageReadable error string.
[in]szLocationLocation where the error occurred.
[in]pUserDataUser data for the callback given in the register function.
Supported platforms:
Win32
Win64
Related Topics:
Movie2RegisterErrorCallback, Movie2UnregisterCallback
Examples:
Delphi - Delphi Movie2 Example
Visual C++ - VC Movie2 Example

◆ pfMovie2ImageSnapped

typedef void __stdcall * pfMovie2ImageSnapped(MOVIE2RECORDER Recorder, void *pUserData)

Callback that will be raised by the Movie2 recorder whenever a new image has been acquired.

Callback has to be registered with Movie2RegisterImageSnappedCallback and unregistered with Movie2UnregisterCallback.

Parameters
[in]RecorderHandle of recorder object on which callback is raised.
[in]pUserDataUser data for the callback given in the register function.
Supported platforms:
Win32
Win64
Related Topics:
Movie2RegisterImageSnappedCallback, Movie2UnregisterCallback
Examples:
Delphi - Delphi Movie2 Example
Visual C++ - VC Movie2 Example

◆ pfMovie2ImageUpdated

typedef void __stdcall * pfMovie2ImageUpdated(MOVIE2RECORDER Recorder, void *pUserData)

Callback that will be raised by the Movie2 recorder whenever the image handle in the recorder object changed its value.

Callback has to be registered with Movie2RegisterImageUpdatedCallback and unregistered with Movie2UnregisterCallback.

Parameters
[in]RecorderHandle of recorder object on which callback is raised.
[in]pUserDataUser data for the callback given in the register function.
Supported platforms:
Win32
Win64
Related Topics:
Movie2RegisterImageUpdatedCallback, Movie2UnregisterCallback
Examples:
Delphi - Delphi Movie2 Example
Visual C++ - VC Movie2 Example

◆ pfMovie2ProvideMetaData

typedef void __stdcall * pfMovie2ProvideMetaData(MOVIE2RECORDER Recorder, char *szMetaData, cvbval_t BufferSize, void *pUserData)

Callback that will be raised by the Movie2 recorder whenever new MetaData can be passed to the current frame into the AVI container.

Will only be raised if Movie2GetUseMetadata is set to TRUE. Callback has to be registered with Movie2RegisterMetaDataCallback and unregistered with Movie2UnregisterCallback.

Meta data are (ANSI-) strings with up to 64k characters, one per image being recorded. For example, the MetaData can be used to save the corresponding timestamp as a string for every recorded frame within the AVI container.

To read out the MetaData you can implement the CVB Notify Interface (INotify) of the Driver.dll in your own application. If you prefer the Grabber OCX you can use the ImageNotificationString Event. As examples the VCMovie2PlayerExample and the CSMovie2PlayerExample are included in Movie2.

Note
Some media players or AVI Editors may get confused by the presence of a text stream in the AVI container. When an AVI Editor does not support the text stream the MetaData is lost after editing the AVI file. For Example VirtualDub with DirectStreamCopy writes only the text of the first frame to all other frames.

Our Movie Interactive 2 is the only application we know which can handle text streams as MetaData. So if you want to recompress your recorded movie and don´t want to lose the MetaData use Movie Interactive 2.

Parameters
[in]RecorderHandle of recorder object on which callback is raised.
[in]szMetaDataString that will be saved as MetaData to the current frame into the AVI container.
[in]BufferSizeMaximum size of the MetaData string.
[in]pUserDataUser data for the callback given in the register function.
Supported platforms:
Win32
Win64
Related Topics:
Movie2RegisterErrorCallback, Movie2UnregisterCallback
Examples:
Delphi - Delphi Movie2 Example
Sample Code in Visual C++:
CVCMovie2ExampleDlg.h
// ...
long m_MetaDataCallbackCookie;
std::string m_CurrentMetaData;
static void CALLBACK MetaDataCallback ( MOVIE2RECORDER Recorder, char* szMetaData, long BufferSize, void* pUserData);
// ...
CVCMovie2ExampleDlg.cpp
// Callback definition
void CALLBACK CVCMovie2ExampleDlg::MetaDataCallback( MOVIE2RECORDER Recorder, char* szMetaData, long BufferSize, void* pUserData)
{
// Get Pointer to Dialog class from UserData
CVCMovie2ExampleDlg* myDlg = reinterpret_cast<CVCMovie2ExampleDlg*>(pUserData);
// Copy MetaData from m_CurrentMetaData to szMetaData
myDlg->m_CurrentMetaData.copy(szMetaData,BufferSize);
}
BOOL CVCMovie2ExampleDlg::OnInitDialog()
{
// ...
// Register Callback
Movie2RegisterMetaDataCallback(m_Recorder,&MetaDataCallback,this,m_MetaDataCallbackCookie);
// activate the use of MetaData
Movie2SetUseMetadata(m_Recorder,true);
// ...
}
// ImageSnaped event handler
void CVCMovie2ExampleDlg::ImageSnapedCvimagectrl1()
{
if(isRecording)
{
m_CurrentMetaData = "e.g a Timestamp as MetaData";
Movie2AddFrame(m_Recorder);
}
m_cvDisp.Refresh();
}
CVCMovie2ExampleDlg::~CVCMovie2ExampleDlg(void)
{
Movie2UnregisterCallback(m_Recorder,m_MetaDataCallbackCookie);
ReleaseObject(m_Recorder);
}
long Movie2SetUseMetadata(MOVIE2RECORDER Handle, BOOL Use)
Specify whether or not meta data should be recorded while writing an AVI file.
Definition: Movie2Export.cpp:1454
long Movie2AddFrame(MOVIE2RECORDER Handle)
Add a single frame from the image object that has been set for this recorder object to the AVI stream...
Definition: Movie2Export.cpp:1403
long Movie2RegisterMetaDataCallback(MOVIE2RECORDER Handle, pfMovie2ProvideMetaData Callback, void *pUserData, long &Cookie)
Register a MetaData callback that will be raised by the Movie2 recorder whenever new MetaData can be ...
Definition: Movie2Export.cpp:956
long Movie2UnregisterCallback(MOVIE2RECORDER Handle, long Cookie)
Deregisters any previously registered callback.
Definition: Movie2Export.cpp:987