| 1 |
cimport libav as lib |
| 2 |
|
| 3 |
from av.video.frame cimport VideoFrame |
| 4 |
|
| 5 |
|
| 6 |
cdef extern from "libswscale/swscale.h" nogil: |
| 7 |
cdef struct SwsContext: |
| 8 |
unsigned flags |
| 9 |
int threads |
| 10 |
|
| 11 |
cdef int SWS_FAST_BILINEAR |
| 12 |
cdef int SWS_BILINEAR |
| 13 |
cdef int SWS_BICUBIC |
| 14 |
cdef int SWS_X |
| 15 |
cdef int SWS_POINT |
| 16 |
cdef int SWS_AREA |
| 17 |
cdef int SWS_BICUBLIN |
| 18 |
cdef int SWS_GAUSS |
| 19 |
cdef int SWS_SINC |
| 20 |
cdef int SWS_LANCZOS |
| 21 |
cdef int SWS_SPLINE |
| 22 |
cdef int SWS_CS_ITU709 |
| 23 |
cdef int SWS_CS_FCC |
| 24 |
cdef int SWS_CS_ITU601 |
| 25 |
cdef int SWS_CS_ITU624 |
| 26 |
cdef int SWS_CS_SMPTE170M |
| 27 |
cdef int SWS_CS_SMPTE240M |
| 28 |
cdef int SWS_CS_DEFAULT |
| 29 |
|
| 30 |
cdef SwsContext *sws_alloc_context() |
| 31 |
cdef void sws_free_context(SwsContext **ctx) |
| 32 |
cdef int sws_scale_frame(SwsContext *c, lib.AVFrame *dst, const lib.AVFrame *src) |
| 33 |
|
| 34 |
cdef class VideoReformatter: |
| 35 |
cdef SwsContext *ptr |
| 36 |
cdef _reformat(self, VideoFrame frame, int width, int height, |
| 37 |
lib.AVPixelFormat format, int src_colorspace, |
| 38 |
int dst_colorspace, int interpolation, |
| 39 |
int src_color_range, int dst_color_range, |
| 40 |
int dst_color_trc, int dst_color_primaries, |
| 41 |
bint set_dst_color_trc, bint set_dst_color_primaries, |
| 42 |
int threads) |