NVIDIA DRIVE OS Linux API Reference

5.1.3.0 Release

 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
Image Locking and Unlocking

Detailed Description

Locking and unlocking provides acces to the image surfaces.

Data Structures

struct  NvMediaImageSurface
 Image surface descriptor used by NvMediaImageLock. More...
 
struct  NvMediaImageSurfaceMap
 Image surface map descriptor used by NvMediaImageLock. More...
 

Enumerations

enum  NvMediaImageLockAccess {
  NVMEDIA_IMAGE_ACCESS_READ = (1u << 0),
  NVMEDIA_IMAGE_ACCESS_WRITE = (1u << 1),
  NVMEDIA_IMAGE_ACCESS_READ_WRITE = (NVMEDIA_IMAGE_ACCESS_READ | NVMEDIA_IMAGE_ACCESS_WRITE)
}
 Image lock access types. More...
 
enum  NvMediaArrayLockAccess {
  NVMEDIA_ARRAY_ACCESS_READ = (1 << 0),
  NVMEDIA_ARRAY_ACCESS_WRITE = (1 << 1),
  NVMEDIA_ARRAY_ACCESS_READ_WRITE = (NVMEDIA_ARRAY_ACCESS_READ | NVMEDIA_ARRAY_ACCESS_WRITE)
}
 Defines array-lock access types. More...
 

Functions

NvMediaStatus NvMediaImageLock (NvMediaImage *image, uint32_t lockAccessType, NvMediaImageSurfaceMap *surfaceMap)
 Locks an image and returns the associated mapped pointers pointing to the image surface data. More...
 
void NvMediaImageUnlock (NvMediaImage *image)
 Unlocks an image. More...
 
NvMediaStatus NvMediaArrayLock (NvMediaArray *handle, NvMediaArrayLockAccess lockAccessType, void **ptr)
 Locks an Array to which data can be written/read without interference from another thread/process. More...
 
void NvMediaArrayUnlock (NvMediaArray *handle)
 Unlocks an Array. More...
 
NvMediaStatus NvMediaImagePyramidLock (NvMediaImagePyramid *pyramid, uint32_t lockAccessType, NvMediaImageSurfaceMap *surfaceMap)
 Locks an image pyramid and returns the associated mapped pointers pointing to the image pyramid surface data. More...
 
void NvMediaImagePyramidUnlock (NvMediaImagePyramid *pyramid)
 Unlocks an image pyramid. More...
 

Enumeration Type Documentation

Defines array-lock access types.

Enumerator
NVMEDIA_ARRAY_ACCESS_READ 

Read access.

NVMEDIA_ARRAY_ACCESS_WRITE 

Write access.

NVMEDIA_ARRAY_ACCESS_READ_WRITE 

Read/Write access.

Definition at line 109 of file nvmedia_array.h.

Image lock access types.

Enumerator
NVMEDIA_IMAGE_ACCESS_READ 

Read access.

NVMEDIA_IMAGE_ACCESS_WRITE 

Write access.

NVMEDIA_IMAGE_ACCESS_READ_WRITE 

Read/Write access.

Definition at line 201 of file nvmedia_image.h.

Function Documentation

NvMediaStatus NvMediaArrayLock ( NvMediaArray handle,
NvMediaArrayLockAccess  lockAccessType,
void **  ptr 
)

Locks an Array to which data can be written/read without interference from another thread/process.

If the array is being used by an internal engine, this function waits until the completion of this operation.

Parameters
[in]handleHandle to the array to be locked.
[in]lockAccessTypeDetermines the access type.
[out]ptrCPU mapped pointer to which data can be read/written. The following access types are supported and may be OR'd together:
Returns
NvMediaStatus The completion status of the operation. Possible values are:
void NvMediaArrayUnlock ( NvMediaArray handle)

Unlocks an Array.

To be called after data has been written to it/read from it by client.

Parameters
[in]handleHandle to the array to be unlocked.
Returns
void
NvMediaStatus NvMediaImageLock ( NvMediaImage image,
uint32_t  lockAccessType,
NvMediaImageSurfaceMap surfaceMap 
)

Locks an image and returns the associated mapped pointers pointing to the image surface data.

Only images created without the NVM_SURF_ATTR_CPU_ACCESS_UNMAPPED attribute can be accessed by CPU. If an image is being used by an internal engine this function waits until the completion of this operation.

Parameters
[in]imageImage object
[in]lockAccessTypeDetermines the access type. The following access types are supported and may be OR'd together:
NVMEDIA_IMAGE_ACCESS_READ Read access
NVMEDIA_IMAGE_ACCESS_WRITE Write access
NVMEDIA_IMAGE_ACCESS_READ_WRITE Read/Write access
[out]surfaceMapSurface descriptors
Returns
NvMediaStatus The completion status of the operation. Possible values are:
NVMEDIA_STATUS_OK
NVMEDIA_STATUS_ERROR
NvMediaStatus NvMediaImagePyramidLock ( NvMediaImagePyramid pyramid,
uint32_t  lockAccessType,
NvMediaImageSurfaceMap surfaceMap 
)

Locks an image pyramid and returns the associated mapped pointers pointing to the image pyramid surface data.

Only images created without the NVM_SURF_ATTR_CPU_ACCESS_UNMAPPED attribute can be accessed by CPU. If an image is being used by an internal engine this function waits until the completion of this operation.

Parameters
[in]pyramidImage pyramid object
[in]lockAccessTypeDetermines the access type. The following access types are supported and may be OR'd together:
NVMEDIA_IMAGE_ACCESS_READ Read access
NVMEDIA_IMAGE_ACCESS_WRITE Write access
NVMEDIA_IMAGE_ACCESS_READ_WRITE Read/Write access
[out]surfaceMapArray of Surface descriptors per level.
Returns
NvMediaStatus The completion status of the operation. Possible values are:
NVMEDIA_STATUS_OK
NVMEDIA_STATUS_ERROR
void NvMediaImagePyramidUnlock ( NvMediaImagePyramid pyramid)

Unlocks an image pyramid.

Internal engines cannot use a surface until it is locked.

Parameters
[in]pyramidPyramid object to unlock
Returns
void
void NvMediaImageUnlock ( NvMediaImage image)

Unlocks an image.

Internal engines cannot use a surface until it is locked.

Parameters
[in]imageImage object to unlock
Returns
void