Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...


A transport is the link between a camera device and the Aptina onsemi software libraries. The purpose of a transport is to implement the camera control (read and write registers, set modes) and image acquisition functions needed by the higher level software. With a Transport DLL you can:

  1. Support an Aptina onsemi sensor on a device other than the Demo System camera so DevWare or any other ApBase-based application will work with the device.
  2. Create a software simulated camera and sensor, simulating either an existing sensor or new sensor, and be able to use DevWare as the user interface for the simulation.

...

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 onsemi 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.

...

Definition:
mi_s32 getBoardConfig(mi_camera_t *pCamera, const char *dir_or_file);
Summary:
If the camera is an Aptina onsemi Demo camera such as Demo2X or Demo3, this function fills in the chip[] array of the pCamera structure by loading .cdat files that correspond to FPGAs or peripherals on the camera system I2C bus.
Parameters:

...

Definition:
__declspec(dllexport) mi_s32 OpenCameraDLL(mi_camera_t *pCamera, const char *sensor_dir_file, int deviceIndex);
Summary:
This function is called when the DLL is loaded, repeatedly, once for each camera. The deviceIndex parameter will = 0 on the first call, 1 on the second call, and so on. For each camera, do any internal initialization you may need. Fill in pCamera fields including pCamera->sensor, but do not touch pCamera->context, which is already initialized and is used internally by the Aptina onsemi libraries. You can use the setContext() helper function to associate the deviceIndex and/or any other private per-camera data to the pCamera object. The sensor_dir_file parameter is the name of the sensor data file or directory passed by the application to ap_DeviceProbe(). You can quickly initialize your pCamera->sensor with the helper function getSensor().
If all cameras have already been initialized, return MI_CAMERA_ERROR to end the init process. For example, if there are two cameras, return MI_CAMERA_SUCCESS on deviceIndex = 0 and deviceIndex = 1, and return MI_CAMERA_ERROR on deviceIndex = 2.
Parameters:

...


Optional:
This function is not needed if there is no bus master on the main device, or if the main device is an Aptina onsemi product.

Anchor
_Toc364859150
_Toc364859150
DLL Export WriteFarRegistersDLL()

...


Optional:
This function is not needed if there is no bus master on the main device, or if the main device is an Aptina onsemi product.

Anchor
_Toc364859151
_Toc364859151
DLL Export GrabFrameDLL()

...

To use your transport DLL, just copy it to the Plugins folder in the Demo Software installation location, typically C:\Aptina Imaging\Plugins.
Alternatively, the application can pass the filename of the DLL to ApBase using the ap_DeviceProbeDll() function. If the application passes in a DLL filename then the Plugins folder is not searched.
DevWare-specific: You can use a command line parameter to specify the DLL. DevWare will pass the given DLL path to the Aptina onsemi libraries.
DevWare.exe /DLL="C:\path\to\your\transport\yourdev.dll"

...