![]() |
NVIDIA DRIVE OS Linux SDK API Reference5.1.6.0 Release |
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 only a specific type of uncompressed image data. This type must be specified during creation.
Data Structures | |
struct | NvMediaICPInputFormat |
Holds the 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 per virtual group. More... | |
struct | NvMediaICPEx |
Holds an 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 16 |
Minor version number. More... | |
#define | NVMEDIA_IMAGE_CAPTURE_TIMEOUT_INFINITE |
Defines an infinite timeout for NvMediaICPGetImageGroup(). More... | |
#define | NVMEDIA_ICP_MAX_VIRTUAL_GROUPS 4u |
Defines the maximum number of virtual groups. More... | |
#define | NVMEDIA_ICP_MAX_VIRTUAL_CHANNELS 3u |
Defines the maximum number of virtual channels per virtual group. More... | |
#define | NVMEDIA_ICP_HANDLER(icpEx, groupIdx) (icpEx->icp[groupIdx].hIcp) |
A macro that gets an NvMediaICP handler from an NvMediaICPEx handler. More... | |
#define | NVMEDIA_ICP_SETTINGS_HANDLER(icpSettingsEx, groupIdx, vcIdx) (&icpSettingsEx.virtualGroups[groupIdx].virtualChannels[vcIdx].icpSettings) |
A macro that gets the NvMediaICPSettings handler from an NvMediaICPSettingsEx object. More... | |
#define | NVMEDIA_ICP_ERROR(_type_, _error_, _value_, _desc_) NVMEDIA_ICP_##_type_##_ERROR_##_error_ = _value_##u, |
A macro that creates an enumerator in enum NvMediaICPErrorStatus. More... | |
#define | NVMEDIA_MAX_ICP_FRAME_BUFFERS |
Maximum number of capture buffers. More... | |
Typedefs | |
typedef struct NvMediaICP | NvMediaICP |
Holds an image capture object per virtual group. More... | |
Functions | |
NvMediaStatus | NvMediaICPGetVersion (NvMediaVersion *version) |
Checks version compatibility for the NvMedia ICP library. More... | |
NvMediaICPEx * | NvMediaICPCreateEx (NvMediaICPSettingsEx *settings) |
Creates an image capture object used to capture various formats of input into an NvMediaImage. More... | |
void | NvMediaICPDestroyEx (NvMediaICPEx *icpEx) |
Destroys an image capture object created by NvMediaICPCreateEx(). More... | |
NvMediaStatus | NvMediaICPRegisterImageGroup (NvMediaICP *icp, NvMediaImageGroup *imageGrp) |
Maps a frame to the capture engine. 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 hardware engine from capturing the image. More... | |
NvMediaStatus | NvMediaICPResume (NvMediaICP *icp) |
Resumes a stopped image capture operation. More... | |
NvMediaStatus | NvMediaICPGetImageGroup (NvMediaICP *icp, uint32_t millisecondTimeout, NvMediaImageGroup **imageGrp) |
Gets a captured image group with frame status. More... | |
NvMediaStatus | NvMediaICPUnregisterImageGroup (NvMediaICP *icp, NvMediaImageGroup *imageGrp) |
Unmaps a frame from the capture engine. More... | |
NvMediaStatus | NvMediaICPReleaseImageGroup (NvMediaICP *icp, NvMediaImageGroup **imageGrp) |
Gets an image group from the internal pool that the client previously supplied with NvMediaICPFeedImageGroup(). More... | |
NvMediaStatus | NvMediaICPGetErrorInfo (NvMediaICP *icp, NvMediaICPErrorInfo *icpErrorInfo) |
Gets capture error information. More... | |
NvMediaStatus | NvMediaICPWaitForSoF (NvMediaICP *icp) NVM_DEPRECATED_MSG("Use NvMediaICPGetSOFNvSciSyncFence") |
Waits for next SoF (Start of Frame). More... | |
#define NVMEDIA_ICP_ERROR | ( | _type_, | |
_error_, | |||
_value_, | |||
_desc_ | |||
) | NVMEDIA_ICP_##_type_##_ERROR_##_error_ = _value_##u, |
A macro that creates an enumerator in enum NvMediaICPErrorStatus.
_type_ | The hardware module that originated the error: CSI or VI. |
_error_ | A symbolic code that represents the error; used to construct the enumerator's symbol. |
_value_ | A numeric value that represents nth bit field. |
_desc_ | A string that describes the error. |
Definition at line 82 of file nvmedia_icp.h.
#define NVMEDIA_ICP_HANDLER | ( | icpEx, | |
groupIdx | |||
) | (icpEx->icp[groupIdx].hIcp) |
A macro that gets an NvMediaICP handler from an NvMediaICPEx handler.
[in] | icpEx | An NvMediaICPEx handler returned by NvMediaICPCreateEx(). |
[in] | groupIdx | The index of the capture group instance. |
Definition at line 63 of file nvmedia_icp.h.
#define NVMEDIA_ICP_MAX_VIRTUAL_CHANNELS 3u |
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 4u |
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) |
A macro that gets the NvMediaICPSettings handler from an NvMediaICPSettingsEx object.
[in] | icpSettingsEx | An NvMediaICPSettingsEx object passed to NvMediaICPCreateEx(). |
[in] | groupIdx | The index of the capture group instance. |
[in] | vcIdx | The index of the capture virtual channel instance. |
Definition at line 72 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 16 |
Minor version number.
Definition at line 44 of file nvmedia_icp.h.
#define NVMEDIA_IMAGE_CAPTURE_TIMEOUT_INFINITE |
Defines an infinite timeout for NvMediaICPGetImageGroup().
Definition at line 50 of file nvmedia_icp.h.
#define NVMEDIA_MAX_ICP_FRAME_BUFFERS |
Maximum number of capture buffers.
Definition at line 89 of file nvmedia_icp.h.
typedef struct NvMediaICP NvMediaICP |
Holds an image capture object per virtual group.
Definition at line 379 of file nvmedia_icp.h.
enum NvMediaBitsPerPixel |
Specifies bits per pixel.
Definition at line 170 of file nvmedia_icp.h.
Defines error status codes that specify the meanings of the "masked" bits in NvMediaICPSettings::csiErrorMask, and the "non-correctable" bits in NvMediaICPSettings::csiErrorType.
Definition at line 297 of file nvmedia_icp.h.
Definition at line 476 of file nvmedia_icp.h.
Definition at line 491 of file nvmedia_icp.h.
enum NvMediaICPCsiPhyMode |
Specifies the CSI phy mode.
Enumerator | |
---|---|
NVMEDIA_ICP_CSI_DPHY_MODE | |
NVMEDIA_ICP_CSI_CPHY_MODE |
Definition at line 199 of file nvmedia_icp.h.
Defines error status codes.
Enumerators are defined by the NVMEDIA_ICP_ERROR macro. In the following table, Module, Type, and Code represent macro parameters. For example:
Module | Type | Code | Manifest Constant | Description |
---|---|---|---|---|
n/a | NONE | 0 | NVMEDIA_ICP_CAPTURE_ERROR_NONE | No error occurred, or error could not be translated. |
CSI mux frame errors | ||||
CSI | FE_CSI_FAULT | 6 | NVMEDIA_ICP_CSI_ERROR_FE_CSI_FAULT | NVCSI fault received at frame end. |
CSI | FS_FAULT | 7 | NVMEDIA_ICP_CSI_ERROR_FS_FAULT | Frame start occurred before previous frame end. |
CSI | FE_FRAMEID_FAULT | 8 | NVMEDIA_ICP_CSI_ERROR_FE_FRAMEID_FAULT | Frame ID for FE packet does not match that of FS packet. |
CSI | FE_FORCED_FAULT | 9 | NVMEDIA_ICP_CSI_ERROR_FE_FORCED_FAULT | Frame end was injected by the CSI hardware. |
CSI | PXL_ENABLE_FAULT | 10 | NVMEDIA_ICP_CSI_ERROR_PXL_ENABLE_FAULT | Illegal pixel encoding detected. |
CSI | PP_FSM_TIMEOUT | 20 | NVMEDIA_ICP_CSI_ERROR_PP_FSM_TIMEOUT | Pixel Parser FSM timeout. |
CSI | PP_ECC_DPHY | 21 | NVMEDIA_ICP_CSI_ERROR_PP_ECC_DPHY | Single bit error correction code in DPHY packet header. |
CSI | PAYLOAD_CRC | 22 | NVMEDIA_ICP_CSI_ERROR_PAYLOAD_CRC | Packet payload CRC check failure. |
CSI | LINE_SHORT | 23 | NVMEDIA_ICP_CSI_ERROR_LINE_SHORT | Packet payload is less than word count in packet header. |
CSI | PH_CRC_CPHY | 24 | NVMEDIA_ICP_CSI_ERROR_PH_CRC_CPHY | One of the CPHY packet headers contained a CRC error. |
CSI | EMB_CRC | 25 | NVMEDIA_ICP_CSI_ERROR_EMB_CRC | Embedded line CRC error. |
CSI mux stream errors | ||||
CSI | SPURIOUS_DATA | 0 | NVMEDIA_ICP_CSI_ERROR_SPURIOUS_DATA | FIFO data was found in the gap between frame start and frame end. |
CSI | FIFO_OVERFLOW | 1 | NVMEDIA_ICP_CSI_ERROR_FIFO_OVERFLOW | An overflow occurred in a stream FIFO. |
CSI | FIFO_LOF | 2 | NVMEDIA_ICP_CSI_ERROR_FIFO_LOF | A loss of frame overflow occurred. |
CSI | FIFO_BADPKT | 3 | NVMEDIA_ICP_CSI_ERROR_FIFO_BADPKT | An unknown packet type has been received on a stream. |
VI channel selection faults | ||||
VI | FS_TIMEOUT | 0 | NVMEDIA_ICP_VI_ERROR_FS_TIMEOUT | Frame start timeout error. |
VI | FE_TIMEOUT | 1 | NVMEDIA_ICP_VI_ERROR_FE_TIMEOUT | Frame end timeout error. |
VI | PXL_MISSING_LE | 5 | NVMEDIA_ICP_VI_ERROR_PXL_MISSING_LE | Two LS packets detected without an LE packet between them. |
VI | PXL_RUNAWAY | 6 | NVMEDIA_ICP_VI_ERROR_PXL_RUNAWAY | More lines received than expected. |
VI | PXL_SPURIOUS | 7 | NVMEDIA_ICP_VI_ERROR_PXL_SPURIOUS | Pixel data packet was received without an LS packet first. |
VI | PXL_LONG_LINE | 8 | NVMEDIA_ICP_VI_ERROR_PXL_LONG_LINE | More pixels received than expected in a line. |
VI | PXL_SHORT_LINE | 9 | NVMEDIA_ICP_VI_ERROR_PXL_SHORT_LINE | Fewer pixels received than expected in a line. |
VI | EMB_MISSING_LE | 10 | NVMEDIA_ICP_VI_ERROR_EMB_MISSING_LE | Two LS packets detected without an LE packet between them in emb data. |
VI | EMB_RUNAWAY | 11 | NVMEDIA_ICP_VI_ERROR_EMB_RUNAWAY | More lines received than expected in emb data. |
VI | EMB_SPURIOUS | 12 | NVMEDIA_ICP_VI_ERROR_EMB_SPURIOUS | Pixel data packet received without an LS packet first in emb data. |
VI | EMB_LONG_LINE | 13 | NVMEDIA_ICP_VI_ERROR_EMB_LONG_LINE | More pixels received than expected in a line in emb data. |
VI | EMB_INFRINGE | 14 | NVMEDIA_ICP_VI_ERROR_EMB_INFRINGE | Embedded data received on a frame where no embedded data was expected. |
VI | DTYPE_MISMATCH | 15 | NVMEDIA_ICP_VI_ERROR_DTYPE_MISMATCH | Pixel datatype changed in the middle of a line. |
VI | FORCED_FE | 16 | NVMEDIA_ICP_VI_ERROR_FORCED_FE | FE didn't arrive within expected frame duration, capture engine injected FE. |
VI | PXL_INCOMPLETE | 17 | NVMEDIA_ICP_VI_ERROR_PXL_INCOMPLETE, | Fewer lines of pixels in a frame were received than expected. |
VI | EMB_INCOMPLETE | 18 | NVMEDIA_ICP_VI_ERROR_EMB_INCOMPLETE, | Fewer lines of emb data in a frame were received than expected. |
VI | PFSD_FAULT | 19 | NVMEDIA_ICP_VI_ERROR_PFSD_FAULT, | Permanent Fault Software Diagnostic was detected from engine status. |
VI channel frame faults | ||||
VI | SHORT_FRAME | 0 | NVMEDIA_ICP_VI_ERROR_SHORT_FRAME | FE packet arrived before the normal number of pixels appeared. |
VI | SHORT_EMB | 1 | NVMEDIA_ICP_VI_ERROR_SHORT_EMB | FE of EMB Data packet arrived before the normal number of pixels appeared. |
VI | PFSD_FAULT_NOTIFIED | 2 | NVMEDIA_ICP_VI_ERROR_PFSD_FAULT_NOTIFIED | Permanent Fault Software Diagnostic was detected between frames. |
VI | FAULT_FE | 3 | NVMEDIA_ICP_VI_ERROR_FAULT_FE | FE was inserted due to a stream reset or early abort. |
VI | NOMATCH | 4 | NVMEDIA_ICP_VI_ERROR_NOMATCH | CSI packets were discarded due to no matched capture channels. |
VI | COLLISION | 5 | NVMEDIA_ICP_VI_ERROR_COLLISION | An FS packet matched a channel which was not finished processing a previous matching frame. |
VI | LOAD_FRAMED | 6 | NVMEDIA_ICP_VI_ERROR_LOAD_FRAMED | A LOAD command was received for a channel that was currently in a frame. |
VI memory write faults | ||||
VI | PACKET_OVERFLOW | 0 | NVMEDIA_ICP_VI_ERROR_PACKET_OVERFLOW | The FIFO for a surface packer overflowed. |
VI | FRAME_TRUNCATED | 1 | NVMEDIA_ICP_VI_ERROR_FRAME_TRUNCATED | A packer dropped a partial frame. |
VI | FRAME_TOSSED | 2 | NVMEDIA_ICP_VI_ERROR_FRAME_TOSSED | A packer dropped an entire frame. |
Specifies top-level image capture error types.
The error bits represented by the NvMediaICPCsiInput... enums provide additional detail about individual errors. For example, the NvMediaICPCsiInputStreamError error bits provide additional detail about the NVMEDIA_ICP_ERROR_STATUS_CSI_INPUTFRAME error.
Definition at line 466 of file nvmedia_icp.h.
Definition at line 521 of file nvmedia_icp.h.
Specifies the image capture input format type.
Definition at line 124 of file nvmedia_icp.h.
Specifies the image capture interface type for the CSI interface.
Definition at line 94 of file nvmedia_icp.h.
Definition at line 532 of file nvmedia_icp.h.
Definition at line 500 of file nvmedia_icp.h.
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 NvMediaSurfaceFormatGetType() with:
[in] | settings | A pointer to the settings for the capture. |
void NvMediaICPDestroyEx | ( | NvMediaICPEx * | icpEx | ) |
Destroys an image capture object created by NvMediaICPCreateEx().
[in] | icpEx | A pointer to the image capture object to be destroyed. |
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_ICP_FRAME_BUFFERS.
[in] | icp | The image capture object to be used. |
[in] | imageGrp | The NvMedia image group to be added to the pool. |
[in] | millisecondTimeout | A timeout in milliseconds. Represents time elapsed from the VI hardware start of processing the capture request to the time when a frame start occurs. It helps catch frame errors early, before the capture completion timeout. Take care when programming the frame start timeout for the first frame, for which the time required to set up the sensor to start streaming must be included. |
NVMEDIA_STATUS_OK | indicates that the operation was successful. |
NVMEDIA_STATUS_TIMED_OUT | indicates that the operation timed out. |
NVMEDIA_STATUS_ERROR | indicates any other error. |
NvMediaStatus NvMediaICPGetErrorInfo | ( | NvMediaICP * | icp, |
NvMediaICPErrorInfo * | icpErrorInfo | ||
) |
Gets capture error information.
This function provides capture error details such as CSI stream ID, frame ID, and error status. You can use this information to determine a suitable response to a CSI capture error.
[in] | icp | A pointer to the image capture object to be used. |
[out] | icpErrorInfo | A pointer to the structure where information is to be put. |
NVMEDIA_STATUS_OK | indicates that the operation was successful. |
NVMEDIA_STATUS_BAD_PARAMETER | indicates that icp or icpErrorInfo was NULL, and thus no error information is returned. |
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 a timeout occurs.
[in] | icp | A pointer to the image capture object to be used. |
[in] | millisecondTimeout | Timeout in milliseconds. To block without a timeout, specify NVMEDIA_IMAGE_CAPTURE_TIMEOUT_INFINITE. |
[in,out] | imageGrp | An indirect pointer to the NvMedia image group that is ready for use. |
NVMEDIA_STATUS_OK | indicates that the image is valid. |
NVMEDIA_STATUS_NONE_PENDING | indicates that image is NULL, there is no fed frame, or the internal pool is empty. |
NVMEDIA_STATUS_TIMED_OUT | indicates that image is NULL because the frame is not ready for use. |
NVMEDIA_STATUS_ERROR | indicates that image is NULL because the hardware engine has stopped trying to capture images. |
NvMediaStatus NvMediaICPGetVersion | ( | NvMediaVersion * | version | ) |
Checks version compatibility for the NvMedia ICP library.
[in] | version | A pointer to a version information structure that describes ICP versions compatible with the client. |
NVMEDIA_STATUS_OK | indicates that the ICP library is compatible with the client. |
NVMEDIA_STATUS_BAD_PARAMETER | indicates that version is invalid. |
NVMEDIA_STATUS_INCOMPATIBLE_VERSION | indicates that the ICP library is not compatible with the client. |
NvMediaStatus NvMediaICPRegisterImageGroup | ( | NvMediaICP * | icp, |
NvMediaImageGroup * | imageGrp | ||
) |
Maps a frame to the capture engine.
[in] | icp | A pointer to the image capture object to be used. |
[in] | imageGrp | A pointer to the NvMedia image group to be mapped to the capture engine. |
NvMediaStatus NvMediaICPReleaseImageGroup | ( | NvMediaICP * | icp, |
NvMediaImageGroup ** | imageGrp | ||
) |
Gets an image group from the internal pool that the client previously supplied with NvMediaICPFeedImageGroup().
After the hardware engine abandons a capture, call this function repeatedly until it returns NVMEDIA_STATUS_ERROR.
[in] | icp | A pointer to the image capture object to be used. |
[in,out] | imageGrp | The image group that was fed from user but hardware gives up to capture. |
NVMEDIA_STATUS_OK | indicates that the function has returned the image group that the user fed. |
NVMEDIA_STATUS_ERROR | indicates that an error occurred while returning the image group. |
NVMEDIA_STATUS_NONE_PENDING | indicates that there is nothing to return. |
NvMediaStatus NvMediaICPResume | ( | NvMediaICP * | icp | ) |
Resumes a stopped image capture operation.
[in] | icp | A pointer to the image capture object to be used. |
NVMEDIA_STATUS_OK | indicates that the operation was successful. |
NVMEDIA_STATUS_BAD_PARAMETER | indicates that icp was NULL. |
NVMEDIA_STATUS_ERROR | indicates that the capture engine was not stopped. |
NvMediaStatus NvMediaICPStop | ( | NvMediaICP * | icp | ) |
Stops the hardware engine from capturing the image.
To restart image capture:
[in] | icp | A pointer to the image capture object to be used. |
NVMEDIA_STATUS_OK | indicates that the operation was successful. |
NVMEDIA_STATUS_BAD_PARAMETER | indicates that icp is NULL. |
NVMEDIA_STATUS_ERROR | indicates that the image capture pool is not empty yet. |
NvMediaStatus NvMediaICPUnregisterImageGroup | ( | NvMediaICP * | icp, |
NvMediaImageGroup * | imageGrp | ||
) |
Unmaps a frame from the capture engine.
[in] | icp | A pointer to the image capture object to be used. |
[in] | imageGrp | A pointer to the NvMedia image group to be unmapped. |
NvMediaStatus NvMediaICPWaitForSoF | ( | NvMediaICP * | icp | ) |
Waits for next SoF (Start of Frame).
The function blocks until it receives the next SoF event.
[in] | icp | A pointer to the image capture object to be used. |
NVMEDIA_STATUS_OK | indicates that a SoF has been received. |
NVMEDIA_STATUS_BAD_PARAMETER | indicates that icp was NULL. |
NVMEDIA_STATUS_NONE_PENDING | indicates that there was no fed frame, and so the internal capture pool was empty. |
NVMEDIA_STATUS_ERROR | indicates that another error occurred while the function was waiting for SoF. |