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... | |
#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 | 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.
[in] | device | A handle for the NvMediaDevice. It should be a valid non-null handle. |
[in] | nvscibufObject | An NvSciBufObj for which an NvMediaImage is to be imported. It should be non-null. |
[in,out] | nvmImage | A pointer to a location in which a pointer to an imported NvMediaImage in stored. It should be non-null |
NVMEDIA_STATUS_OK | indicates that nvmImage was successfully created from nvscibufObject. |
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 nvscibufObject. |
NVMEDIA_STATUS_BAD_PARAMETER | indicates that one of the pointer parameters is NULL, or nvscibufObject was not allocated using the attributes filled by 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.
[in] | device | A handle for the NvMediaDevice. It should be a valid non-null handle. |
[in] | type | A surface type obtained by calling NvMediaSurfaceFormatGetType(). |
[in] | attrs | A pointer to an array of surface allocation attributes for surface creation. It should be non-null. |
[in] | numAttrs | Number of attributes in attrs. Valid range of arguments: [0, NVM_SURF_ALLOC_ATTR_MAX) |
[in] | flags | Flags 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_h | A structure where the NvSciBuf attributes for the requested NvMediaImage are put. |
void NvMediaImageNvSciBufDeinit | ( | void | ) |
De-initializes 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.
[in,out] | version | A pointer to a structure in which the function may store version information. It should be a valid non-null pointer. |
NvMediaStatus NvMediaImageNvSciBufInit | ( | void | ) |
Initializes the NvMediaImage NvSciBuf API.
You must call this function before you call NvMediaImageFillNvSciBufAttrs() and NvMediaImageCreateFromNvSciBuf().