@@ -3,6 +3,7 @@ from libc.stdint cimport int64_t
33
44from av.bytesource cimport ByteSource
55from av.codec.codec cimport Codec
6+ from av.codec.hwaccel cimport HWAccel
67from av.frame cimport Frame
78from av.packet cimport Packet
89
@@ -18,11 +19,12 @@ cdef class CodecContext:
1819 cdef int stream_index
1920
2021 cdef lib.AVCodecParserContext * parser
21- cdef _init(self , lib.AVCodecContext * ptr, const lib.AVCodec * codec)
22+ cdef _init(self , lib.AVCodecContext * ptr, const lib.AVCodec * codec, HWAccel hwaccel )
2223
2324 # Public API.
2425 cdef readonly bint is_open
2526 cdef readonly Codec codec
27+ cdef readonly HWAccel hwaccel
2628 cdef public dict options
2729 cpdef open (self , bint strict = ?)
2830
@@ -31,6 +33,9 @@ cdef class CodecContext:
3133 cpdef decode(self , Packet packet = ?)
3234 cpdef flush_buffers(self )
3335
36+ # Used by hardware-accelerated decode.
37+ cdef HWAccel hwaccel_ctx
38+
3439 # Used by both transcode APIs to setup user-land objects.
3540 # TODO: Remove the `Packet` from `_setup_decoded_frame` (because flushing packets
3641 # are bogus). It should take all info it needs from the context and/or stream.
@@ -49,10 +54,11 @@ cdef class CodecContext:
4954 cdef _send_packet_and_recv(self , Packet packet)
5055 cdef _recv_frame(self )
5156
57+ cdef _transfer_hwframe(self , Frame frame)
58+
5259 # Implemented by children for the generic send/recv API, so we have the
5360 # correct subclass of Frame.
5461 cdef Frame _next_frame
5562 cdef Frame _alloc_next_frame(self )
5663
57-
58- cdef CodecContext wrap_codec_context(lib.AVCodecContext* , const lib.AVCodec* )
64+ cdef CodecContext wrap_codec_context(lib.AVCodecContext* , const lib.AVCodec* , HWAccel hwaccel)
0 commit comments