File size: 660 Bytes
06555b5 |
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 |
from abc import ABCMeta, abstractmethod
from typing import List, Tuple
from av.frame import Frame
from av.packet import Packet
from ..jitterbuffer import JitterFrame
class Decoder(metaclass=ABCMeta):
@abstractmethod
def decode(self, encoded_frame: JitterFrame) -> List[Frame]:
pass # pragma: no cover
class Encoder(metaclass=ABCMeta):
@abstractmethod
def encode(
self, frame: Frame, force_keyframe: bool = False
) -> Tuple[List[bytes], int]:
pass # pragma: no cover
@abstractmethod
def pack(self, packet: Packet) -> Tuple[List[bytes], int]:
pass # pragma: no cover
|