NVIDIA DRIVE 5.0 Linux SDK API Reference

5.0.10.3 Release

 All Data Structures 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 = (1 << 0),
  NVMEDIA_IMAGE_ACCESS_WRITE = (1 << 1),
  NVMEDIA_IMAGE_ACCESS_READ_WRITE = (NVMEDIA_IMAGE_ACCESS_READ | NVMEDIA_IMAGE_ACCESS_WRITE)
}
 Image 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...
 

Enumeration Type Documentation

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 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
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