-
Notifications
You must be signed in to change notification settings - Fork 9
Expand file tree
/
Copy pathtyping.py
More file actions
33 lines (20 loc) · 836 Bytes
/
typing.py
File metadata and controls
33 lines (20 loc) · 836 Bytes
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
from __future__ import annotations
from typing import *
from typing_extensions import *
# from typing_extensions import *
MediaType = Literal["v", "a", "s", "d", "t", "V"]
# libavformat/avformat.c:match_stream_specifier()
class StreamSpec_Options(TypedDict):
media_type: MediaType # py3.11 NotRequired[MediaType]
file_index: int # py3.11 NotRequired[int]
program_id: int # py3.11 NotRequired[int]
group_index: int # py3.11 NotRequired[int]
group_id: int # py3.11 NotRequired[int]
stream_id: int # py3.11 NotRequired[int]
class StreamSpec_Index(StreamSpec_Options):
index: int
class StreamSpec_Tag(StreamSpec_Options):
tag: Union[str, Tuple[str, str]]
class StreamSpec_Usable(StreamSpec_Options):
usable: bool
StreamSpec = Union[StreamSpec_Index, StreamSpec_Tag, StreamSpec_Usable]