DriveWorks SDK Reference
3.5.78 Release
For Test and Development only

sensors/camera/docs/usecase3.md
Go to the documentation of this file.
1 # Copyright (c) 2019-2020 NVIDIA CORPORATION. All rights reserved.
2 
3 @page camera_usecase3 SIPL-based Image Sensors (Live)
4 
5 @note SW Release Applicability: This tutorial is applicable to modules in both **NVIDIA DriveWorks** and **NVIDIA DRIVE Software** releases.
6 
7 Initialize the Sensor Abstraction Layer
8 
9 ```{.cpp}
10 dwSAL_initialize(&sal, sdk);
11 ```
12 
13 We create a client
14 ```{.cpp}
15  dwSensor cameraSensor = DW_NULL_HANDLE;
16  dwSensorParams params;
17  params.parameters = "camera-name=SF3324,interface=csi-a,link=0,output-format=processed";
18  params.protocol = "camera.gmsl.sipl";
19  dwSAL_createSensor(&cameraSensor, params, sal);
20 ```
21 
22 
23 after starting the sensor, the camera will start acquiring frames
24 
25 ```{.cpp}
26 dwSensor_start(cameraSensor);
27 
28 while(loop) {
29 ```
30 
31 We read a frame, which is stored as a `::dwCameraFrameHandle_t` and specify a timeout value in microseconds
32 
33 ```{.cpp}
34 ...
35  dwCameraFrameHandle_t frameHandle = DW_NULL_HANDLE;
36  dwTime_t timeout = 33000;
37  dwSensorCamera_readFrame(&frameHandle, timeout, cameraSensor);
38 ...
39 ```
40 
41 we get an image with type `::DW_CAMERA_OUTPUT_NATIVE_PROCESSED`.
42 
43 ```{.cpp}
44 ...
45  dwImageHandle_t imageNative;
46  dwSensorCamera_getImage(&imageNative, DW_CAMERA_IMAGE_OUTPUT_NATIVE_PROCESSED,...);
47 
48  // CODE: use imageNative (maybe send to serializer)
49 
50 ...
51 ```
52 
53 return frames to the fifo
54 
55 ```{.cpp}
56 ...
57  dwSensorCamera_returnFrame(...);
58 }
59 ```
60 
61 stop the sensor and release
62 
63 ```{.cpp}
64 dwSensor_stop(cameraSensor);
65 dwSAL_releaseSensor(&cameraSensor);
66 ```
67 
68 For more details see:
69 - @ref dwx_camera_sample