DriveWorks SDK Reference
5.16.65 Release
For Test and Development only

SIPL-based Image Sensors (Live)

Initialize the Sensor Abstraction Layer

dwSAL_initialize(&sal, sdk);
DW_API_PUBLIC dwStatus dwSAL_initialize(dwSALHandle_t *const sal, dwContextHandle_t const context)
Creates and initializes a SAL (sensor abstraction layer) module.

Create a client

dwSensor cameraSensor = DW_NULL_HANDLE;
params.parameters = "camera-name=SF3324,interface=csi-a,link=0,output-format=processed";
params.protocol = "camera.gmsl";
dwSAL_createSensor(&cameraSensor, params, sal);
#define DW_NULL_HANDLE
Definition: Types.h:80
const char8_t * parameters
Array of additional parameters provided to sensor creation.
Definition: Sensors.h:108
const char8_t * protocol
Name of the protocol.
Definition: Sensors.h:101
DW_API_PUBLIC dwStatus dwSAL_createSensor(dwSensorHandle_t *const sensor, dwSensorParams const params, dwSALHandle_t const sal)
Creates a new sensor managed by the SAL module with the given parameters.
Holds sets of parameters for sensor creation.
Definition: Sensors.h:97

after starting the sensor, the camera will start acquiring frames

dwSensor_start(cameraSensor);
while(loop) {
DW_API_PUBLIC dwStatus dwSensor_start(dwSensorHandle_t const sensor)
Starts the sensor previously successfully created with 'dwSAL_createSensor()'.

We read a frame, which is stored as a dwCameraFrameHandle_t and specify a timeout value in microseconds

...
dwTime_t timeout = 33000;
dwSensorCamera_readFrame(&frameHandle, timeout, cameraSensor);
...
DW_API_PUBLIC dwStatus dwSensorCamera_readFrame(dwCameraFrameHandle_t *const frameHandle, dwTime_t const timeoutUs, dwSensorHandle_t const sensor)
Reads a frame handle from the camera sensor.
struct dwCameraFrame * dwCameraFrameHandle_t
Handle to captured frame.
Definition: Camera.h:73
int64_t dwTime_t
Specifies a timestamp unit, in microseconds.
Definition: BasicTypes.h:65

we get an image with type DW_CAMERA_OUTPUT_NATIVE_PROCESSED.

...
dwImageHandle_t imageNative;
dwSensorCamera_getImage(&imageNative, DW_CAMERA_IMAGE_OUTPUT_NATIVE_PROCESSED,...);
// CODE: use imageNative (maybe send to serializer)
...
DW_API_PUBLIC dwStatus dwSensorCamera_getImage(dwImageHandle_t *const image, dwCameraOutputType const type, dwCameraFrameHandle_t const frame)
Gets the output image/s image in a format specified by the output type.
struct dwImageObject * dwImageHandle_t
Definition: Image.h:105

return frames to the fifo

...
}
DW_API_PUBLIC dwStatus dwSensorCamera_returnFrame(dwCameraFrameHandle_t *const frameHandle)
Returns a frame to the camera after it has been consumed.

stop the sensor and release

dwSensor_stop(cameraSensor);
dwSAL_releaseSensor(&cameraSensor);
DW_API_PUBLIC dwStatus dwSensor_stop(dwSensorHandle_t const sensor)
Stops the sensor.
DW_API_PUBLIC dwStatus dwSAL_releaseSensor(dwSensorHandle_t const sensor)
Releases a sensor managed by the SAL module.

For more details see: