NVIDIA DRIVE 5.0 Linux SDK API Reference

5.0.5.0 Release

 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
Image Capture

Detailed Description

Captures uncompressed image data, writing the results to an NvMediaImage.

A specific NvMedia implementation may support capturing multiple types of uncompressed image data. However, NvMediaICP objects are able to capture a specific type of uncompressed image data. This type must be specified during creation.

Data Structures

struct  NvMediaICPInputFormat
 Capture input format. More...
 
struct  NvMediaICPSettings
 Holds image capture settings for the CSI format. More...
 
struct  NvMediaICPSettingsEx
 Holds the image capture settings for the CSI format. More...
 
struct  NvMediaICPEx
 Holds the image capture object created by NvMediaICPCreateEx. More...
 
struct  NvMediaICPErrorInfo
 Holds the capture error information populated by NvMediaICPGetErrorInfo. More...
 

Macros

#define NVMEDIA_ICP_VERSION_MAJOR   4
 Major Version number. More...
 
#define NVMEDIA_ICP_VERSION_MINOR   0
 Minor Version number. More...
 
#define NVMEDIA_IMAGE_CAPTURE_TIMEOUT_INFINITE
 Defines an infinite time-out for NvMediaICPGetFrameEx. More...
 
#define NVMEDIA_ICP_MAX_VIRTUAL_GROUPS   4
 Defines the maximum number of virtual groups. More...
 
#define NVMEDIA_ICP_MAX_VIRTUAL_CHANNELS   3
 Defines the maximum number of virtual channels per virtual group. More...
 
#define NVMEDIA_ICP_HANDLER(icpEx, groupIdx)   (icpEx->icp[groupIdx].hIcp)
 Defines a macro that gets NvMediaICP handler from NvMediaICPEx handler. More...
 
#define NVMEDIA_ICP_SETTINGS_HANDLER(icpSettingsEx, groupIdx, vcIdx)   (&icpSettingsEx.virtualGroups[groupIdx].virtualChannels[vcIdx].icpSettings)
 Defines a macro that gets the NvMediaICPSettings handler from the NvMediaICPSettingsEx object. More...
 
#define NVMEDIA_ICP_ERROR(_type_, _error_, _value_, _desc_)   NVMEDIA_ICP_##_type_##_ERROR_##_error_ = _value_,
 

Typedefs

typedef void NvMediaICP
 Image capture object per virtual group. More...
 

Enumerations

enum  NvMediaICPInterfaceType {
  NVMEDIA_IMAGE_CAPTURE_CSI_INTERFACE_TYPE_CSI_A,
  NVMEDIA_IMAGE_CAPTURE_CSI_INTERFACE_TYPE_CSI_B,
  NVMEDIA_IMAGE_CAPTURE_CSI_INTERFACE_TYPE_CSI_AB,
  NVMEDIA_IMAGE_CAPTURE_CSI_INTERFACE_TYPE_CSI_C,
  NVMEDIA_IMAGE_CAPTURE_CSI_INTERFACE_TYPE_CSI_D,
  NVMEDIA_IMAGE_CAPTURE_CSI_INTERFACE_TYPE_CSI_CD,
  NVMEDIA_IMAGE_CAPTURE_CSI_INTERFACE_TYPE_CSI_E,
  NVMEDIA_IMAGE_CAPTURE_CSI_INTERFACE_TYPE_CSI_F,
  NVMEDIA_IMAGE_CAPTURE_CSI_INTERFACE_TYPE_CSI_EF
}
 Determines the image capture interface type for CSI interface. More...
 
enum  NvMediaICPInputFormatType {
  NVMEDIA_IMAGE_CAPTURE_INPUT_FORMAT_TYPE_YUV422,
  NVMEDIA_IMAGE_CAPTURE_INPUT_FORMAT_TYPE_YUV444,
  NVMEDIA_IMAGE_CAPTURE_INPUT_FORMAT_TYPE_RGB888,
  NVMEDIA_IMAGE_CAPTURE_INPUT_FORMAT_TYPE_RAW6,
  NVMEDIA_IMAGE_CAPTURE_INPUT_FORMAT_TYPE_RAW7,
  NVMEDIA_IMAGE_CAPTURE_INPUT_FORMAT_TYPE_RAW8,
  NVMEDIA_IMAGE_CAPTURE_INPUT_FORMAT_TYPE_RAW10,
  NVMEDIA_IMAGE_CAPTURE_INPUT_FORMAT_TYPE_RAW12,
  NVMEDIA_IMAGE_CAPTURE_INPUT_FORMAT_TYPE_RAW14,
  NVMEDIA_IMAGE_CAPTURE_INPUT_FORMAT_TYPE_USER_DEFINED_1,
  NVMEDIA_IMAGE_CAPTURE_INPUT_FORMAT_TYPE_USER_DEFINED_2,
  NVMEDIA_IMAGE_CAPTURE_INPUT_FORMAT_TYPE_USER_DEFINED_3,
  NVMEDIA_IMAGE_CAPTURE_INPUT_FORMAT_TYPE_USER_DEFINED_4,
  NVMEDIA_IMAGE_CAPTURE_INPUT_FORMAT_TYPE_USER_DEFINED_5,
  NVMEDIA_IMAGE_CAPTURE_INPUT_FORMAT_TYPE_USER_DEFINED_6,
  NVMEDIA_IMAGE_CAPTURE_INPUT_FORMAT_TYPE_USER_DEFINED_7,
  NVMEDIA_IMAGE_CAPTURE_INPUT_FORMAT_TYPE_USER_DEFINED_8
}
 Determines the image capture input format type. More...
 
enum  NvMediaICPErrorStatus
 Capture error status. More...
 

Functions

NvMediaStatus NvMediaICPGetVersion (NvMediaVersion *version)
 Checks the version compatibility for the NvMedia ICP library. More...
 
NvMediaICPExNvMediaICPCreateEx (NvMediaICPSettingsEx *settings)
 Creates an image capture object used to capture various formats of input into an NvMediaImage. More...
 
void NvMediaICPDestroyEx (NvMediaICPEx *icpEx)
 Destroys the image capture object created by NvMediaICPCreateEx. More...
 
NvMediaStatus NvMediaICPFeedFrame (NvMediaICP *icp, NvMediaImage *image, uint32_t millisecondTimeout)
 Adds an image to the image capture pool. More...
 
NvMediaStatus NvMediaICPFeedImageGroup (NvMediaICP *icp, NvMediaImageGroup *imageGrp, unsigned int millisecondTimeout)
 Adds an image group to the image capture pool. More...
 
NvMediaStatus NvMediaICPStop (NvMediaICP *icp)
 Stops the capture. More...
 
NvMediaStatus NvMediaICPGetFrameEx (NvMediaICP *icp, uint32_t millisecondTimeout, NvMediaImage **image)
 Gets a captured frame with frame status. More...
 
NvMediaStatus NvMediaICPGetImageGroup (NvMediaICP *icp, uint32_t millisecondTimeout, NvMediaImageGroup *imageGrp)
 Gets a captured image group with frame status. More...
 
NvMediaStatus NvMediaICPReleaseFrame (NvMediaICP *icp, NvMediaImage **image)
 Gets a frame from the internal pool that user fed with NvMediaICPFeedFrame after HW gives up to capture. More...
 
NvMediaStatus NvMediaICPReleaseImageGroup (NvMediaICP *icp, NvMediaImageGroup *imageGrp)
 Gets an image group from the internal pool that user fed with NvMediaICPFeedImageGroup after HW gives up to capture. More...
 
NvMediaStatus NvMediaICPGetErrorInfo (NvMediaICP *icp, NvMediaICPErrorInfo *icpErrorInfo)
 Gets the capture error information. More...
 

Macro Definition Documentation

#define NVMEDIA_ICP_ERROR (   _type_,
  _error_,
  _value_,
  _desc_ 
)    NVMEDIA_ICP_##_type_##_ERROR_##_error_ = _value_,

Definition at line 73 of file nvmedia_icp.h.

#define NVMEDIA_ICP_HANDLER (   icpEx,
  groupIdx 
)    (icpEx->icp[groupIdx].hIcp)

Defines a macro that gets NvMediaICP handler from NvMediaICPEx handler.

Parameters
[in]icpExThe NvMediaICPEx handler returned from NvMediaICPCreateEx.
[in]groupIdxThe index of the capture group instance.

Definition at line 62 of file nvmedia_icp.h.

#define NVMEDIA_ICP_MAX_VIRTUAL_CHANNELS   3

Defines the maximum number of virtual channels per virtual group.

Definition at line 56 of file nvmedia_icp.h.

#define NVMEDIA_ICP_MAX_VIRTUAL_GROUPS   4

