...
The functions you need to implement and export from your Transport DLL are described below.
The exported functions should use the C calling convention. If you are using C or C++ this would normally be the default, so no special syntax is needed. If it is not, the keyword to force a function to the C calling convention is normally __cdecl in most C/C++ compilers. The function prototypes in this document assume C calling convention is the default.
To make your functions export from the DLL in C or C++ you would normally precede the function declaration with __declspec(dllexport).
The symbols and data structures used by the Transport DLL interface are defined in the midlib2.h and midlib2_trans.h header files.
Several of these functions are required to be implemented and exported from your DLL. If they are not exported then the Aptina libraries will not load the DLL. The remaining functions are optional. If an optional function is not present then either a default handler will be provided to the application, of the feature will not be available. Whether a function is required or optional will be noted for each one below.
Note; WinPcap is required - it can be downloaded from here.
Anchor | ||||
---|---|---|---|---|
|
Anchor | ||||
---|---|---|---|---|
|
...
MI_CAMERA_SUCCESS | Initialization successful. |
MI_SENSOR_FILE_PARSE_ERROR | A syntax error was found in the sensor data file. |
MI_SENSOR_DOES_NOT_MATCH | No sensor data file was found that matches the current sensor. |
MI_CAMERA_ERROR | Various other error conditions. |
...
Anchor | ||||
---|---|---|---|---|
|
Definition:
void updateFrameSize(mi_camera_t* pCamera , mi_u32 nWidth, mi_u32 nHeight, mi_s32 nBitsPerClock, mi_s32 nClocksPerPixel);
Summary:
Boilerplate code for UpdateFrameSizeDLL(). Sets pCamera->sensor->width, >height, ->pixelBits, and ->pixelBytes according to the parameters. Also sets BITS_PER_CLOCK and CLOCKS_PER_PIXEL in the camera context structure (see setContext() below). Sets pCamera>sensor->bufferSize to width * height * pixelBytes; you may need to fix up the bufferSize after calling this function. Call from UpdateFrameSizeDLL(). See sample code.
Parameters (same as UpdateFrameSizeDLL()):
pCamera | Pointer to a camera structure. |
nWidth | New image width, or 0 to keep the current width. |
nHeight | New image height, or 0 to keep the current height. |
nBitsPerClock | New bits/pixel clock, or 0 to keep the current value. |
nClocksPerPixel | New clocks/pixel, or 0 to keep the same value. |
Returns:
void |
|
...
Anchor | ||||
---|---|---|---|---|
|
...
pCamera | Pointer to a camera structure. |
Returns:
void |
|
...
Anchor | ||||
---|---|---|---|---|
|
...
errorcode | Always returns the first parameter. |
...
Anchor | ||||
---|---|---|---|---|
|
...
logType | A log message type defined in midlib2.h. The different log types can be turned on/off by the user on the DevWare Options dialog. |
logMsg | The text of the message. |
szSource | Source code file name where this log() call is located. Normally _FILE_. |
szFunc | Name of function where this log() call is located. Normally _FUNCTION_. |
nLine | Source code line number of this log() call. Normally _LINE_. |
Returns:
void |
Anchor | ||||
---|---|---|---|---|
|
...
MI_CAMERA_SUCCESS | Function was successful. |
MI_CAMERA_ERROR | An error occurred. |
Anchor | ||||
---|---|---|---|---|
|
...
MI_CAMERA_SUCCESS | Function was successful. |
MI_CAMERA_ERROR | An error occurred. |
Anchor | ||||
---|---|---|---|---|
|
...
MI_CAMERA_SUCCESS | Function was successful. |
MI_CAMERA_ERROR | An error occurred. |
...
Field MI_CONTEXT_PRIVATE_DATA
...
pCamera | Pointer to the camera structure. |
pInBuffer | Pointer to the raw data |
Returns:
void |
|
Anchor | ||||
---|---|---|---|---|
|
...
Register or bitfield value |
|
...
Anchor | ||||
---|---|---|---|---|
|
...
MI_CAMERA_SUCCESS | Initialization successful (even if no matching cdat files were found). |
MI_PARSE_FILE_ERROR | Error opening the config file. |
...
Anchor | ||||
---|---|---|---|---|
|
...
Returns:
device name string |
Optional:
This function is optional. However, if it's not implemented and the user opens two applications at the same time, the processes won't be synchronized, possibly causing unexpected results.
...
MI_CAMERA_SUCCESS | Message was received and accepted. |
MI_CAMERA_ERROR | pCamera pointer does not match the application's pCamera.notifyCode value is not a recognized notification code.lParam value is illegal.Application is not ready.Illegal calling thread. |
...
Anchor | ||||
---|---|---|---|---|
|
...