NVIDIA DRIVE OS Linux SDK API Reference

5.1.6.0 Release

 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
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)
 Deinitializes the NvMediaImage NvSciBuf API. More...
 
NvMediaStatus NvMediaImageFillNvSciBufAttrs (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 nvscibufObj, 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

#define NVMEDIA_IMAGENVSCIBUF_VERSION_MAJOR   (1u)

Major version number.

Definition at line 39 of file nvmedia_image_nvscibuf.h.

#define NVMEDIA_IMAGENVSCIBUF_VERSION_MINOR   (0u)

Minor version number.

Definition at line 41 of file nvmedia_image_nvscibuf.h.

Function Documentation

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

Creates an NvMediaImage from an NvSciBufObj.

You must allocate the nvscibufObj 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.
[in]nvscibufObjAn NvSciBufObj for which an NvMediaImage is to be imported.
[in,out]nvmImageA pointer to a location in which a pointer to an imported NvMediaImage in stored.
Return values
NVMEDIA_STATUS_OKindicates that nvmImage was successfully created from nvscibufObj.
NVMEDIA_STATUS_OUT_OF_MEMORYindicates that memory allocation failed.
NVMEDIA_STATUS_ERRORindicates that another error occurred, such as failure to create nvmImage from nvscibufObj.
NVMEDIA_STATUS_BAD_PARAMETERindicates that one of the pointer parameters is NULL, or nvscibufObj was not allocated using the attributes filled by NvMediaImageFillNvSciBufAttrs().
NvMediaStatus NvMediaImageFillNvSciBufAttrs ( 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 may 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.
[in]typeA surface type obtained by calling NvMediaSurfaceFormatGetType().
[in]attrsA pointer to an array of surface allocation attributes for surface creation.
[in]numAttrsNumber of attributes in attrs.
[in]flagsFlags for module hint (for future use).
[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.
void NvMediaImageNvSciBufDeinit ( void  )

Deinitializes the NvMediaImage NvSciBuf API.

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

NvMediaStatus NvMediaImageNvSciBufGetVersion ( NvMediaVersion version)

Returns version information for the NvMediaImage NvSciBuf API.

Parameters
[out]versionA pointer to a structure in which the function may store version information.
Returns
A status code; NVMEDIA_STATUS_OK if the function call was successful, or NVMEDIA_STATUS_BAD_PARAMETER if version was invalid.
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.