NVIDIA DRIVE OS Linux API Reference

5.1.0.2 Release

 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages

Detailed Description

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   2
 Major Version number. More...
 
#define NVMEDIA_ARRAY_VERSION_MINOR   1
 Minor Version number. More...
 
#define NVMEDIA_ARRAY_TIMEOUT_INFINITE
 Infinite time-out for NvMediaArrayGetStatus. More...
 
#define NVM_ARRAY_ATTR_CPU_ACCESS_UNCACHED   0x00000000
 NVM_SURF_ATTR_CPU_ACCESS flags More...
 
#define NVM_ARRAY_ATTR_CPU_ACCESS_CACHED   0x00000001
 NVM_SURF_ATTR_CPU_ACCESS flag: Cached (mapped) access type flag. More...
 

Typedefs

typedef struct NvMediaArray NvMediaArray
 Holds a descriptor for the 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 the version information for the NvMediaArray library. More...
 
NvMediaArrayNvMediaArrayCreate (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 an element, for a particular type of array element. More...
 
NvMediaStatus NvMediaArrayGetSize (NvMediaArray *handle, uint32_t *numElementsPtr)
 Gets the size of the array. More...
 
NvMediaStatus NvMediaArraySetSize (NvMediaArray *handle, uint32_t numElements)
 Sets the size of the array. More...
 
NvMediaStatus NvMediaArrayGetProperties (NvMediaArray *handle, NvMediaArrayType *elementType, uint32_t *capacity, uint32_t *stride)
 Helper function to get array properties with which array was created. More...
 
NvMediaStatus NvMediaArrayGetStatus (NvMediaArray *handle, uint32_t millisecondWait, NvMediaTaskStatus *status)
 Gets the status of the current/last operation for the Array and optionally waits for the operation to complete/timeout. More...
 

Macro Definition Documentation

#define NVM_ARRAY_ATTR_CPU_ACCESS_CACHED   0x00000001

NVM_SURF_ATTR_CPU_ACCESS flag: Cached (mapped) access type flag.

Definition at line 93 of file nvmedia_array.h.

#define NVM_ARRAY_ATTR_CPU_ACCESS_UNCACHED   0x00000000

NVM_SURF_ATTR_CPU_ACCESS flags

Uncached (mapped) access type flag

Definition at line 91 of file nvmedia_array.h.

#define NVMEDIA_ARRAY_TIMEOUT_INFINITE

Infinite time-out for NvMediaArrayGetStatus.

Definition at line 46 of file nvmedia_array.h.

#define NVMEDIA_ARRAY_VERSION_MAJOR   2

Major Version number.

Definition at line 38 of file nvmedia_array.h.

#define NVMEDIA_ARRAY_VERSION_MINOR   1

Minor Version number.

Definition at line 40 of file nvmedia_array.h.

Typedef Documentation

typedef struct NvMediaArray NvMediaArray

Holds a descriptor for the array.

Note: The array needs to be created and destroyed using the corresponding NvMediaArrayCreate() and NvMediaArrayDestroy() functions.

Definition at line 78 of file nvmedia_array.h.

Enumeration Type Documentation

Defines NvMedia array allocation attribute types.

Enumerator
NVM_ARRAY_ATTR_CPU_ACCESS 

! CPU access to surface flags (default: uncached)

Definition at line 83 of file nvmedia_array.h.

Defines the different types of Arrays.

Enumerator
NVMEDIA_ARRAY_TYPE_UNDEFINED 

Undefined array type.

NVMEDIA_ARRAY_TYPE_INT8 

Signed 8 bit.

NVMEDIA_ARRAY_TYPE_UINT8 

Unsigned 8 bit.

NVMEDIA_ARRAY_TYPE_INT16 

Signed 16 bit.

NVMEDIA_ARRAY_TYPE_UINT16 

Unsigned 16 bit.

NVMEDIA_ARRAY_TYPE_FLOAT16 

Float 16 bit.

NVMEDIA_ARRAY_TYPE_UINT32 

Unsigned 32 bit.

NVMEDIA_ARRAY_TYPE_INT32 

Signed 32 bit.

NVMEDIA_ARRAY_TYPE_FLOAT32 

Float 32 bit.

NVMEDIA_ARRAY_NUM_TYPES 

Number of types - If more types are needed, add above this and update this.

Definition at line 50 of file nvmedia_array.h.

Function Documentation

NvMediaArray* NvMediaArrayCreate ( NvMediaDevice device,
NvMediaArrayType  type,
uint32_t  stride,
uint32_t  numElements,
const NvMediaArrayAllocAttr attrs,
uint32_t  numAttrs 
)

Creates an NvMedia Array.

Parameters
[in]deviceHandle to the NvMedia device obtained by calling NvMediaDeviceCreate.
[in]typeNvMediaArrayType Type of Array to be created.
[in]strideStride in bytes of each element.
[in]numElementsnumber of Elements in the array.
[in]attrsAn array of NvMediaArrayAllocAttr Allocation attributes.
[in]numAttrsNumber of allocation objects attrs.
Returns
NvMediaArray Handle to array. Null if unsuccessful.
NvMediaStatus NvMediaArrayDestroy ( NvMediaArray handle)

Destroys an array created by NvMediaArrayCreate().

Parameters
[in]handleThe handle to the array to be destroyed.
Returns
NvMediaStatus The status of the API. Possible return values are:
NvMediaStatus NvMediaArrayGetElemSizeForType ( NvMediaArrayType  type,
uint32_t *  elementSize 
)

Gets the size of an element, for a particular type of array element.

Parameters
[in]typeNvMediaArrayType Type of element.
[out]elementSizePointer to size of element in bytes.
Returns
NvMediaStatus The status of the API. Possible return values are:
NvMediaStatus NvMediaArrayGetProperties ( NvMediaArray handle,
NvMediaArrayType elementType,
uint32_t *  capacity,
uint32_t *  stride 
)

Helper function to get array properties with which array was created.

Parameters
[in]handleThe handle to the array.
[out]elementTypeType of elements NvMediaArrayType.
[out]capacityPointer to the capacity (Number of elements).
[out]stridePointer to the stride (Stride in bytes to move to next element).
Returns
NvMediaStatus The status of the API. Possible return values are:
NvMediaStatus NvMediaArrayGetSize ( NvMediaArray handle,
uint32_t *  numElementsPtr 
)

Gets the size of the array.

An array's size is the number of populated elements in the array. If the array has not been written to, the function sets *numElementsPtr to 0.

Parameters
[in]handleThe handle to the array.
[out]numElementsPtrPointer to the number of valid elements.
Returns
NvMediaStatus The status of the API. Possible return values are:
NvMediaStatus NvMediaArrayGetStatus ( NvMediaArray handle,
uint32_t  millisecondWait,
NvMediaTaskStatus status 
)

Gets the status of the current/last operation for the Array and optionally waits for the operation to complete/timeout.

Parameters
[in]handleThe handle to the array.
[in]millisecondWaitTime in milliseconds to wait for operation to complete before getting status. NVMEDIA_ARRAY_TIMEOUT_INFINITE means wait till operation is completed and then get status.
[out]statusStatus of the operation.
Returns
NvMediaStatus The status of the function call. Possible values are:
NvMediaStatus NvMediaArrayGetVersion ( NvMediaVersion version)

Returns the version information for the NvMediaArray library.

Parameters
[in]versionA pointer to a NvMediaVersion structure filled by the NvMediaArray library.
Returns
NvMediaStatus The status of the operation. Possible values are:
NvMediaStatus NvMediaArraySetSize ( NvMediaArray handle,
uint32_t  numElements 
)

Sets the size of the array.

Call this function before writing to the array. The number of elements must be less than the number with which the array was created. An array's size is the number of populated elements in the array.

See also
NvMediaArrayCreate().
Parameters
[in]handleThe handle to the array.
[in]numElementsNumber of elements to set the size to.
Returns
NvMediaStatus The status of the API. Possible return values are: