NVIDIA DRIVE OS Linux API Reference

5.1.6.1 Release
For Test and Development only

 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
Image Handling API

Detailed Description

The Image Processing API encompasses all NvMedia image-related functionality.

Data Structures

struct  NvMediaImageSurface
 Holds an image surface descriptor used by NvMediaImageLock(). More...
 
struct  NvMediaImageSurfaceMap
 Holds an image surface map descriptor used by NvMediaImageLock(). More...
 

Modules

 Image 2D Processing
 The Image 2D Processing API encompasses all NvMedia 2D image processing related functionality.
 
 Image 2D Processing Synchronization
 The NvMedia 2D NvSciSync API encompasses all NvMedia2D NvSciSync handling functions.
 
 Image Capture
 Captures uncompressed image data, writing the results to an NvMediaImage.
 
 Image Capture Synchronization
 The NvMedia ICP NvSciSync API encompasses all NvMediaICP NvSciSync handling functions.
 
 Image Creation
 Defines and manages image objects.
 
 Image Decoder
 Defines and manages objects that decode video.
 
 Image Display Processing (IDP)
 Displays NvMediaImage type surfaces.
 
 Image Encoder
 The NvMediaIEP object takes uncompressed image data and turns it into a codec specific bitstream.
 
 Image Encoder Synchronization
 The NvMedia IEP NvSciSync API encompasses all NvMediaIEP NvSciSync handling functions.
 
 Image JPEG Decoder
 The NvMediaIJPD object takes a JPEG bitstream and decompress it to image data.
 
 Image JPEG Encoder
 The NvMediaIJPE object takes uncompressed image data and turns it into a jpeg bitstream.
 
 Image Locking and Unlocking
 Locking and unlocking controls access to the image surfaces.
 
 Image Processing Pipeline (IPP)
 The NvMedia Image Processing Pipeline (IPP) is a framework that controls all NvMedia processing components.
 
 Image Read and Write by Client
 Provides image surface read and write by the client application for diagnostic purposes.
 
 Image Sensor Control (ISC)
 The Image Sensor Control API encompasses all NvMedia I2C control related functions, including programming of all I2C controlled components such as deserializers, serializers, EEPROMs, and image sensors.
 
 Sensor Input Processing Library (SIPL)
 SIPL provides abstract and simple API to capture the output of image sensors with optional image processing.
 

Macros

#define NVMEDIA_IMAGE_VERSION_MAJOR   (1u)
 Major version number. More...
 
#define NVMEDIA_IMAGE_VERSION_MINOR   (21u)
 Minor version number. More...
 

Functions

NvMediaStatus NvMediaImageGetEmbeddedData (const NvMediaImage *image, uint32_t imageIndex, void *embeddedBufTop, uint32_t *embeddedBufTopSize, void *embeddedBufBottom, uint32_t *embeddedBufBottomSize)
 Returns embedded data stored in a captured image. More...
 
NvMediaStatus NvMediaImageGetTimeStamp (const NvMediaImage *image, NvMediaTime *timeStamp)
 Gets the capture timestamp of the image. More...
 
NvMediaStatus NvMediaImageGetGlobalTimeStamp (const NvMediaImage *image, NvMediaGlobalTime *globalTimeStamp)
 Gets the global capture timestamp of the image. More...
 
NvMediaStatus NvMediaImageSetTag (NvMediaImage *image, void *tag)
 Sets a tag for an NvMediaImage. More...
 
NvMediaStatus NvMediaImageGetTag (const NvMediaImage *image, void **tag)
 Gets the tag from an NvMediaImage. More...
 
NvMediaStatus NvMediaImageGetStatus (const NvMediaImage *image, uint32_t millisecondWait, NvMediaTaskStatus *status)
 Gets status of the current or most recent operation for an image; optionally waits for the current operation to complete or time out. More...
 

Macro Definition Documentation

#define NVMEDIA_IMAGE_VERSION_MAJOR   (1u)

Major version number.

Definition at line 36 of file nvmedia_image.h.

#define NVMEDIA_IMAGE_VERSION_MINOR   (21u)

Minor version number.

Definition at line 38 of file nvmedia_image.h.

Function Documentation

NvMediaStatus NvMediaImageGetEmbeddedData ( const NvMediaImage image,
uint32_t  imageIndex,
void *  embeddedBufTop,
uint32_t *  embeddedBufTopSize,
void *  embeddedBufBottom,
uint32_t *  embeddedBufBottomSize 
)

Returns embedded data stored in a captured image.

Embedded data can be added to the following image types. This type must obtained by a call to NvMediaSurfaceFormatGetType() with:

  • NVM_SURF_FMT_SET_ATTR_YUV(attr, YUYV, 422, PACKED, UINT, 8, PL)
  • NVM_SURF_FMT_SET_ATTR_RGBA(attr, RGBA, UINT, 8, [PL|BL])
  • NVM_SURF_FMT_SET_ATTR_RAW(attr, [RGGB/BGGR/GRBG/GBRG], [UINT/INT], [8/10/12/16/20], PL)
  • NVM_SURF_FMT_SET_ATTR_RAW(attr, [RCCB/BCCR/CRBC/CBRC], [UINT/INT], 12, PL)
  • NVM_SURF_FMT_SET_ATTR_RAW(attr, [RCCC/CCCR/CRCC/CCRC], [UINT/INT], 12, PL)