Defines the maximum number of virtual groups.

Definition at line 53 of file nvmedia_icp.h.

#define NVMEDIA_ICP_SETTINGS_HANDLER (   icpSettingsEx,
  groupIdx,
  vcIdx 
)    (&icpSettingsEx.virtualGroups[groupIdx].virtualChannels[vcIdx].icpSettings)

Defines a macro that gets the NvMediaICPSettings handler from the NvMediaICPSettingsEx object.

Parameters
[in]icpSettingsExNvMediaICPSettingsEx object passed to NvMediaICPCreateEx.
[in]groupIdxThe index of the capture group instance.
[in]vcIdxThe index of the capture virtual channel instance.

Definition at line 70 of file nvmedia_icp.h.

#define NVMEDIA_ICP_VERSION_MAJOR   4

Major Version number.

Definition at line 42 of file nvmedia_icp.h.

#define NVMEDIA_ICP_VERSION_MINOR   0

Minor Version number.

Definition at line 44 of file nvmedia_icp.h.

#define NVMEDIA_IMAGE_CAPTURE_TIMEOUT_INFINITE

Defines an infinite time-out for NvMediaICPGetFrameEx.

Definition at line 50 of file nvmedia_icp.h.

Typedef Documentation

typedef void NvMediaICP

Image capture object per virtual group.

Definition at line 212 of file nvmedia_icp.h.

Enumeration Type Documentation

Capture error status.

Definition at line 231 of file nvmedia_icp.h.

Determines the image capture input format type.

Enumerator
NVMEDIA_IMAGE_CAPTURE_INPUT_FORMAT_TYPE_YUV422 

Input format type : YUV 4:2:2.

NVMEDIA_IMAGE_CAPTURE_INPUT_FORMAT_TYPE_YUV444 

Input format type : YUV 4:4:4.

NVMEDIA_IMAGE_CAPTURE_INPUT_FORMAT_TYPE_RGB888 

Input format type : RGBA.

NVMEDIA_IMAGE_CAPTURE_INPUT_FORMAT_TYPE_RAW6 

Input format type: RAW 6.

NVMEDIA_IMAGE_CAPTURE_INPUT_FORMAT_TYPE_RAW7 

Input format type: RAW 7.

NVMEDIA_IMAGE_CAPTURE_INPUT_FORMAT_TYPE_RAW8 

Input format type: RAW 8.

NVMEDIA_IMAGE_CAPTURE_INPUT_FORMAT_TYPE_RAW10 

Input format type: RAW 10.

NVMEDIA_IMAGE_CAPTURE_INPUT_FORMAT_TYPE_RAW12 

Input format type: RAW 12.

NVMEDIA_IMAGE_CAPTURE_INPUT_FORMAT_TYPE_RAW14 

Input format type: RAW 14.

NVMEDIA_IMAGE_CAPTURE_INPUT_FORMAT_TYPE_USER_DEFINED_1 

Input format type : User defined 1 (0x30)

NVMEDIA_IMAGE_CAPTURE_INPUT_FORMAT_TYPE_USER_DEFINED_2 

Input format type : User defined 2 (0x31)

NVMEDIA_IMAGE_CAPTURE_INPUT_FORMAT_TYPE_USER_DEFINED_3 

Input format type : User defined 3 (0x32)

NVMEDIA_IMAGE_CAPTURE_INPUT_FORMAT_TYPE_USER_DEFINED_4 

Input format type : User defined 4 (0x33)

NVMEDIA_IMAGE_CAPTURE_INPUT_FORMAT_TYPE_USER_DEFINED_5 

Input format type : User defined 5 (0x34)

NVMEDIA_IMAGE_CAPTURE_INPUT_FORMAT_TYPE_USER_DEFINED_6 

Input format type : User defined 6 (0x35)

NVMEDIA_IMAGE_CAPTURE_INPUT_FORMAT_TYPE_USER_DEFINED_7 

Input format type : User defined 7 (0x36)

NVMEDIA_IMAGE_CAPTURE_INPUT_FORMAT_TYPE_USER_DEFINED_8 

Input format type : User defined 8 (0x37)

Definition at line 103 of file nvmedia_icp.h.

Determines the image capture interface type for CSI interface.

Enumerator
NVMEDIA_IMAGE_CAPTURE_CSI_INTERFACE_TYPE_CSI_A 

Interface: CSI, port: A.

