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
nvmedia_icp.h
Go to the documentation of this file.
1 /*
2  * Copyright (c) 2014-2017, NVIDIA CORPORATION. All rights reserved. All
3  * information contained herein is proprietary and confidential to NVIDIA
4  * Corporation. Any use, reproduction, or disclosure without the written
5  * permission of NVIDIA Corporation is prohibited.
6  */
7 
15 #ifndef _NVMEDIA_ICP_H
16 #define _NVMEDIA_ICP_H
17 
18 #ifdef __cplusplus
19 extern "C" {
20 #endif
21 
22 #include "nvmedia_core.h"
23 #include "nvmedia_surface.h"
24 #include "nvmedia_image.h"
25 
42 #define NVMEDIA_ICP_VERSION_MAJOR 4
43 
44 #define NVMEDIA_ICP_VERSION_MINOR 0
45 
50 #define NVMEDIA_IMAGE_CAPTURE_TIMEOUT_INFINITE 0xFFFFFFFF
51 
53 #define NVMEDIA_ICP_MAX_VIRTUAL_GROUPS 4
54 
56 #define NVMEDIA_ICP_MAX_VIRTUAL_CHANNELS 3
57 
62 #define NVMEDIA_ICP_HANDLER(icpEx, groupIdx) (icpEx->icp[groupIdx].hIcp)
63 
70 #define NVMEDIA_ICP_SETTINGS_HANDLER(icpSettingsEx, groupIdx, vcIdx) \
71  (&icpSettingsEx.virtualGroups[groupIdx].virtualChannels[vcIdx].icpSettings)
72 
73 #define NVMEDIA_ICP_ERROR(_type_, _error_, _value_, _desc_) \
74  NVMEDIA_ICP_##_type_##_ERROR_##_error_ = _value_,
75 
79 typedef enum {
99 
103 typedef enum {
139 
143 typedef struct {
149 
153 typedef struct {
161  uint16_t width;
163  uint16_t height;
165  uint16_t startX;
167  uint16_t startY;
171  uint32_t interfaceLanes;
174  uint32_t pixelFrequency;
176  uint16_t thsSettle;
181  uint8_t tpgEnable;
183 
188 typedef struct {
192  uint32_t interfaceLanes;
193  struct {
194  struct {
195  /* Holds the virtual Channel Index from CSI TX. */
197  /* Holds the image capture settings for CSI format. */
199  /* Holds the clipping rectangle. */
201  } virtualChannels[NVMEDIA_ICP_MAX_VIRTUAL_CHANNELS];
204  } virtualGroups[NVMEDIA_ICP_MAX_VIRTUAL_GROUPS];
208 
212 typedef void NvMediaICP;
213 
217 typedef struct {
218  /* Holds the number of virtual groups used. */
220  struct {
221  /* Holds the virtual Group Index. */
222  uint16_t virtualGroupId;
223  /* Holds the image capture handler. */
224  NvMediaICP *hIcp;
226 } NvMediaICPEx;
227 
231 typedef enum {
232  /* Unrecognized or no errors */
233  NVMEDIA_ICP_ERROR(CAPTURE, NONE, 0x0000, "Either no error occurred or error could not be translated")
234 
235  /* CSI mux frame errors */
236  NVMEDIA_ICP_ERROR(CSI, FS_FAULT, 0x0001, "A frame start occurred before previous frame end")
237  NVMEDIA_ICP_ERROR(CSI, FE_CSI_FAULT, 0x0002, "A NVCSI fault received at frame end")
238  NVMEDIA_ICP_ERROR(CSI, FE_FRAMEID_FAULT, 0x0003, "Frame ID for FE packet does not match that of FS packet")
239  NVMEDIA_ICP_ERROR(CSI, FE_FORCED_FAULT, 0x0004, "A frame end was injected by the CSI hardware")
240  NVMEDIA_ICP_ERROR(CSI, PXL_ENABLE_FAULT , 0x0005, "An illegal pixel encoding has been detected")
241 
242  /* VI channel sel errors */
243  NVMEDIA_ICP_ERROR(VI, SHORT_FRAME, 0x0010, "FE packet arrived before the normal number of pixels has appeared ")
244  NVMEDIA_ICP_ERROR(VI, FAULT_FE, 0x0011, "Data specific fault occurred on a channel")
245 
246  /* VI channel sel faults */
247  NVMEDIA_ICP_ERROR(VI, PXL_MISSING_LE, 0x0100, "Two LS packets were detected without a LE packet between them")
248  NVMEDIA_ICP_ERROR(VI, PXL_RUNAWAY, 0x0101, "More lines were received than expected")
249  NVMEDIA_ICP_ERROR(VI, PXL_SPURIOUS, 0x0102, "A pixel data packet was received without a LS packet first")
250  NVMEDIA_ICP_ERROR(VI, PXL_LONG_LINE, 0x0103, "More pixels were received than expected in a line")
251  NVMEDIA_ICP_ERROR(VI, PXL_SHORT_LINE, 0x0104, "Fewer pixels were received than expected in a line")
252  NVMEDIA_ICP_ERROR(VI, EMB_MISSING_LE, 0x0105, "Two LS packets were detected without a LE packet between them in emb data")
253  NVMEDIA_ICP_ERROR(VI, EMB_RUNAWAY, 0x0106, "More lines were received than expected in emb data")
254  NVMEDIA_ICP_ERROR(VI, EMB_SPURIOUS, 0x0107, "A pixel data packet was received without a LS packet first in emb data")
255  NVMEDIA_ICP_ERROR(VI, EMB_LONG_LINE, 0x0108, "More pixels were received than expected in a line in emb data")
256  NVMEDIA_ICP_ERROR(VI, EMB_INFRINGE, 0x0109, "Embedded data was received on a frame where no embedded data was expected")
257  NVMEDIA_ICP_ERROR(VI, DTYPE_MISMATCH, 0x010A, "The pixel datatype changed in the middle of the line")
259 
263 typedef struct {
264  /* Holds the CSI stream index. */
265  uint32_t csiStreamId;
266  /* Holds the CSI frame index generated by CSI Tx */
267  uint32_t csiFrameId;
268  /* Holds the virtual channel index. */
270  /* Holds the CSI error status. */
273 
287  NvMediaVersion *version
288 );
289 
303 NvMediaICPEx *
305  NvMediaICPSettingsEx *settings
306 );
307 
313 void
315  NvMediaICPEx *icpEx
316 );
317 
332  NvMediaICP *icp,
333  NvMediaImage *image,
334  uint32_t millisecondTimeout
335 );
336 
351  NvMediaICP *icp,
352  NvMediaImageGroup *imageGrp,
353  unsigned int millisecondTimeout
354 );
355 
372  NvMediaICP *icp
373 );
374 
401  NvMediaICP *icp,
402  uint32_t millisecondTimeout,
403  NvMediaImage **image
404 );
405 
424  NvMediaICP *icp,
425  uint32_t millisecondTimeout,
426  NvMediaImageGroup *imageGrp
427 );
428 
441  NvMediaICP *icp,
442  NvMediaImage **image
443 );
444 
457  NvMediaICP *icp,
458  NvMediaImageGroup *imageGrp
459 );
460 
476  NvMediaICP *icp,
477  NvMediaICPErrorInfo *icpErrorInfo
478 );
479 
480 /*
481  * \defgroup history_nvmedia_icp History
482  * Provides change history for the NvMedia ICP API.
483  *
484  * \section history_nvmedia_icp Version History
485  *
486  * <b> Version 2.0 </b> April 4, 2016
487  * - Initial release
488  *
489  * <b> Version 2.1 </b> May 11, 2016
490  * - Added \ref NvMediaICPCheckVersion API
491  *
492  * <b> Version 2.2 </b> August 17, 2016
493  * - Added \ref NVMEDIA_IMAGE_CAPTURE_INPUT_FORMAT_TYPE_UYVY image capture input
494  * format type
495  *
496  * <b> Version 2.3 </b> August 31, 2016
497  * - Added option for enabling embeddedDataType in \ref NvMediaICPSettings
498  *
499  * <b> Version 2.4 </b> Jan 23, 2017
500  * - Added \ref NvMediaICPErrorInfo and \ref NvMediaICPGetErrorInfo
501  *
502  * <b> Version 2.5 </b> March 16, 2017
503  * - Added \ref NVMEDIA_IMAGE_CAPTURE_INPUT_FORMAT_TYPE_USER ,
504  * \ref NvMediaICPUserFormatType and option for enabling userFormatType in
505  * \ref NvMediaICPInputFormat
506  *
507  * <b> Version 3.0 </b> April 19, 2017
508  * Updated to use stdint.h instead of "unsigned int",
509  * "int", "unsigned short" and "char".
510  * NvMediaICPCreate and NvMediaICPDestroy are now deprecated.
511  * NvMediaICPGetFrame is now deprecated.
512  * NvMediaICPInterfaceFormat is now deprecated, it will be always CSI.
513  *
514  * <b> Version 3.1 </b> May 12, 2017
515  * - Added \ref NvMediaICPGetVersion API to get the version of NvMedia ICP library
516  * - NvMediaICPCheckVersion is deprecated. Use NvMediaICPGetVersion() instead
517  *
518  * <b> Version 3.2 </b> May 19, 2017
519  * Removed \ref NvMediaICPSurfaceFormatType
520  * NvMediaICPSettings now takes NvMediaSurfaceType to indicate capture surface format
521  * Removed NVMEDIA_IMAGE_CAPTURE_CSI_INTERFACE_TYPE_TPG0
522  * Combined NvMediaICPUserFormatType with NvMediaICPInputFormatType
523  * Removed NVMEDIA_IMAGE_CAPTURE_INPUT_FORMAT_TYPE_YUV420
524  * from \ref NvMediaICPInputFormatType
525  * Added RAW6/RAW7/RAW8/RAW10/RAW12/RAW14 in NvMediaICPInputFormatType
526  * Removed pixelOrder from \ref NvMediaICPInputFormat
527  * Added tpgEnagle in \ref NvMediaICPSettings
528  *
529  * <b> Version 4.2 </b> June 12, 2017
530  * Added virtualGroupIndex inside \ref NvMediaICPSettingsEx
531  * Renamed virtualChannel to virtualGroup inside \ref NvMediaICPEx
532  * Added \ref NvMediaICPFeedImageGroup and \ref NvMediaICPGetImageGroup APIs
533  *
534  */
537 #ifdef __cplusplus
538 }; /* extern "C" */
539 #endif
540 
541 #endif /* _NVMEDIA_ICP_H */
NvMediaICPInputFormat inputFormat
Holds the input format.
Definition: nvmedia_icp.h:157
A handle representing image objects.
Definition: nvmedia_image.h:75
NvMediaICPInterfaceType
Determines the image capture interface type for CSI interface.
Definition: nvmedia_icp.h:79
#define NvMediaSurfaceType
Defines the set of NvMedia surface types.
NvMediaStatus NvMediaICPFeedImageGroup(NvMediaICP *icp, NvMediaImageGroup *imageGrp, unsigned int millisecondTimeout)
Adds an image group to the image capture pool.
NvMediaStatus NvMediaICPFeedFrame(NvMediaICP *icp, NvMediaImage *image, uint32_t millisecondTimeout)
Adds an image to the image capture pool.
uint16_t thsSettle
Holds the MIPI THS-SETTLE time.
Definition: nvmedia_icp.h:176
NvMediaICPInputFormatType inputFormatType
Capture input format type.
Definition: nvmedia_icp.h:145
Input format type : User defined 6 (0x35)
Definition: nvmedia_icp.h:133
uint32_t NvMediaBool
A boolean value, holding NVMEDIA_TRUE or NVMEDIA_FALSE.
Definition: nvmedia_core.h:79
Input format type : User defined 4 (0x33)
Definition: nvmedia_icp.h:129
Holds image capture settings for the CSI format.
Definition: nvmedia_icp.h:153
Input format type : User defined 3 (0x32)
Definition: nvmedia_icp.h:127
Input format type : User defined 5 (0x34)
Definition: nvmedia_icp.h:131
NVIDIA Media Interface: Surface Handling
uint16_t width
Holds the capture width.
Definition: nvmedia_icp.h:161
NVIDIA Media Interface: Image Processing
NvMediaICPInterfaceType interfaceType
Holds the interface type.
Definition: nvmedia_icp.h:155
#define NVMEDIA_ICP_MAX_VIRTUAL_CHANNELS
Defines the maximum number of virtual channels per virtual group.
Definition: nvmedia_icp.h:56
Holds NvMedia Version information.
Definition: nvmedia_core.h:231
Holds the image capture settings for the CSI format.
Definition: nvmedia_icp.h:188
Input format type : User defined 7 (0x36)
Definition: nvmedia_icp.h:135
uint16_t startX
Holds the horizontal start position.
Definition: nvmedia_icp.h:165
Input format type : YUV 4:2:2.
Definition: nvmedia_icp.h:105
uint16_t embeddedDataLines
Holds the embedded data lines.
Definition: nvmedia_icp.h:169
uint16_t numVirtualGroups
Definition: nvmedia_icp.h:219
uint16_t startY
Holds the vertical start position.
Definition: nvmedia_icp.h:167
NvMediaICPSettings icpSettings
Definition: nvmedia_icp.h:198
#define NVMEDIA_ICP_MAX_VIRTUAL_GROUPS
Defines the maximum number of virtual groups.
Definition: nvmedia_icp.h:53
NvMediaBitsPerPixel bitsPerPixel
Number of bits per pixel.
Definition: nvmedia_icp.h:147
NvMediaICPEx * NvMediaICPCreateEx(NvMediaICPSettingsEx *settings)
Creates an image capture object used to capture various formats of input into an NvMediaImage.
A handle representing an image group.
NVIDIA Media Interface: Core
NvMediaStatus
The set of all possible error codes.
Definition: nvmedia_core.h:178
uint16_t numVirtualChannels
Holds the number of virtual channels per group.
Definition: nvmedia_icp.h:203
Capture input format.
Definition: nvmedia_icp.h:143
NvMediaStatus NvMediaICPGetErrorInfo(NvMediaICP *icp, NvMediaICPErrorInfo *icpErrorInfo)
Gets the capture error information.
Holds a rectangular region of a surface.
Definition: nvmedia_core.h:135
NvMediaRect clipRect
Definition: nvmedia_icp.h:200
Input format type : User defined 8 (0x37)
Definition: nvmedia_icp.h:137
NvMediaStatus NvMediaICPGetImageGroup(NvMediaICP *icp, uint32_t millisecondTimeout, NvMediaImageGroup *imageGrp)
Gets a captured image group with frame status.
NvMediaICPInputFormatType
Determines the image capture input format type.
Definition: nvmedia_icp.h:103
uint16_t virtualChannelIndex
Definition: nvmedia_icp.h:196
NvMediaICPErrorStatus errorStatus
Definition: nvmedia_icp.h:271
Holds the capture error information populated by NvMediaICPGetErrorInfo.
Definition: nvmedia_icp.h:263
NvMediaBool embeddedDataType
Holds the flag of embedded data type.
Definition: nvmedia_icp.h:179
uint16_t numVirtualGroups
Holds the number of virtual groups.
Definition: nvmedia_icp.h:206
NvMediaStatus NvMediaICPStop(NvMediaICP *icp)
Stops the capture.
uint32_t pixelFrequency
Holds the pixel clock frequency.
Definition: nvmedia_icp.h:174
void NvMediaICP
Image capture object per virtual group.
Definition: nvmedia_icp.h:212
uint32_t interfaceLanes
Holds the number of CSI interface lanes active.
Definition: nvmedia_icp.h:171
uint32_t virtualChannelId
Definition: nvmedia_icp.h:269
NvMediaICPErrorStatus
Capture error status.
Definition: nvmedia_icp.h:231
NvMediaStatus NvMediaICPReleaseImageGroup(NvMediaICP *icp, NvMediaImageGroup *imageGrp)
Gets an image group from the internal pool that user fed with NvMediaICPFeedImageGroup after HW gives...
uint16_t height
Holds the capture height.
Definition: nvmedia_icp.h:163
Input format type : YUV 4:4:4.
Definition: nvmedia_icp.h:107
uint32_t interfaceLanes
Holds the number of CSI interface lanes active.
Definition: nvmedia_icp.h:192
NvMediaBitsPerPixel
Bits per pixel.
NvMediaStatus NvMediaICPGetFrameEx(NvMediaICP *icp, uint32_t millisecondTimeout, NvMediaImage **image)
Gets a captured frame with frame status.
uint16_t virtualGroupId
Definition: nvmedia_icp.h:222
Input format type : User defined 1 (0x30)
Definition: nvmedia_icp.h:123
Input format type : User defined 2 (0x31)
Definition: nvmedia_icp.h:125
NvMediaICPInterfaceType interfaceType
Holds the interface type.
Definition: nvmedia_icp.h:190
NvMediaStatus NvMediaICPReleaseFrame(NvMediaICP *icp, NvMediaImage **image)
Gets a frame from the internal pool that user fed with NvMediaICPFeedFrame after HW gives up to captu...
NvMediaICP * hIcp
Definition: nvmedia_icp.h:224
NvMediaSurfaceType surfaceType
Holds the capture surface type.
Definition: nvmedia_icp.h:159
NvMediaStatus NvMediaICPGetVersion(NvMediaVersion *version)
Checks the version compatibility for the NvMedia ICP library.
Holds the image capture object created by NvMediaICPCreateEx.
Definition: nvmedia_icp.h:217
uint8_t tpgEnable
TPG enabled.
Definition: nvmedia_icp.h:181
#define NVMEDIA_ICP_ERROR(_type_, _error_, _value_, _desc_)
Definition: nvmedia_icp.h:73
void NvMediaICPDestroyEx(NvMediaICPEx *icpEx)
Destroys the image capture object created by NvMediaICPCreateEx.