MapBuffer
Function Usage
Maps the data in a buffer to the memory.
- If the data in the buffer can be mapped to the continuous memory in user mode, the data and dataLen fields in the buffer field must be filled for this interface.
- If the buffer data cannot be mapped to the continuous memory, set the data pointer in the buffer field to null and fill the dataLen field.
Restrictions
N/A
Prototype
int32_t MapBuffer(GpuEncoderBufferT &buffer, uint32_t flag = FLAG_READ) = 0
Parameters
Field Name |
Input/Output |
Field Type |
Description |
|---|---|---|---|
buffer |
Input |
GpuEncoderBufferT & |
Pointer to the buffer to be mapped. |
flag |
Input |
uint32_t |
Configures the access type of the mapping data, including read or write. |
The value of flag is FLAG_READ | FLAG_WRITE when both read and write are enabled.
enum MapFlag : uint32_t {
FLAG_READ = 1,
FLAG_WRITE = 1 << 1,
};
Returns
Data type: GpuEncoderErrorCode
The value can be:
- OK: The data in the buffer is successfully mapped.
- Other values except OK: The data in the buffer fails to be mapped.