NVIDIA DRIVE OS Linux SDK API Reference

5.2.6 Release
For Test and Development only
Image Handling with Buffer Allocation API

Detailed Description

The NvMedia Image NvSciBuf API encompasses all NvMediaImage NvSciBuf handling functions.

Macros

#define NVMEDIA_IMAGENVSCIBUF_VERSION_MAJOR   (1u)
 Major version number. More...
 
#define NVMEDIA_IMAGENVSCIBUF_VERSION_MINOR   (0u)
 Minor version number. More...
 

Functions

NvMediaStatus NvMediaImageNvSciBufInit (void)
 Initializes the NvMediaImage NvSciBuf API. More...
 
void NvMediaImageNvSciBufDeinit (void)
 De-initializes the NvMediaImage NvSciBuf API. More...
 
NvMediaStatus NvMediaImageFillNvSciBufAttrs (const NvMediaDevice *device, NvMediaSurfaceType type, const NvMediaSurfAllocAttr *attrs, uint32_t numAttrs, uint64_t flags, NvSciBufAttrList attr_h)
 Fills the NvSciBuf (see nvscibuf.h) attributes which can be used to allocate an image. More...
 
NvMediaStatus NvMediaImageCreateFromNvSciBuf (NvMediaDevice *device, NvSciBufObj nvscibufObject, NvMediaImage **nvmImage)
 Creates an NvMediaImage from an NvSciBufObj. More...
 
NvMediaStatus NvMediaImageNvSciBufGetVersion (NvMediaVersion *version)
 Returns version information for the NvMediaImage NvSciBuf API. More...
 

Macro Definition Documentation

◆ NVMEDIA_IMAGENVSCIBUF_VERSION_MAJOR

#define NVMEDIA_IMAGENVSCIBUF_VERSION_MAJOR   (1u)

Major version number.

Definition at line 39 of file nvmedia_image_nvscibuf.h.

◆ NVMEDIA_IMAGENVSCIBUF_VERSION_MINOR

#define NVMEDIA_IMAGENVSCIBUF_VERSION_MINOR   (0u)

Minor version number.

Definition at line 41 of file nvmedia_image_nvscibuf.h.

Function Documentation

◆ NvMediaImageCreateFromNvSciBuf()

NvMediaStatus NvMediaImageCreateFromNvSciBuf ( NvMediaDevice device,
NvSciBufObj  nvscibufObject,
NvMediaImage **  nvmImage 
)

Creates an NvMediaImage from an NvSciBufObj.

You must allocate the nvscibufObject before you call this function, using the NvSciBufAttrList filled by NvMediaImageFillNvSciBufAttrs().

When the application is done using nvmImage, it must call NvMediaImageDestroy() with nvmImage.

Parameters
[in]deviceA handle for the NvMediaDevice. It should be a valid non-null handle.
[in]nvscibufObjectAn NvSciBufObj for which an NvMediaImage is to be imported. It should be non-null.
[in,out]nvmImageA pointer to a location in which a pointer to an imported NvMediaImage in stored. It should be non-null
Return values
NVMEDIA_STATUS_OKindicates that nvmImage was successfully created from nvscibufObject.
NVMEDIA_STATUS_OUT_OF_MEMORYindicates that memory allocation failed.
NVMEDIA_STATUS_ERRORindicates that another error occurred, such as failure to create nvmImage from nvscibufObject.
NVMEDIA_STATUS_BAD_PARAMETERindicates that one of the pointer parameters is NULL, or nvscibufObject was not allocated using the attributes filled by NvMediaImageFillNvSciBufAttrs().

◆ NvMediaImageFillNvSciBufAttrs()

NvMediaStatus NvMediaImageFillNvSciBufAttrs ( const NvMediaDevice device,
NvMediaSurfaceType  type,
const NvMediaSurfAllocAttr attrs,
uint32_t  numAttrs,
uint64_t  flags,
NvSciBufAttrList  attr_h 
)

Fills the NvSciBuf (see nvscibuf.h) attributes which can be used to allocate an image.

Assumes that attr_h is a valid NvSciBufAttrList created by the application by calling NvSciBufAttrListCreate(). This function maps the information in type, attrs, and flags to NvSciBuf attributes and fills them in attr_h.

The following NvSciBuf input attributes are set by NvMedia, and so must not be set by the application:

The following image attribute is not set by NvMedia, and so must be set by the application:

After calling this function, the application can use attr_h in NvSciBuf attribute list reconcile and object allocation functions to allocate an NvSciBufObj. Then it can call NvMediaImageCreateFromNvSciBuf() to create an NvMediaImage from the NvSciBufObj.

Parameters
[in]deviceA handle for the NvMediaDevice. It should be a valid non-null handle.
[in]typeA surface type obtained by calling NvMediaSurfaceFormatGetType().
[in]attrsA pointer to an array of surface allocation attributes for surface creation. It should be non-null.
[in]numAttrsNumber of attributes in attrs. Valid range of arguments: [0, NVM_SURF_ALLOC_ATTR_MAX)
[in]flagsFlags for module hint (for future use). Please note that the value passed for this argument must be 0, or the API will fail.
[in,out]attr_hA structure where the NvSciBuf attributes for the requested NvMediaImage are put.
Returns
A status code; NVMEDIA_STATUS_OK if the function call is successful, or NVMEDIA_STATUS_BAD_PARAMETER if type is invalid or attrs contains invalid attributes, or NVMEDIA_STATUS_OUT_OF_MEMORY if memory allocation fails, or NVMEDIA_STATUS_ERROR otherwise

◆ NvMediaImageNvSciBufDeinit()

void NvMediaImageNvSciBufDeinit ( void  )

De-initializes the NvMediaImage NvSciBuf API.

You cannot call NvMediaImageFillNvSciBufAttrs() or NvMediaImageCreateFromNvSciBuf() after you call this function.

◆ NvMediaImageNvSciBufGetVersion()

NvMediaStatus NvMediaImageNvSciBufGetVersion ( NvMediaVersion version)

Returns version information for the NvMediaImage NvSciBuf API.

Parameters
[in,out]versionA pointer to a structure in which the function may store version information. It should be a valid non-null pointer.
Returns
A status code; NVMEDIA_STATUS_OK if the function call was successful, or NVMEDIA_STATUS_BAD_PARAMETER if version was invalid.

◆ NvMediaImageNvSciBufInit()

NvMediaStatus NvMediaImageNvSciBufInit ( void  )

Initializes the NvMediaImage NvSciBuf API.

You must call this function before you call NvMediaImageFillNvSciBufAttrs() and NvMediaImageCreateFromNvSciBuf().

Returns
A status code; NVMEDIA_STATUS_OK if the API was successfully initialized, or NVMEDIA_STATUS_ERROR otherwise.