DriveWorks SDK Reference
4.0.0 Release
For Test and Development only

src/dw/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 Initialize the Sensor Abstraction Layer
6 
7 ```{.cpp}
8 dwSAL_initialize(&sal, sdk);
9 ```
10 
11 We create a client
12 ```{.cpp}
13  dwSensor cameraSensor = DW_NULL_HANDLE;
14  dwSensorParams params;
15  params.parameters = "camera-name=SF3324,interface=csi-a,link=0,output-format=processed";
16  params.protocol = "camera.gmsl.sipl";
17  dwSAL_createSensor(&cameraSensor, params, sal);
18 ```
19 
20 
21 after starting the sensor, the camera will start acquiring frames
22 
23 ```{.cpp}
24 dwSensor_start(cameraSensor);
25 
26 while(loop) {
27 ```
28 
29 We read a frame, which is stored as a `::dwCameraFrameHandle_t` and specify a timeout value in microseconds
30 
31 ```{.cpp}
32 ...
33  dwCameraFrameHandle_t frameHandle = DW_NULL_HANDLE;
34  dwTime_t timeout = 33000;
35  dwSensorCamera_readFrame(&frameHandle, timeout, cameraSensor);
36 ...
37 ```
38 
39 we get an image with type `::DW_CAMERA_OUTPUT_NATIVE_PROCESSED`.
40 
41 ```{.cpp}
42 ...
43  dwImageHandle_t imageNative;
44  dwSensorCamera_getImage(&imageNative, DW_CAMERA_IMAGE_OUTPUT_NATIVE_PROCESSED,...);
45 
46  // CODE: use imageNative (maybe send to serializer)
47 
48 ...
49 ```
50 
51 return frames to the fifo
52 
53 ```{.cpp}
54 ...
55  dwSensorCamera_returnFrame(...);
56 }
57 ```
58 
59 stop the sensor and release
60 
61 ```{.cpp}
62 dwSensor_stop(cameraSensor);
63 dwSAL_releaseSensor(&cameraSensor);
64 ```
65 
66 For more details see:
67 - @ref dwx_camera_sample