| 1 |
from libc.stdint cimport int64_t, uint8_t, uint16_t, uint64_t |
| 2 |
|
| 3 |
from av.plane cimport Plane |
| 4 |
from av.video.format cimport VideoFormatComponent |
| 5 |
|
| 6 |
|
| 7 |
cdef class VideoPlane(Plane): |
| 8 |
cdef readonly size_t buffer_size |
| 9 |
cdef readonly unsigned int width, height |
| 10 |
|
| 11 |
|
| 12 |
cdef enum DeviceType: |
| 13 |
kCPU = 1 |
| 14 |
kCuda = 2 |
| 15 |
|
| 16 |
cdef struct DLDataType: |
| 17 |
uint8_t code |
| 18 |
uint8_t bits |
| 19 |
uint16_t lanes |
| 20 |
|
| 21 |
cdef struct DLTensor: |
| 22 |
void* data |
| 23 |
int device_type |
| 24 |
int device_id |
| 25 |
int ndim |
| 26 |
DLDataType dtype |
| 27 |
int64_t* shape |
| 28 |
int64_t* strides |
| 29 |
uint64_t byte_offset |
| 30 |
|
| 31 |
cdef struct DLManagedTensor |
| 32 |
|
| 33 |
ctypedef void (*DLManagedTensorDeleter)(DLManagedTensor*) noexcept nogil |
| 34 |
|
| 35 |
cdef struct DLManagedTensor: |
| 36 |
DLTensor dl_tensor |
| 37 |
void* manager_ctx |
| 38 |
DLManagedTensorDeleter deleter |