NVIDIA DRIVE OS Linux SDK API Reference

5.1.12.0 Release

 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
NvMedia Array for NvSciBuf

Detailed Description

The NvMedia Array NvSciBuf API encompasses all NvMediaArray NvSciBuf handling functions.

Macros

#define NVMEDIA_ARRAY_NVSCIBUF_VERSION_MAJOR   (1u)
 Major version number. More...
 
#define NVMEDIA_ARRAY_NVSCIBUF_VERSION_MINOR   (0u)
 Minor version number. More...
 

Functions

NvMediaStatus NvMediaArrayNvSciBufInit (void)
 Initializes the NvMediaArray NvSciBuf APIs. More...
 
void NvMediaArrayNvSciBufDeinit (void)
 De-initializes the NvMediaArray NvSciBuf APIs. More...
 
NvMediaStatus NvMediaArrayFillNvSciBufAttrs (NvMediaDevice *device, NvMediaArrayType type, uint32_t stride, uint32_t numElements, const NvMediaArrayAllocAttr *attrs, uint32_t numAttrs, NvSciBufAttrList attr_h)
 Fills the NvSciBuf attributes used to allocate an array. More...
 
NvMediaStatus NvMediaArrayCreateFromNvSciBuf (NvMediaDevice *device, NvSciBufObj nvSciBufObj, NvMediaArray **nvmArray)
 Creates NvMediaArray from an NvSciBuf handle. More...
 
NvMediaStatus NvMediaArrayNvSciBufGetVersion (NvMediaVersion *version)
 Returns version information for the NvMediaArray NvSciBuf API. More...
 

Macro Definition Documentation

#define NVMEDIA_ARRAY_NVSCIBUF_VERSION_MAJOR   (1u)

Major version number.

Definition at line 37 of file nvmedia_array_nvscibuf.h.

#define NVMEDIA_ARRAY_NVSCIBUF_VERSION_MINOR   (0u)

Minor version number.

Definition at line 39 of file nvmedia_array_nvscibuf.h.

Function Documentation

NvMediaStatus NvMediaArrayCreateFromNvSciBuf ( NvMediaDevice device,
NvSciBufObj  nvSciBufObj,
NvMediaArray **  nvmArray 
)

Creates NvMediaArray from an NvSciBuf handle.

This API assumes that nvscibufObj is a pointer to a valid NvSciBufObj.

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

When the application is done using nvmArray, it must call NvMediaArrayDestroy() with nvmArray.

Parameters
[in]deviceA pointer to the NvMediaDevice.
[in]nvSciBufObjAn NvSciBufObj for which an NvMediaArray is to be imported.
[in,out]nvmArrayA pointer to a location in which a pointer to an imported NvMediaArray in stored.
Returns
NvMediaStatus, the completion status of the operation:
  • NVMEDIA_STATUS_OK indicates that nvmArray was successfully created from nvscibufObj.
  • NVMEDIA_STATUS_ERROR indicates that another error occurred, such as failure to create nvmArray from nvscibufObj.
  • NVMEDIA_STATUS_BAD_PARAMETER indicates that one of the pointer parameters is NULL, or nvscibufObj was not allocated using the attributes filled by NvMediaArrayGetNvSciBufAttrs().
NvMediaStatus NvMediaArrayFillNvSciBufAttrs ( NvMediaDevice device,
NvMediaArrayType  type,
uint32_t  stride,
uint32_t  numElements,
const NvMediaArrayAllocAttr attrs,
uint32_t  numAttrs,
NvSciBufAttrList  attr_h 
)

Fills the NvSciBuf attributes used to allocate an array.

This function assumes that attr_h is a valid NvSciBufAttrList created by the application.

This API maps the information in type and attrs to NvSciBuf attributes and fills them into NvSciBufAttrList referenced by attr_h.

The following list of NvSciBuf input attributes are set by NvMedia. The application must not set these values.

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

After calling this function, the application can call NvSciBufAllocate() with attr_h as input and get an NvSciBufObj as output. Then it can call NvMediaArrayCreateFromNvSciBuf() to create an NvMediaArray from the NvSciBufObj.

Parameters
[in]deviceA pointer to NvMediaDevice.
[in]typeThe datatype for elements in the array.
[in]strideNumber of strides.
[in]numElementsNumber of elements.
[in]attrsA pointer to an array of array alloc attributes for array creation.
[in]numAttrsThe number of attributes in the array.
[in,out]attr_hA handle to NvSciBufAttrlist to hold the NvSciBuf attributes for the requested NvMediaArray.
Returns
NvMediaStatus, the completion status of the operation:
void NvMediaArrayNvSciBufDeinit ( void  )

De-initializes the NvMediaArray NvSciBuf APIs.

NvMediaArrayFillNvSciBufAttrs() and NvMediaArrayCreateFromNvSciBuf() cannot be called after calling this function.

NvMediaStatus NvMediaArrayNvSciBufGetVersion ( NvMediaVersion version)

Returns version information for the NvMediaArray NvSciBuf API.

Parameters
[out]versionA pointer to a NvMediaVersion in which the function may store version information.
Returns
NvMediaStatus, the completion status of the operation:
NvMediaStatus NvMediaArrayNvSciBufInit ( void  )

Initializes the NvMediaArray NvSciBuf APIs.

This function must be called before calling NvMediaArrayFillNvSciBufAttrs() and NvMediaArrayCreateFromNvSciBuf().

Returns
NvMediaStatus, the completion status of the operation: