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 22 |
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... | |
#define | NVMEDIA_ICP_MIN_IMAGE_WIDTH 640u |
Defines the minimum supported image width. More... | |
#define | NVMEDIA_ICP_MAX_IMAGE_WIDTH 3848u |
Defines the maximum supported image width. More... | |
#define | NVMEDIA_ICP_MIN_IMAGE_HEIGHT 480u |
Defines the minimum supported image height. More... | |
#define | NVMEDIA_ICP_MAX_IMAGE_HEIGHT 2168u |
Defines the maximum supported image height. More... | |
#define | NVMEDIA_ICP_MIN_FRAME_RATE 10U |
Defines the minimum supported frame rate. More... | |
#define | NVMEDIA_ICP_MAX_FRAME_RATE 60U |
Defines the maximum supported frame rate. More... | |
#define | NVMEDIA_ICP_MAX_EMBEDDED_LINES 256u |
Defines the maximum number of embedded lines supported. More... | |
Typedefs | |
typedef struct NvMediaICP | NvMediaICP |
Holds an image capture object per virtual group. More... | |
Functions | |
NvMediaStatus | NvMediaICPGetVersion (NvMediaVersion *version) |
Gets the version of 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 (const NvMediaICP *icp, const NvMediaImageGroup *imageGrp) |
Maps an image group to the capture engine. More... | |
NvMediaStatus | NvMediaICPFeedImageGroup (const NvMediaICP *icp, NvMediaImageGroup *imageGrp, uint32_t millisecondTimeout) |
Adds an image group to the image capture pool. More... | |
NvMediaStatus | NvMediaICPGetImageGroup (const NvMediaICP *icp, uint32_t millisecondTimeout, NvMediaImageGroup **imageGrp) |
Gets a captured image group with frame status. More... | |
NvMediaStatus | NvMediaICPUnregisterImageGroup (const NvMediaICP *icp, const NvMediaImageGroup *imageGrp) |
Unmaps an image group from the capture engine. More... | |
NvMediaStatus | NvMediaICPGetErrorInfo (const NvMediaICP *icp, NvMediaICPErrorInfo *icpErrorInfo) |
Gets capture error information. More... | |
NvMediaStatus | NvMediaICPReleaseImageGroup (const NvMediaICP *icp, NvMediaImageGroup **imageGrp) NVM_DEPRECATED_MSG("Use NvMediaICPGetImageGroup") |
Gets an image group from the internal pool that the client previously supplied with NvMediaICPFeedImageGroup(). 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_EMBEDDED_LINES 256u |
Defines the maximum number of embedded lines supported.
Definition at line 120 of file nvmedia_icp.h.
#define NVMEDIA_ICP_MAX_FRAME_RATE 60U |
Defines the maximum supported frame rate.
Definition at line 107 of file nvmedia_icp.h.
#define NVMEDIA_ICP_MAX_IMAGE_HEIGHT 2168u |
Defines the maximum supported image height.
Definition at line 101 of file nvmedia_icp.h.
#define NVMEDIA_ICP_MAX_IMAGE_WIDTH 3848u |
Defines the maximum supported image width.
Definition at line 95 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_MIN_FRAME_RATE 10U |
Defines the minimum supported frame rate.
Definition at line 104 of file nvmedia_icp.h.
#define NVMEDIA_ICP_MIN_IMAGE_HEIGHT 480u |
Defines the minimum supported image height.
Definition at line 98 of file nvmedia_icp.h.
#define NVMEDIA_ICP_MIN_IMAGE_WIDTH 640u |
Defines the minimum supported image width.
Definition at line 92 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 22 |
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 351 of file nvmedia_icp.h.
enum NvMediaBitsPerPixel |
Specifies bits per pixel.
Definition at line 204 of file nvmedia_icp.h.
Definition at line 448 of file nvmedia_icp.h.
Definition at line 463 of file nvmedia_icp.h.
enum NvMediaICPCsiPhyMode |
Specifies the CSI phy mode.
Enumerator | |
---|---|
NVMEDIA_ICP_CSI_DPHY_MODE | Specifies that CSI is in DPHY mode. |
NVMEDIA_ICP_CSI_CPHY_MODE | Specifies that CSI is in CPHY mode. |
Definition at line 245 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 | PH_ECC_DPHY | 21 | NVMEDIA_ICP_CSI_ERROR_PH_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 439 of file nvmedia_icp.h.
Definition at line 495 of file nvmedia_icp.h.
Specifies the image capture input format type.
Definition at line 157 of file nvmedia_icp.h.
Specifies the image capture interface type for the CSI interface.
Definition at line 127 of file nvmedia_icp.h.
Definition at line 506 of file nvmedia_icp.h.
Definition at line 474 of file nvmedia_icp.h.
NvMediaICPEx* NvMediaICPCreateEx | ( | NvMediaICPSettingsEx * | settings | ) |
Creates an image capture object used to capture various formats of input into an NvMediaImage.
[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 | ( | const NvMediaICP * | icp, |
NvMediaImageGroup * | imageGrp, | ||
uint32_t | millisecondTimeout | ||
) |
Adds an image group to the image capture pool.
The pool size is determined by NVMEDIA_MAX_ICP_FRAME_BUFFERS.
This function will do the following for each image in the image group:
[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. If this value is 0, timeout is infinite. 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. The imageGrp might still be used by the capture engine even if NVMEDIA_STATUS_OK is not returned. In this case, imageGrp must not be destroyed till NvMediaICPDestroyEx is called. |
NvMediaStatus NvMediaICPGetErrorInfo | ( | const 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. This function should be called after NvMediaICPGetFrameEx() to catch all error notifications.
[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. |
NvMediaStatus NvMediaICPGetImageGroup | ( | const NvMediaICP * | icp, |
uint32_t | millisecondTimeout, | ||
NvMediaImageGroup ** | imageGrp | ||
) |
Gets a captured image group with frame status.
This function blocks until an image group 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. |
NvMediaStatus NvMediaICPGetVersion | ( | NvMediaVersion * | version | ) |
Gets the version of the NvMedia ICP library.
The client should compare the version of the NvMedia ICP library with NVMEDIA_ICP_VERSION_MAJOR and NVMEDIA_ICP_VERSION_MINOR to ensure compatibility.
[out] | version | A pointer to a version information structure that the function will write the library version to. |
NvMediaStatus NvMediaICPRegisterImageGroup | ( | const NvMediaICP * | icp, |
const NvMediaImageGroup * | imageGrp | ||
) |
Maps an image group 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 | ( | const NvMediaICP * | icp, |
NvMediaImageGroup ** | imageGrp | ||
) |
Gets an image group from the internal pool that the client previously supplied with NvMediaICPFeedImageGroup().
[deprecated]
When the client needs to stop the capture channel, call this function repeatedly until it returns NVMEDIA_STATUS_NONE_PENDING
[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. |
NvMediaStatus NvMediaICPUnregisterImageGroup | ( | const NvMediaICP * | icp, |
const NvMediaImageGroup * | imageGrp | ||
) |
Unmaps an image group 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. |