NVMEDIA_IMAGE_CAPTURE_CSI_INTERFACE_TYPE_CSI_B 

Interface: CSI, port: B.

NVMEDIA_IMAGE_CAPTURE_CSI_INTERFACE_TYPE_CSI_AB 

Interface: CSI, port: AB.

NVMEDIA_IMAGE_CAPTURE_CSI_INTERFACE_TYPE_CSI_C 

Interface: CSI, port: C.

NVMEDIA_IMAGE_CAPTURE_CSI_INTERFACE_TYPE_CSI_D 

Interface: CSI, port: D.

NVMEDIA_IMAGE_CAPTURE_CSI_INTERFACE_TYPE_CSI_CD 

Interface: CSI, port: CD.

NVMEDIA_IMAGE_CAPTURE_CSI_INTERFACE_TYPE_CSI_E 

Interface: CSI, port: E.

NVMEDIA_IMAGE_CAPTURE_CSI_INTERFACE_TYPE_CSI_F 

Interface: CSI, port: F.

NVMEDIA_IMAGE_CAPTURE_CSI_INTERFACE_TYPE_CSI_EF 

Interface: CSI, port: EF.

Definition at line 79 of file nvmedia_icp.h.

Function Documentation

NvMediaICPEx* NvMediaICPCreateEx ( NvMediaICPSettingsEx settings)

Creates an image capture object used to capture various formats of input into an NvMediaImage.

The supported surfaces must be obtained by /ref NvMediaSurfaceFormatGetType with:

void NvMediaICPDestroyEx ( NvMediaICPEx icpEx)

Destroys the image capture object created by NvMediaICPCreateEx.

Parameters
[in]icpExA pointer to the image capture object to be destroyed.
Returns
void
NvMediaStatus NvMediaICPFeedFrame ( NvMediaICP icp,
NvMediaImage image,
uint32_t  millisecondTimeout 
)

Adds an image to the image capture pool.

The pool size is determined by NVMEDIA_MAX_CAPTURE_FRAME_BUFFERS.

Parameters
[in]icpThe image capture object to be used.
[in]imageThe image to be added to the pool.
[in]millisecondTimeoutTime-out in milliseconds
Returns
NvMediaStatus The completion status of the operation. Possible values are:
NVMEDIA_STATUS_OK
NVMEDIA_STATUS_ERROR
NVMEDIA_STATUS_TIMED_OUT
NvMediaStatus NvMediaICPFeedImageGroup ( NvMediaICP icp,
NvMediaImageGroup imageGrp,
unsigned int  millisecondTimeout 
)

Adds an image group to the image capture pool.

The pool size is determined by NVMEDIA_MAX_CAPTURE_FRAME_BUFFERS.

Parameters
[in]icpThe image capture object to be used.
[in]imageGrpThe NvMedia image group to be added to the pool.
[in]millisecondTimeoutTime-out in milliseconds
Returns
NvMediaStatus The completion status of the operation. Possible values are:
NVMEDIA_STATUS_OK
NVMEDIA_STATUS_ERROR
NVMEDIA_STATUS_TIMED_OUT
NvMediaStatus NvMediaICPGetErrorInfo ( NvMediaICP icp,
NvMediaICPErrorInfo icpErrorInfo 
)

Gets the capture error information.

This function provides the capture error details such as CSI stream id, frame ID & error status. The client can use the information to take a suitable action upon a CSI capture error.

Parameters
[in]icpA pointer to the image capture object to be used.
[in]icpErrorInfoA pointer to the structure where information is to be filled. The info structure will not provide a meaningful value unless the retuned status is NVMEDIA_STATUS_OK
Returns
NvMediaStatus The completion status of the operation. Possible values are:
NVMEDIA_STATUS_OK if info is populated and can be read
NVMEDIA_STATUS_BAD_PARAMETER if icp or icpErrorInfo is NULL
NvMediaStatus NvMediaICPGetFrameEx ( NvMediaICP icp,
uint32_t  millisecondTimeout,
NvMediaImage **  image 
)

Gets a captured frame with frame status.

This function blocks until a frame is available or until the timeout (in milliseconds) has been reached. To block without a timeout, specify NVMEDIA_IMAGE_CAPTURE_TIMEOUT_INFINITE for millisecondTimeout. The returned NvMediaImage should be passed back to the NvMediaICP object using NvMediaICPFeedFrame after it has been processed if more image capture are required. NvMediaImage gets NULL if image capture object does not have sufficient buffers in the internal pool, meaning that too few NvMediaImage have been added to the capture object pool. When NvMediaICPGetFrameEx returns an NvMediaImage, that image is idle and ready for immediate use.

