![]() |
NVIDIA DRIVE OS Linux SDK API Reference5.1.6.0 Release |
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... | |
#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.
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.
[in] | device | A handle for the NvMediaDevice. |
[in] | nvscibufObj | An NvSciBufObj for which an NvMediaImage is to be imported. |
[in,out] | nvmImage | A pointer to a location in which a pointer to an imported NvMediaImage in stored. |
NVMEDIA_STATUS_OK | indicates that nvmImage was successfully created from nvscibufObj. |
NVMEDIA_STATUS_OUT_OF_MEMORY | indicates that memory allocation failed. |
NVMEDIA_STATUS_ERROR | indicates that another error occurred, such as failure to create nvmImage 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 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.
[in] | device | A handle for the NvMediaDevice. |
[in] | type | A surface type obtained by calling NvMediaSurfaceFormatGetType(). |
[in] | attrs | A pointer to an array of surface allocation attributes for surface creation. |
[in] | numAttrs | Number of attributes in attrs. |
[in] | flags | Flags for module hint (for future use). |
[in,out] | attr_h | A structure where the NvSciBuf attributes for the requested NvMediaImage are put. |
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.
[out] | version | A pointer to a structure in which the function may store version information. |
NvMediaStatus NvMediaImageNvSciBufInit | ( | void | ) |
Initializes the NvMediaImage NvSciBuf API.
You must call this function before you call NvMediaImageFillNvSciBufAttrs() and NvMediaImageCreateFromNvSciBuf().