The NvMedia Array API encompasses all NvMedia functions that create, destroy, access and update arrays used in media processing and computer vision applications.
Data Structures | |
struct | NvMediaArrayAllocAttr |
Holds array allocation attributes. More... | |
Macros | |
#define | NVMEDIA_ARRAY_VERSION_MAJOR (2u) |
Major version number. More... | |
#define | NVMEDIA_ARRAY_VERSION_MINOR (2u) |
Minor version number. More... | |
#define | NVMEDIA_ARRAY_TIMEOUT_INFINITE |
Infinite time-out for NvMediaArrayGetStatus. More... | |
#define | NVM_ARRAY_ATTR_CPU_ACCESS_UNCACHED 0x00000000u |
NVM_SURF_ATTR_CPU_ACCESS flags More... | |
#define | NVM_ARRAY_ATTR_CPU_ACCESS_CACHED 0x00000001u |
NVM_SURF_ATTR_CPU_ACCESS flag: Cached (mapped) access type flag. More... | |
Typedefs | |
typedef struct NvMediaArray | NvMediaArray |
Holds a descriptor for an array. More... | |
Enumerations | |
enum | NvMediaArrayType { NVMEDIA_ARRAY_TYPE_UNDEFINED = 0, NVMEDIA_ARRAY_TYPE_INT8 = 1, NVMEDIA_ARRAY_TYPE_UINT8 = 2, NVMEDIA_ARRAY_TYPE_INT16 = 3, NVMEDIA_ARRAY_TYPE_UINT16 = 4, NVMEDIA_ARRAY_TYPE_FLOAT16 = 5, NVMEDIA_ARRAY_TYPE_UINT32 = 6, NVMEDIA_ARRAY_TYPE_INT32 = 7, NVMEDIA_ARRAY_TYPE_FLOAT32 = 8, NVMEDIA_ARRAY_NUM_TYPES = 8 } |
Defines the different types of arrays. More... | |
enum | NvMediaArrayAllocAttrType { NVM_ARRAY_ATTR_CPU_ACCESS } |
Defines NvMedia array allocation attribute types. More... | |
Functions | |
NvMediaStatus | NvMediaArrayGetVersion (NvMediaVersion *version) |
Returns version information for the NvMediaArray library. More... | |
NvMediaArray * | NvMediaArrayCreate (NvMediaDevice *device, NvMediaArrayType type, uint32_t stride, uint32_t numElements, const NvMediaArrayAllocAttr *attrs, uint32_t numAttrs) |
Creates an NvMedia Array. More... | |
NvMediaStatus | NvMediaArrayDestroy (NvMediaArray *handle) |
Destroys an array created by NvMediaArrayCreate(). More... | |
NvMediaStatus | NvMediaArrayGetElemSizeForType (NvMediaArrayType type, uint32_t *elementSize) |
Gets the size of a specified type of array element. More... | |
NvMediaStatus | NvMediaArrayGetSize (NvMediaArray *handle, uint32_t *numElementsPtr) |
Gets the size of an array. More... | |
NvMediaStatus | NvMediaArraySetSize (NvMediaArray *handle, uint32_t numElements) |
Sets the size of an array (the number of populated elements in the array). More... | |
NvMediaStatus | NvMediaArrayGetProperties (NvMediaArray *handle, NvMediaArrayType *elementType, uint32_t *capacity, uint32_t *stride) |
Gets the array properties with which array was created. More... | |
NvMediaStatus | NvMediaArrayGetStatus (NvMediaArray *handle, uint32_t millisecondWait, NvMediaTaskStatus *status) |
Gets the status of the current or most recent operation on the array; optionally waits for the operation to complete or time out. More... | |
#define NVM_ARRAY_ATTR_CPU_ACCESS_CACHED 0x00000001u |
NVM_SURF_ATTR_CPU_ACCESS flag: Cached (mapped) access type flag.
Definition at line 103 of file nvmedia_array.h.
#define NVM_ARRAY_ATTR_CPU_ACCESS_UNCACHED 0x00000000u |
NVM_SURF_ATTR_CPU_ACCESS flags
Uncached (mapped) access type flag.
Definition at line 101 of file nvmedia_array.h.
#define NVMEDIA_ARRAY_TIMEOUT_INFINITE |
Infinite time-out for NvMediaArrayGetStatus.
Definition at line 55 of file nvmedia_array.h.
#define NVMEDIA_ARRAY_VERSION_MAJOR (2u) |
Major version number.
Definition at line 47 of file nvmedia_array.h.
#define NVMEDIA_ARRAY_VERSION_MINOR (2u) |
Minor version number.
Definition at line 49 of file nvmedia_array.h.
typedef struct NvMediaArray NvMediaArray |
Holds a descriptor for an array.
Note: Create and destroy an array with the corresponding NvMediaArrayCreate() and NvMediaArrayDestroy() functions.
Definition at line 88 of file nvmedia_array.h.
Defines NvMedia array allocation attribute types.
Enumerator | |
---|---|
NVM_ARRAY_ATTR_CPU_ACCESS | ! CPU access to surface flags (default: uncached). |
Definition at line 93 of file nvmedia_array.h.
enum NvMediaArrayType |
Defines the different types of arrays.
Definition at line 59 of file nvmedia_array.h.
NvMediaArray* NvMediaArrayCreate | ( | NvMediaDevice * | device, |
NvMediaArrayType | type, | ||
uint32_t | stride, | ||
uint32_t | numElements, | ||
const NvMediaArrayAllocAttr * | attrs, | ||
uint32_t | numAttrs | ||
) |
Creates an NvMedia Array.
[in] | device | Handle to the NvMedia device obtained by calling NvMediaDeviceCreate(). |
[in] | type | Type of array to be created. |
[in] | stride | Stride in bytes of each element. |
[in] | numElements | Number of elements in the array. |
[in] | attrs | An array of NvMediaArrayAllocAttr allocation attributes to be applied to the created array. |
[in] | numAttrs | Number of allocation attributes in attrs. |
NvMediaStatus NvMediaArrayDestroy | ( | NvMediaArray * | handle | ) |
Destroys an array created by NvMediaArrayCreate().
[in] | handle | The handle to the array to be destroyed. |
NVMEDIA_STATUS_OK | indicates that the call is successful. |
NVMEDIA_STATUS_BAD_PARAMETER | indicates that handle is NULL. |
NVMEDIA_STATUS_ERROR | indicates any other error. |
NvMediaStatus NvMediaArrayGetElemSizeForType | ( | NvMediaArrayType | type, |
uint32_t * | elementSize | ||
) |
Gets the size of a specified type of array element.
[in] | type | Type of element. |
[out] | elementSize | A pointer to the size of an element in bytes. |
NVMEDIA_STATUS_OK | indicates that the call is successful. |
NVMEDIA_STATUS_BAD_PARAMETER | indicates that type is invalid or elementSize is NULL. |
NVMEDIA_STATUS_ERROR | indicates any other error. |
NvMediaStatus NvMediaArrayGetProperties | ( | NvMediaArray * | handle, |
NvMediaArrayType * | elementType, | ||
uint32_t * | capacity, | ||
uint32_t * | stride | ||
) |
Gets the array properties with which array was created.
[in] | handle | The handle to the array. |
[out] | elementType | Type of elements in the array. |
[out] | capacity | A pointer to the array's capacity (the number of elements). |
[out] | stride | A pointer to the array's stride (the offset in bytes between one elelment and the next). |
NVMEDIA_STATUS_OK | indicates that the call is successful. |
NVMEDIA_STATUS_BAD_PARAMETER | indicates that one or more arguments are NULL. |
NVMEDIA_STATUS_ERROR | indicates any other error. |
NvMediaStatus NvMediaArrayGetSize | ( | NvMediaArray * | handle, |
uint32_t * | numElementsPtr | ||
) |
Gets the size of an array.
An array's size is the number of populated elements in the array. If the array has not been written to, the function returns a size of 0.
[in] | handle | The handle to the array. |
[out] | numElementsPtr | A pointer to the number of elements. |
NVMEDIA_STATUS_OK | indicates that the call is successful. |
NVMEDIA_STATUS_BAD_PARAMETER | indicates that handle or numElementsPtr is NULL. |
NVMEDIA_STATUS_ERROR | indicates that the array cannot be locked to retrieve the size information. |
NvMediaStatus NvMediaArrayGetStatus | ( | NvMediaArray * | handle, |
uint32_t | millisecondWait, | ||
NvMediaTaskStatus * | status | ||
) |
Gets the status of the current or most recent operation on the array; optionally waits for the operation to complete or time out.
[in] | handle | The handle to the array. |
[in] | millisecondWait | Time in milliseconds to wait for the current operation to complete. NVMEDIA_ARRAY_TIMEOUT_INFINITE means wait indefinitely. |
[out] | status | Status of the operation. |
NVMEDIA_STATUS_OK | indicates that the call is successful. |
NVMEDIA_STATUS_TIMED_OUT | indicates that the operation did not complete within the specified wait time. |
NVMEDIA_STATUS_BAD_PARAMETER | indicates that a parameter has an invalid value. |
NVMEDIA_STATUS_ERROR | indicates any other error. |
NvMediaStatus NvMediaArrayGetVersion | ( | NvMediaVersion * | version | ) |
Returns version information for the NvMediaArray library.
[in] | version | A pointer to an NvMediaVersion structure filled by the function. |
NvMediaStatus NvMediaArraySetSize | ( | NvMediaArray * | handle, |
uint32_t | numElements | ||
) |
Sets the size of an array (the number of populated elements in the array).
Call this function before writing to the array. The specified size must be less than or equal to the number of elements with which the array was created.
[in] | handle | The handle to the array. |
[in] | numElements | Size of the array. |
NVMEDIA_STATUS_OK | indicates that the call is successful. |
NVMEDIA_STATUS_BAD_PARAMETER | indicates that handle is NULL. |
NVMEDIA_STATUS_INVALID_SIZE | indicates that numElements is greater than the array's initial size. |
NVMEDIA_STATUS_ERROR | indicates that the array cannot be locked to set the size information. |