Parameters
[in]icpThe image capture object to be used.
[in]millisecondTimeoutTime-out in milliseconds
[in,out]imageThe image is ready for use.
Returns
NvMediaStatus The completion status of the operation.
NVMEDIA_STATUS_OK : image has valid value, it is good to use.
NVMEDIA_STATUS_NONE_PENDING : image is NULL, there is no fed frame, internel pool is empty.
NVMEDIA_STATUS_TIMED_OUT : image is NULL, the frame is not ready for use.
NVMEDIA_STATUS_ERROR : image is NULL, HW gives up to capture anymore. Please remove the frames from pool using NvMediaICPReleaseFrame.
NvMediaStatus NvMediaICPGetImageGroup ( NvMediaICP icp,
uint32_t  millisecondTimeout,
NvMediaImageGroup imageGrp 
)

Gets a captured image group with frame status.

This function blocks until a frame is available or until the timeout (in milliseconds) has been reached. To block without a timeout, specify NVMEDIA_IMAGE_CAPTURE_TIMEOUT_INFINITE for millisecondTimeout.

Parameters
[in]icpThe image capture object to be used.
[in]millisecondTimeoutTime-out in milliseconds
[in,out]imageGrpThe NvMedia image group is ready for use.
Returns
NvMediaStatus The completion status of the operation.
NVMEDIA_STATUS_OK : image has valid value, it is good to use.
NVMEDIA_STATUS_NONE_PENDING : image is NULL, there is no fed frame, internel pool is empty.
NVMEDIA_STATUS_TIMED_OUT : image is NULL, the frame is not ready for use.
NVMEDIA_STATUS_ERROR : image is NULL, HW gives up to capture anymore.
NvMediaStatus NvMediaICPGetVersion ( NvMediaVersion version)

Checks the version compatibility for the NvMedia ICP library.

Parameters
[in]versionA pointer to a NvMediaVersion structure of the client.
Returns
NvMediaStatus The status of the operation. Possible values are:
NVMEDIA_STATUS_OK
NVMEDIA_STATUS_BAD_PARAMETER if the pointer is invalid.
NVMEDIA_STATUS_INCOMPATIBLE_VERSION if the client version does not match with the core version.
NvMediaStatus NvMediaICPReleaseFrame ( NvMediaICP icp,
NvMediaImage **  image 
)

Gets a frame from the internal pool that user fed with NvMediaICPFeedFrame after HW gives up to capture.

This function should be called until getting NVMEDIA_STATUS_ERROR.

Parameters
[in]icpThe image capture object to be used.
[in]imageThe image was fed from user but HW gives up to capture.
Returns
NvMediaStatus The completion status of the operation.
NVMEDIA_STATUS_OK : returning the frame that user fed.
NVMEDIA_STATUS_ERROR : nothing to return.
NvMediaStatus NvMediaICPReleaseImageGroup ( NvMediaICP icp,
NvMediaImageGroup imageGrp 
)

Gets an image group from the internal pool that user fed with NvMediaICPFeedImageGroup after HW gives up to capture.

This function should be called until getting NVMEDIA_STATUS_ERROR.

Parameters
[in]icpThe image capture object to be used.
[in]imageGrpThe image group was fed from user but HW gives up to capture.
Returns
NvMediaStatus The completion status of the operation.
NVMEDIA_STATUS_OK : returning the frame that user fed.
NVMEDIA_STATUS_ERROR : nothing to return.
NvMediaStatus NvMediaICPStop ( NvMediaICP icp)

Stops the capture.

This function disables CSI to reject the packet from CSI FIFO so CSI does not report false alarms while finishing up the user application. NvMediaICPStop returns NVMEDIA_STATUS_ERROR when there are images in the image capture pool. In this case, to stop the capture, call NvMediaICPGetFrameEx to get the last image.

Parameters
[in]icpA pointer to the image capture object to be used.
Returns
NvMediaStatus The completion status of the operation. Possible values are:
NVMEDIA_STATUS_OK
NVMEDIA_STATUS_BAD_PARAMETER if icp is NULL
NVMEDIA_STATUS_ERROR if the image capture pool is not empty yet.