File: codeccontext.pxd

package info (click to toggle)
python-av 16.0.1-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 1,684 kB
  • sloc: python: 7,607; sh: 182; ansic: 174; makefile: 135
file content (33 lines) | stat: -rw-r--r-- 1,060 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
cimport libav as lib

from av.codec.context cimport CodecContext
from av.video.format cimport VideoFormat
from av.video.frame cimport VideoFrame
from av.video.reformatter cimport VideoReformatter


# The get_format callback in AVCodecContext is called by the decoder to pick a format out of a list.
# When we want accelerated decoding, we need to figure out ahead of time what the format should be,
# and find a way to pass that into our callback so we can return it to the decoder. We use the 'opaque'
# user data field in AVCodecContext for that. This is the struct we store a pointer to in that field.
cdef struct AVCodecPrivateData:
    lib.AVPixelFormat hardware_pix_fmt
    bint allow_software_fallback


cdef class VideoCodecContext(CodecContext):

    cdef AVCodecPrivateData _private_data

    cdef VideoFormat _format
    cdef _build_format(self)

    cdef int last_w
    cdef int last_h
    cdef readonly VideoReformatter reformatter

    # For encoding.
    cdef readonly int encoded_frame_count

    # For decoding.
    cdef VideoFrame next_frame