| 1 |
cimport libav as lib |
| 2 |
|
| 3 |
from av.codec.context cimport CodecContext |
| 4 |
from av.video.format cimport VideoFormat |
| 5 |
from av.video.frame cimport VideoFrame |
| 6 |
from av.video.reformatter cimport VideoReformatter |
| 7 |
|
| 8 |
|
| 9 |
# The get_format callback in AVCodecContext is called by the decoder to pick a format out of a list. |
| 10 |
# When we want accelerated decoding, we need to figure out ahead of time what the format should be, |
| 11 |
# and find a way to pass that into our callback so we can return it to the decoder. We use the 'opaque' |
| 12 |
# user data field in AVCodecContext for that. This is the struct we store a pointer to in that field. |
| 13 |
cdef struct AVCodecPrivateData: |
| 14 |
lib.AVPixelFormat hardware_pix_fmt |
| 15 |
bint allow_software_fallback |
| 16 |
|
| 17 |
|
| 18 |
cdef class VideoCodecContext(CodecContext): |
| 19 |
cdef AVCodecPrivateData _private_data |
| 20 |
cdef readonly VideoReformatter reformatter |
| 21 |
cdef VideoFrame next_frame |