NVIDIA DRIVE OS Linux SDK API Reference

5.2.6 Release
For Test and Development only
nvmedia_array.h
Go to the documentation of this file.
1 /*
2  * Copyright (c) 2018-2019, NVIDIA CORPORATION. All rights reserved. All
3  * information contained herein is proprietary and confidential to NVIDIA
4  * Corporation. Any use, reproduction, or disclosure without the written
5  * permission of NVIDIA Corporation is prohibited.
6  */
7 
8 
17 #ifndef NVMEDIA_ARRAY_H
18 #define NVMEDIA_ARRAY_H
19 
20 #ifdef __cplusplus
21 extern "C" {
22 #endif
23 
24 #include "nvmedia_core.h"
47 #define NVMEDIA_ARRAY_VERSION_MAJOR (2u)
48 
49 #define NVMEDIA_ARRAY_VERSION_MINOR (2u)
50 
55 #define NVMEDIA_ARRAY_TIMEOUT_INFINITE 0xFFFFFFFFu
56 
59 typedef enum {
82 
88 typedef struct NvMediaArray NvMediaArray;
89 
93 typedef enum {
97 
101 #define NVM_ARRAY_ATTR_CPU_ACCESS_UNCACHED 0x00000000u
102 
103 #define NVM_ARRAY_ATTR_CPU_ACCESS_CACHED 0x00000001u
104 
108 typedef struct {
112  uint32_t value;
114 
119 typedef enum {
127 
137  NvMediaVersion *version
138 );
139 
152 NvMediaArray *
154  NvMediaDevice *device,
156  uint32_t stride,
157  uint32_t numElements,
158  const NvMediaArrayAllocAttr *attrs,
159  uint32_t numAttrs
160 );
161 
171  NvMediaArray* handle
172 );
173 
186  uint32_t *elementSize
187 );
188 
205  NvMediaArray* handle,
206  uint32_t *numElementsPtr
207 );
208 
229  NvMediaArray* handle,
230  uint32_t numElements
231 );
232 
248  NvMediaArray* handle,
249  NvMediaArrayType* elementType,
250  uint32_t* capacity,
251  uint32_t* stride
252 );
253 
273  NvMediaArray *handle,
274  uint32_t millisecondWait,
275  NvMediaTaskStatus *status
276 );
277 
302  NvMediaArray *handle,
303  NvMediaArrayLockAccess lockAccessType,
304  void **ptr
305 );
306 
316 void
318  NvMediaArray *handle
319 );
322 /*
323  * \defgroup history_nvmedia_array History
324  * Provides change history for the NvMedia Array API.
325  *
326  * \section history_nvmedia_arrays Version History
327  *
328  * <b> Version 1.0 </b> December 4, 2017
329  * - Initial Release.
330  *
331  * <b> Version 2.0 </b> June 1, 2018
332  * - Remove keypoint type. VPI-specific types are in VPI headers.
333  *
334  * <b> Version 2.1 </b> July 9, 2018
335  * - Add version query API.
336  *
337  * <b> Version 2.2 </b> June 18, 2019
338  * - Notes to Deprecate the NvMediaArrayCreate API
339  * in support of NvSciBuf APIs.
340  */
341 
344 #ifdef __cplusplus
345 }; /* extern "C" */
346 #endif
347 
348 #endif // NVMEDIA_ARRAY_H
NVMEDIA_ARRAY_TYPE_FLOAT16
@ NVMEDIA_ARRAY_TYPE_FLOAT16
Specifies a float 16-bit array.
Definition: nvmedia_array.h:71
NvMediaArrayAllocAttr::value
uint32_t value
Array allocation attribute value.
Definition: nvmedia_array.h:112
NvMediaArrayLockAccess
NvMediaArrayLockAccess
Defines array-lock access types.
Definition: nvmedia_array.h:119
NvMediaArraySetSize
NvMediaStatus NvMediaArraySetSize(NvMediaArray *handle, uint32_t numElements)
Sets the size of an array (the number of populated elements in the array).
NVMEDIA_ARRAY_TYPE_UNDEFINED
@ NVMEDIA_ARRAY_TYPE_UNDEFINED
Specifies an undefined array type.
Definition: nvmedia_array.h:61
NVMEDIA_ARRAY_TYPE_UINT16
@ NVMEDIA_ARRAY_TYPE_UINT16
Specifies an unsigned 16-bit array.
Definition: nvmedia_array.h:69
NvMediaArrayAllocAttr::type
NvMediaArrayAllocAttrType type
Array allocation attribute type.
Definition: nvmedia_array.h:110
NvMediaArrayGetElemSizeForType
NvMediaStatus NvMediaArrayGetElemSizeForType(NvMediaArrayType type, uint32_t *elementSize)
Gets the size of a specified type of array element.
NVMEDIA_ARRAY_TYPE_FLOAT32
@ NVMEDIA_ARRAY_TYPE_FLOAT32
Specifies a float 32-bit array.
Definition: nvmedia_array.h:77
NvMediaDevice
struct NvMediaDevice NvMediaDevice
An opaque handle representing an NvMediaDevice object.
Definition: nvmedia_core.h:348
NVMEDIA_ARRAY_NUM_TYPES
@ NVMEDIA_ARRAY_NUM_TYPES
Number of types - If more types are needed, add above this pointer and update this constant.
Definition: nvmedia_array.h:80
NVMEDIA_ARRAY_TYPE_INT16
@ NVMEDIA_ARRAY_TYPE_INT16
Specifies a signed 16-bit array.
Definition: nvmedia_array.h:67
NvMediaVersion
Holds NvMedia version information.
Definition: nvmedia_core.h:237
type
int const char int type
Definition: drm-nvdc-docs.h:1479
nvmedia_core.h
NVIDIA Media Interface: Core
NvMediaArrayGetSize
NvMediaStatus NvMediaArrayGetSize(NvMediaArray *handle, uint32_t *numElementsPtr)
Gets the size of an array.
NvMediaStatus
NvMediaStatus
Defines all possible error codes.
Definition: nvmedia_core.h:180
NVM_ARRAY_ATTR_CPU_ACCESS
@ NVM_ARRAY_ATTR_CPU_ACCESS
! CPU access to surface flags (default: uncached).
Definition: nvmedia_array.h:95
NvMediaArrayGetVersion
NvMediaStatus NvMediaArrayGetVersion(NvMediaVersion *version)
Returns version information for the NvMediaArray library.
NVMEDIA_ARRAY_TYPE_UINT32
@ NVMEDIA_ARRAY_TYPE_UINT32
Specifies a unsigned 32-bit array.
Definition: nvmedia_array.h:73
NvMediaArrayAllocAttr
Holds array allocation attributes.
Definition: nvmedia_array.h:108
NVMEDIA_ARRAY_TYPE_UINT8
@ NVMEDIA_ARRAY_TYPE_UINT8
Specifies an unsigned 8-bit array.
Definition: nvmedia_array.h:65
NvMediaArrayGetStatus
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 operat...
NVMEDIA_ARRAY_ACCESS_READ_WRITE
@ NVMEDIA_ARRAY_ACCESS_READ_WRITE
Specifies read/write access.
Definition: nvmedia_array.h:125
NvMediaArrayLock
NvMediaStatus NvMediaArrayLock(NvMediaArray *handle, NvMediaArrayLockAccess lockAccessType, void **ptr)
Locks an array.
NvMediaArrayAllocAttrType
NvMediaArrayAllocAttrType
Defines NvMedia array allocation attribute types.
Definition: nvmedia_array.h:93
NVMEDIA_ARRAY_TYPE_INT32
@ NVMEDIA_ARRAY_TYPE_INT32
Specifies a signed 32-bit array.
Definition: nvmedia_array.h:75
NVMEDIA_ARRAY_ACCESS_WRITE
@ NVMEDIA_ARRAY_ACCESS_WRITE
Specifies write access.
Definition: nvmedia_array.h:123
NvMediaArrayType
NvMediaArrayType
Defines the different types of arrays.
Definition: nvmedia_array.h:59
NvMediaArrayUnlock
void NvMediaArrayUnlock(NvMediaArray *handle)
Unlocks an array.
NVMEDIA_ARRAY_TYPE_INT8
@ NVMEDIA_ARRAY_TYPE_INT8
Specifies a signed 8-bit array.
Definition: nvmedia_array.h:63
NvMediaTaskStatus
Holds status of latest operation for NvMedia managed data structure.
Definition: nvmedia_core.h:220
NvMediaArrayGetProperties
NvMediaStatus NvMediaArrayGetProperties(NvMediaArray *handle, NvMediaArrayType *elementType, uint32_t *capacity, uint32_t *stride)
Gets the array properties with which array was created.
NvMediaArray
struct NvMediaArray NvMediaArray
Holds a descriptor for an array.
Definition: nvmedia_array.h:88
NVMEDIA_ARRAY_ACCESS_READ
@ NVMEDIA_ARRAY_ACCESS_READ
Specifies read access.
Definition: nvmedia_array.h:121
NvMediaArrayCreate
NvMediaArray * NvMediaArrayCreate(NvMediaDevice *device, NvMediaArrayType type, uint32_t stride, uint32_t numElements, const NvMediaArrayAllocAttr *attrs, uint32_t numAttrs)
Creates an NvMedia Array.
NvMediaArrayDestroy
NvMediaStatus NvMediaArrayDestroy(NvMediaArray *handle)
Destroys an array created by NvMediaArrayCreate().