Skip to content

Commit

Permalink
Add type definitions for AudioCodecContext encoding / decoding
Browse files Browse the repository at this point in the history
The `encode`, `encode_lazy` and `decode` methods were missing type
definitions.
  • Loading branch information
jlaine committed Jun 21, 2024
1 parent a1400ad commit 74fe3fd
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion av/audio/codeccontext.pyi
Original file line number Diff line number Diff line change
@@ -1,8 +1,10 @@
from typing import Literal
from typing import Iterator, Literal

from av.codec.context import CodecContext
from av.packet import Packet

from .format import AudioFormat
from .frame import AudioFrame
from .layout import AudioLayout

class AudioCodecContext(CodecContext):
Expand All @@ -14,3 +16,7 @@ class AudioCodecContext(CodecContext):
layout: AudioLayout
format: AudioFormat
type: Literal["audio"]

def encode(self, frame: AudioFrame | None = None) -> list[Packet]: ...
def encode_lazy(self, frame: AudioFrame | None = None) -> Iterator[Packet]: ...
def decode(self, packet: Packet | None = None) -> list[AudioFrame]: ...

0 comments on commit 74fe3fd

Please sign in to comment.