Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions av/subtitles/stream.pyi
Original file line number Diff line number Diff line change
@@ -1,9 +1,12 @@
from typing import final

from av.packet import Packet
from av.stream import Stream
from av.subtitles.subtitle import AssSubtitle, BitmapSubtitle, SubtitleSet

from .codeccontext import SubtitleCodecContext

@final
class SubtitleStream(Stream):
codec_context: SubtitleCodecContext
def decode(
Expand Down
14 changes: 12 additions & 2 deletions av/subtitles/subtitle.pyi
Original file line number Diff line number Diff line change
@@ -1,6 +1,12 @@
from collections.abc import Iterator
from typing import Literal
from typing import Literal, final

from typing_extensions import disjoint_base

@final
class SubtitleProxy: ...

@final
class SubtitleSet:
format: int
start_display_time: int
Expand All @@ -18,11 +24,13 @@ class SubtitleSet:
) -> SubtitleSet: ...
def __len__(self) -> int: ...
def __iter__(self) -> Iterator[Subtitle]: ...
def __getitem__(self, i: int) -> Subtitle: ...
def __getitem__(self, i: int, /) -> Subtitle: ...

@disjoint_base
class Subtitle:
type: bytes

@final
class BitmapSubtitle(Subtitle):
type: Literal[b"bitmap"]
x: int
Expand All @@ -32,11 +40,13 @@ class BitmapSubtitle(Subtitle):
nb_colors: int
planes: tuple[BitmapSubtitlePlane, ...]

@final
class BitmapSubtitlePlane:
subtitle: BitmapSubtitle
index: int
buffer_size: int

@final
class AssSubtitle(Subtitle):
type: Literal[b"ass", b"text"]
@property
Expand Down