Initialize the Sensor Abstraction Layer
DW_API_PUBLIC dwStatus dwSAL_initialize(dwSALHandle_t *const sal, dwContextHandle_t const context)
Creates and initializes a SAL (sensor abstraction layer) module.
Initialize the parameter string for a camera sensor, in this case we request a processed image (yuv), a camera ar0231-rccb with sf3324 module and BAE exposure type at group C. We specify a gmsl protocol and create the sensor
params.
parameters =
"output-format=yuv,camera-type=ar0231-rccb-bae-sf3324,camera-group=c";
const char8_t * parameters
Array of additional parameters provided to sensor creation.
const char8_t * protocol
Name of the protocol.
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.
after starting the sensor, the camera will start acquiring frames
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
...
...
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.
int64_t dwTime_t
Specifies a timestamp unit, in microseconds.
many outputs can be return after reading, the only extra cost are eventual streaming and conversion, depending on the output chosen. Also the output type is influenced by how we created the camera. Since we specified processed image (yuv), we can request a processed image as output. In order to know what properties such an image has, it is possible to call dwSensorCamera_getImageProperties()
with dwCameraOutputType
equal to DW_CAMERA_OUTPUT_NATIVE_PROCESSED
.
...
...
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
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
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: