- Welcome
- Getting Started With the NVIDIA DriveWorks SDK
- Modules
- Samples
- Tools
- Tutorials
- SDK Porting Guide
- DriveWorks API
- More
Defines the camera module, which provides access to a virtual camera reading reading the data from a video file or a real camera connected to different sockets.
Unless explicitly specified, all errors returned by DW APIs are non recoverable and the user application should transition to fail safe mode. In addition, any error code not described in this documentation should be consider as fatal and the user application should also transition to fail safe mode.
Data Structures | |
struct | dwCameraNotificationData |
NotificationData from SIPL. More... | |
struct | dwCameraProperties |
Camera Properties. More... | |
struct | dwCameraSIPLEErrorDetails |
Struct of the detailed error info from SIPL. More... | |
struct | dwCameraSIPLNotification |
Notification Data from SIPL. More... | |
Macros | |
#define | DW_CAMERA_MAX_CAMERAMODULES_PER_BLOCK 4U |
Indicates the maximum number of camera modules per device block. More... | |
#define | DW_CAMERA_MAX_DEVICE_GPIOS 8U |
Indicates the maximum number of gpio indices. More... | |
Typedefs | |
typedef void(* | dwCameraCallback) (dwCameraSIPLNotification *notification, dwSensorHandle_t sensor) |
Function type of the camera error event handling. More... | |
typedef struct dwCameraFrame * | dwCameraFrameHandle_t |
Handle to captured frame. More... | |
typedef void | NvMediaIPPManager |
Functions | |
DW_API_PUBLIC dwStatus | dwSensorCamera_appendAllocationAttributes (dwImageProperties *imgProps, dwCameraOutputType const outputType, dwSensorHandle_t const sensor) |
Append the allocation attribute such that images allocated by the application and given to the camera via dwSensorCamera_setImagePool() can be imported into the underlying driver. More... | |
DW_API_PUBLIC dwStatus | dwSensorCamera_disableLink (dwSensorHandle_t const sensor) |
Disable the camera link This method should only be called after dwSensor_start() and before dwSensor_stop(). More... | |
DW_API_PUBLIC dwStatus | dwSensorCamera_enableLink (dwSensorHandle_t const sensor, bool const resetModule) |
Enable the camera link This method enables a given link and, if reset is asserted, reconfigures the camera module to reestablish the link. More... | |
DW_API_PUBLIC dwStatus | dwSensorCamera_fillSyncAttributes (NvSciSyncAttrList syncAttrList, dwCameraOutputType outputType, dwSensorHandle_t sensor) |
Fill the sync attributes for the camera pipeline to signal EOF fences. More... | |
DW_API_PUBLIC dwStatus | dwSensorCamera_getCUDAStream (cudaStream_t *const stream, dwSensorHandle_t const sensor) |
Gets the CUDA stream used. More... | |
DW_API_PUBLIC dwStatus | dwSensorCamera_getEOFFence (NvSciSyncFence *syncFence, dwCameraOutputType outputType, dwCameraFrameHandle_t const frameHandle) |
Get EOF fence of the current camera frame. More... | |
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. More... | |
DW_API_PUBLIC dwStatus | dwSensorCamera_getImageAsync (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. More... | |
DW_API_PUBLIC dwStatus | dwSensorCamera_getImageProperties (dwImageProperties *const imageProperties, dwCameraOutputType const outputType, dwSensorHandle_t const sensor) |
Gets information about the image properties for a given 'dwCameraImageOutputType'. More... | |
DW_API_PUBLIC dwStatus | dwSensorCamera_getNumSupportedCaptureModes (uint32_t *const numModes, dwSensorHandle_t const sensor) |
Gets number of supported capture modes. More... | |
DW_API_PUBLIC dwStatus | dwSensorCamera_getNvMediaIPPManager (NvMediaIPPManager **const manager, dwSensorHandle_t const sensor) |
Gets the NvMediaIPPManager used for GMSL camera IPP setup and event callback. More... | |
DW_API_PUBLIC dwStatus | dwSensorCamera_getSensorProperties (dwCameraProperties *const properties, dwSensorHandle_t const sensor) |
Gets information about the camera sensor. More... | |
DW_API_PUBLIC dwStatus | dwSensorCamera_getSIPLInterfaceProvider (void **const interfaceProvider, dwSensorHandle_t const sensor, dwSIPLCameraInterfaceProviderType const type) |
Gets SIPL Interface provider for a custom camera sensor. More... | |
DW_API_PUBLIC dwStatus | dwSensorCamera_getSupportedCaptureMode (dwCameraProperties *const captureMode, uint32_t const modeIdx, dwSensorHandle_t const sensor) |
Gets capture modes by specified index. More... | |
DW_API_PUBLIC dwStatus | dwSensorCamera_getTimestamp (dwTime_t *const timestamp, dwCameraFrameHandle_t const frameHandle) |
Gets the timestamp of the current camera frame. More... | |
DW_API_PUBLIC dwStatus | dwSensorCamera_readEEPROM (uint32_t const paramId, void *const buffer, uint32_t const size, dwSensorHandle_t const sensor) |
Read data associated with a parameter stored on the EEPROM device and write to the provided buffer. More... | |
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. More... | |
DW_API_PUBLIC dwStatus | dwSensorCamera_returnFrame (dwCameraFrameHandle_t *const frameHandle) |
Returns a frame to the camera after it has been consumed. More... | |
DW_API_PUBLIC dwStatus | dwSensorCamera_setCUDAStream (cudaStream_t const stream, dwSensorHandle_t const sensor) |
Sets the CUDA stream used by getImageAsync during internal cuda related operations. More... | |
DW_API_PUBLIC dwStatus | dwSensorCamera_setEventCallback (dwCameraCallback blkCallback, dwCameraCallback lineCallback, dwSensorHandle_t sensor) |
Set the Camera Error Handling callbacks. More... | |
dwStatus | dwSensorCamera_setImagePool (dwImagePool imagePool, dwSensorHandle_t const sensor) |
Sets a pool of image to be used as output by the camera layer. More... | |
DW_API_PUBLIC dwStatus | dwSensorCamera_setSyncObject (NvSciSyncObj syncObj, dwCameraOutputType outputType, dwSensorHandle_t sensor) |
Set the sync obj to which the camera pipeline will signal EOF fences. More... | |
struct dwCameraNotificationData |
Data Fields | ||
---|---|---|
dwCameraSIPLNotificationData | eNotifyType | Holds the notification event type. |
uint64_t | frameCaptureTSC | Holds the TSC timestamp of the frame capture. |
uint32_t | gpioIdxs[DW_CAMERA_MAX_DEVICE_GPIOS] | Holds the GPIO indices. |
uint32_t | numGpioIdxs | Holds the number of GPIO indices in the array. |
uint32_t | uIndex | Holds the ID of each camera sensor. |
uint8_t | uLinkMask | Holds the device block link mask. |
struct dwCameraProperties |
Data Fields | ||
---|---|---|
dwCameraType | cameraType |
Type of the camera |
dwCameraExposureControl | exposure |
Exposure control |
dwCameraFOV | fov |
FOV of the lens |
float32_t | framerate |
Framerate in Hz |
uint32_t | imageBitDepth |
Bit depth of image |
bool | isSimulated |
Camera is being simulated |
int32_t | outputTypes |
Or'ed list of available 'dwCameraOutputType' |
dwCameraRawFormat | rawFormat |
Raw bayer pattern |
dwVector2ui | resolution |
Physical resolution of the camera sensor |
uint32_t | revision |
Revision of the camera (0 if info is not available) |
uint32_t | siblings |
Number of sibling frames |
struct dwCameraSIPLEErrorDetails |
struct dwCameraSIPLNotification |
Data Fields | ||
---|---|---|
dwCameraNotificationData | data | NotificationData from SIPL, pipeline & device block event. |
dwCameraSIPLEErrorDetails | deserializerErrorInfo | Error info for deserializer, valid only for device block event. |
bool | isRemoteError | Set to true if remote (serializer) error detected, valid only for device block event. |
uint8_t | linkErrorMask | Store link mask for link error state, valid only for device block event (1 in index position indicates error, all 0 means no link error detected). |
uint32_t | numCameraModules | Number of the camera modules, valid only for device block event. |
dwCameraSIPLEErrorDetails | sensorErrorInfoList[DW_CAMERA_MAX_CAMERAMODULES_PER_BLOCK] | Error info for sensor, valid only for device block event. |
dwCameraSIPLEErrorDetails | serializerErrorInfoList[DW_CAMERA_MAX_CAMERAMODULES_PER_BLOCK] | Error info for serializer, valid only for device block event. |
#define DW_CAMERA_MAX_CAMERAMODULES_PER_BLOCK 4U |
#define DW_CAMERA_MAX_DEVICE_GPIOS 8U |
typedef void(* dwCameraCallback) (dwCameraSIPLNotification *notification, dwSensorHandle_t sensor) |
typedef struct dwCameraFrame* dwCameraFrameHandle_t |
typedef void NvMediaIPPManager |
Enum of exposure control types.
enum dwCameraFOV |
enum dwCameraOutputType |
Output types supported by the camera.
DW_CAMERA_OUTPUT_NATIVE_* types return the image directly from the layer underneath as it is represented in system memory, while for non native output types images are converted and streamed through ad hoc streamers.
enum dwCameraRawFormat |
Raw encoding formats pixel-order.
Enum of available SIPL event notification type (Copy from nvsipl::NvSIPLPipelineNotifier::NotificationType).
enum dwCameraType |
Enum of available camera sensors.
DW_API_PUBLIC dwStatus dwSensorCamera_appendAllocationAttributes | ( | dwImageProperties * | imgProps, |
dwCameraOutputType const | outputType, | ||
dwSensorHandle_t const | sensor | ||
) |
Append the allocation attribute such that images allocated by the application and given to the camera via dwSensorCamera_setImagePool() can be imported into the underlying driver.
[in,out] | imgProps | Image properties |
[in] | outputType | Ouptut type of the camera. |
[in] | sensor | Sensor handle of the camera sensor previously created with dwSAL_createSensor(). |
DW_API_PUBLIC dwStatus dwSensorCamera_disableLink | ( | dwSensorHandle_t const | sensor | ) |
Disable the camera link This method should only be called after dwSensor_start() and before dwSensor_stop().
[in] | sensor | A handle to the camera GMSL |
DW_API_PUBLIC dwStatus dwSensorCamera_enableLink | ( | dwSensorHandle_t const | sensor, |
bool const | resetModule | ||
) |
Enable the camera link This method enables a given link and, if reset is asserted, reconfigures the camera module to reestablish the link.
This method should only be called after dwSensor_start() and before dwSensor_stop(). Please note, it is not necessary to call dwSensorCamera_enableLink() after dwSensor_start(). This API is used to enable the link again after the link has been disabled by dwSensorCamera_disableLink().
[in] | sensor | A handle to the camera GMSL |
[in] | resetModule | If true, reconfigure the camera module before enabling the link. |
DW_API_PUBLIC dwStatus dwSensorCamera_fillSyncAttributes | ( | NvSciSyncAttrList | syncAttrList, |
dwCameraOutputType | outputType, | ||
dwSensorHandle_t | sensor | ||
) |
Fill the sync attributes for the camera pipeline to signal EOF fences.
Note that multiple calls on the same syncAttrList will append attributes on the same
[out] | syncAttrList | The sync attributes list to be filled |
[in] | outputType | The output type |
[in] | sensor | The sensor handle |
DW_API_PUBLIC dwStatus dwSensorCamera_getCUDAStream | ( | cudaStream_t *const | stream, |
dwSensorHandle_t const | sensor | ||
) |
Gets the CUDA stream used.
[out] | stream | Returns the CUDA stream in sensor. |
[in] | sensor | A pointer to the camera handle that is updated. |
DW_API_PUBLIC dwStatus dwSensorCamera_getEOFFence | ( | NvSciSyncFence * | syncFence, |
dwCameraOutputType | outputType, | ||
dwCameraFrameHandle_t const | frameHandle | ||
) |
Get EOF fence of the current camera frame.
[out] | syncFence | The sync fence of the frame |
[in] | outputType | The output type |
[in] | frameHandle | Handle to the camera frame |
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.
Depending on the type requested, conversion and streaming handled by the camera implicitly might be required. The call is blocking NOTE: the underlying resources are still in the frame handle and the image returned is intended not to be modified. For this reason, any modifications to this 'dwImageHandle_t' or 'dwImageCPU', 'dwImageCUDA', 'dwImageGL' or 'dwImageNvMedia' returned by 'dwImage_getCPU' ('dwImage_getCUDA', 'dwImage_getGL' and 'dwImage_getNvMedia') will result in undefined behavior.
[out] | image | Handle to the image received by the camera |
[in] | type | Ouptut type of the image. This is represented by a limited useful number of options which can be chosen at runtime |
[in] | frame | Camera frame handle of the captured frame |
DW_API_PUBLIC dwStatus dwSensorCamera_getImageAsync | ( | 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.
Depending on the type requested, conversion and streaming handled by the camera implicitly might be required, which happens on the cudaStream specified at 'dwSensorCamera_setCUDAStream()' NOTE: the underlying resources are still in the frame handle and the image returned is intended not to be modified. For this reason, any modifications to this 'dwImageHandle_t' or 'dwImageCPU', 'dwImageCUDA', 'dwImageGL' or 'dwImageNvMedia' returned by 'dwImage_getCPU' ('dwImage_getCUDA', 'dwImage_getGL' and 'dwImage_getNvMedia') will result in undefined behavior.
[out] | image | Handle to the image received by the camera |
[in] | type | Ouptut type of the image. This is represented by a limited useful number of options which can be chosen at runtime |
[in] | frame | Camera frame handle of the captured frame |
DW_API_PUBLIC dwStatus dwSensorCamera_getImageProperties | ( | dwImageProperties *const | imageProperties, |
dwCameraOutputType const | outputType, | ||
dwSensorHandle_t const | sensor | ||
) |
Gets information about the image properties for a given 'dwCameraImageOutputType'.
[out] | imageProperties | A pointer to image properties of the frames captured by the camera. |
[in] | outputType | Format of the output image to get the properties of |
[in] | sensor | Sensor handle of the camera sensor previously created with dwSAL_createSensor(). |
DW_API_PUBLIC dwStatus dwSensorCamera_getNumSupportedCaptureModes | ( | uint32_t *const | numModes, |
dwSensorHandle_t const | sensor | ||
) |
Gets number of supported capture modes.
[out] | numModes | A pointer to the number of available capture modes. |
[in] | sensor | Sensor handle of the camera sensor previously created with dwSAL_createSensor(). |
DW_API_PUBLIC dwStatus dwSensorCamera_getNvMediaIPPManager | ( | NvMediaIPPManager **const | manager, |
dwSensorHandle_t const | sensor | ||
) |
Gets the NvMediaIPPManager used for GMSL camera IPP setup and event callback.
[out] | manager | A pointer to the NvMediaIPPManager instance created by the sensor. |
[in] | sensor | Sensor handle of the camera sensor previously created with dwSAL_createSensor(). |
DW_API_PUBLIC dwStatus dwSensorCamera_getSensorProperties | ( | dwCameraProperties *const | properties, |
dwSensorHandle_t const | sensor | ||
) |
Gets information about the camera sensor.
[out] | properties | A pointer to the properties of the camera. |
[in] | sensor | Sensor handle of the camera sensor previously created with dwSAL_createSensor(). |
DW_API_PUBLIC dwStatus dwSensorCamera_getSIPLInterfaceProvider | ( | void **const | interfaceProvider, |
dwSensorHandle_t const | sensor, | ||
dwSIPLCameraInterfaceProviderType const | type | ||
) |
Gets SIPL Interface provider for a custom camera sensor.
[out] | interfaceProvider | nvsipl::IInterfaceProvider*& for given sensor |
[in] | sensor | Handle to sensor |
[in] | type | type of interface provider |
DW_API_PUBLIC dwStatus dwSensorCamera_getSupportedCaptureMode | ( | dwCameraProperties *const | captureMode, |
uint32_t const | modeIdx, | ||
dwSensorHandle_t const | sensor | ||
) |
Gets capture modes by specified index.
[out] | captureMode | A pointer to available capture mode. |
[in] | modeIdx | Index of a mode to retrieve. |
[in] | sensor | Sensor handle of the camera sensor previously created with dwSAL_createSensor(). |
DW_API_PUBLIC dwStatus dwSensorCamera_getTimestamp | ( | dwTime_t *const | timestamp, |
dwCameraFrameHandle_t const | frameHandle | ||
) |
Gets the timestamp of the current camera frame.
[out] | timestamp | The timestamp of the current camera frame. |
[in] | frameHandle | Handle to a captured frame. |
DW_API_PUBLIC dwStatus dwSensorCamera_readEEPROM | ( | uint32_t const | paramId, |
void *const | buffer, | ||
uint32_t const | size, | ||
dwSensorHandle_t const | sensor | ||
) |
Read data associated with a parameter stored on the EEPROM device and write to the provided buffer.
If the parameter is not present, does not contain valid data, or is corrupted, then this API call will fail, and no data will be written to the provided buffer. Currently doesn't support virtual sensors.
Note: This reads from the copy of the EEPROM data in local memory, so this can be done, even if the ISC device is in a state where it cannot be read from.
[in] | paramId | The ID of the parameter to be read |
[out] | buffer | A pointer to the buffer that the data is to be read to. It must be at least 'size' bytes long. |
[in] | size | The number of bytes that are to be read from the parameter. This must be greater than zero and less than or equal to the maximum size of the parameter. |
[in] | sensor | A handle to the camera GMSL |
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.
The reading is a blocking call. With the frame handle, the associated data can be queried from the sensor. Available data is configured during sensor creation.
[out] | frameHandle | A pointer to a handle to a frame read from the camera. With the handle, different data can be queried. The frame handle must be returned to be put back into the internal pool. |
[in] | timeoutUs | Timeout in microseconds to wait for a new frame. Special values: DW_TIMEOUT_INFINITE - to wait infinitly. Zero - means polling of internal queue. |
[in] | sensor | Sensor handle of the camera previously created with 'dwSAL_createSensor()'. |
dwSensor_start
. After that The status will be returned until the first frame acquired. If this doesn't happen within 2 seconds, the sensor is to be considered unresponsive. DW_API_PUBLIC dwStatus dwSensorCamera_returnFrame | ( | dwCameraFrameHandle_t *const | frameHandle | ) |
Returns a frame to the camera after it has been consumed.
All data associated with this handle is invalid after the handle has been returned.
[in] | frameHandle | Handle previously read from the camera to be returned to the pool. |
DW_API_PUBLIC dwStatus dwSensorCamera_setCUDAStream | ( | cudaStream_t const | stream, |
dwSensorHandle_t const | sensor | ||
) |
Sets the CUDA stream used by getImageAsync during internal cuda related operations.
[in] | stream | The CUDA stream to use. |
[in] | sensor | A pointer to the camera handle that is updated. |
DW_API_PUBLIC dwStatus dwSensorCamera_setEventCallback | ( | dwCameraCallback | blkCallback, |
dwCameraCallback | lineCallback, | ||
dwSensorHandle_t | sensor | ||
) |
Set the Camera Error Handling callbacks.
If receiving the device block error event, the blkCallback will be invoked. If receiving the pipeline error event, the lineCallback will be invoked.
[in] | blkCallback | device block error handling function. Set to nullptr if not used |
[in] | lineCallback | pipeline error handling function. Set to nullptr if not used |
[in] | sensor | A handle to the camera GMSL |
dwStatus dwSensorCamera_setImagePool | ( | dwImagePool | imagePool, |
dwSensorHandle_t const | sensor | ||
) |
Sets a pool of image to be used as output by the camera layer.
If this is called, the default pool is not allocated. The pool's type (raw/isp0/isp1/isp2) is deduced automatically by the format of the image. All images in the pool must match in properties If the size of the pool mismatches fifo-size, the fifo-size will be overridden.
[in] | imagePool | Handle to the dwImagePool, ownership remains of the creator of the pool, the camera will be using the images as outputs during capture and processing |
[in] | sensor | Camera sensor handle |
DW_API_PUBLIC dwStatus dwSensorCamera_setSyncObject | ( | NvSciSyncObj | syncObj, |
dwCameraOutputType | outputType, | ||
dwSensorHandle_t | sensor | ||
) |
Set the sync obj to which the camera pipeline will signal EOF fences.
The sync object is not reference counted
[in] | syncObj | The sync object |
[in] | outputType | The output type |
[in] | sensor | The sensor handle |