Struct CPUBuffer

Struct Documentation

struct CPUBuffer

Contiguous array data on CPU memory.

CPUBuffer represents a multi-dimensional array in CPU memory with shape and data type information. Used for exposing the decoded media frames data to array libraries like NumPy and PyTorch.

Public Functions

void *data()

Get pointer to the buffer data.

Returns:

Pointer to the data.

Public Members

std::shared_ptr<CPUStorage> storage

Storage backing the buffer data.

std::vector<size_t> shape

Shape of the buffer (dimensions).

ElemClass elem_class = ElemClass::UInt

Element class (Int, UInt, or Float).

size_t depth = sizeof(uint8_t)

Size of each element in bytes.