Embedded data may contain 8-bit data or data encoded in the sensor pixel data type, depending on the camera sensor side specification.

In case of RAW12 DataType, the bit layout may change without warning, depending on the surface data type specified.

The VI hardware changes data layout to:

  • For RAW12 UINT case: [11][10][9][8][7][6][5][4][3][2][1][0][P][P][P][P]
  • For RAW12 INT case: [0][11][10][9][8][7][6][5][4][3][2][1][0][P][P][P]

Each embedded data pixel has 16 bits. [P] represents a padding bit. Padding bits duplicate the most significant bits: [11][10][9][8] for UINT, or [11][10][9] for INT.

Contact NVIDIA for more information on other DataTypes.

Parameters
[in]imageA pointer to the image from which to get embedded data.
[in]imageIndexIndex of the sub-image in the case of a multi-image handle, counting from 0. For a single image handle imageIndex is ignored.
[in]embeddedBufTopA pointer to a buffer allocated on the caller side to store top data.
[in,out]embeddedBufTopSizeA pointer to top buffer size (in). Actual size of copied data is returned at this location (out). Top buffer size is calculated from values like frame resolution and NVM_SURF_ATTR_EMB_LINES_TOP.
[in]embeddedBufBottomA pointer to a buffer allocated at caller side to store bottom data.
[in,out]embeddedBufBottomSizeA pointer to bottom buffer size (in). Actual size of copied data is returned at this location (out). Bottom buffer size is calculated from values like frame resolution and NVM_SURF_ATTR_EMB_LINES_BOTTOM.
Return values
NVMEDIA_STATUS_OKindicates that that call was successful.
NVMEDIA_STATUS_BAD_PARAMETERindicates that one or more pointer parameters were NULL.
NVMEDIA_STATUS_ERRORindicates that the surface type is not supported.
NvMediaStatus NvMediaImageGetGlobalTimeStamp ( const NvMediaImage image,
NvMediaGlobalTime globalTimeStamp 
)

Gets the global capture timestamp of the image.

The global timestamp is set by the NvMedia IPP Capture component.

Parameters
[in]imageA pointer to the image for which to get the timestamp.
[out]globalTimeStampA pointer to the global capture timestamp of the image.
Return values
NVMEDIA_STATUS_OKindicates that the call was successful.
NVMEDIA_STATUS_BAD_PARAMETERindicates that image or timeStamp was NULL.
NVMEDIA_STATUS_ERRORindicates that another error occurred.
NvMediaStatus NvMediaImageGetStatus ( const NvMediaImage image,
uint32_t  millisecondWait,
NvMediaTaskStatus status 
)

Gets status of the current or most recent operation for an image; optionally waits for the current operation to complete or time out.

Parameters
[in]imageA pointer to the image.
[in]millisecondWaitTime in milliseconds to wait for the current operation to complete before getting status. NVMEDIA_IMAGE_TIMEOUT_INFINITE means wait indefinitely.
[out]statusA pointer to the status of the operation.
Return values
NVMEDIA_STATUS_OKindicates that the call was successful.
NVMEDIA_STATUS_BAD_PARAMETERindicates that image or status was NULL.
NVMEDIA_STATUS_ERRORindicates that another error occurred.
NvMediaStatus NvMediaImageGetTag ( const NvMediaImage image,
void **  tag 
)

Gets the tag from an NvMediaImage.

Note
The NvMediaImage struct's tag member is deprecated, and will be retired in a future release. Use NvMediaImageSetTag() to set a tag and NvMediaImageGetTag() to get a tag instead.
Parameters
[in]imageA pointer to image for which to get the tag.
[out]tagA pointer to a location where the function is to put a pointer to the tag.
Returns
A status code; NVMEDIA_STATUS_OK if the call was successful, or NVMEDIA_STATUS_BAD_PARAMETER if image or tag was NULL.
NvMediaStatus NvMediaImageGetTimeStamp ( const NvMediaImage image,
NvMediaTime timeStamp 
)

Gets the capture timestamp of the image.

Parameters
[in]imageA pointer to the image for which to get the timestamp.
[out]timeStampA pointer the capture timestamp of the image.
Return values
NVMEDIA_STATUS_OKindicates that the call was successful.
NVMEDIA_STATUS_BAD_PARAMETERindicates that image or timeStamp was NULL.
NVMEDIA_STATUS_ERRORindicates that another error occurred.
NvMediaStatus NvMediaImageSetTag ( NvMediaImage image,
void *  tag 
)

Sets a tag for an NvMediaImage.

Associates a tag (an arbitrary pointer) with an NvMediaImage.

Note
The NvMediaImage struct's tag member is deprecated, and will be retired in a future release. Use NvMediaImageSetTag() to set a tag instead.
Parameters
[in]imageA pointer to image for which a tag is to be set.
[in]tagA pointer to the tag.
Returns
A status code; NVMEDIA_STATUS_OK if the call was successful, or NVMEDIA_STATUS_BAD_PARAMETER if image was NULL.