Skip to content

Commit 1613fb5

Browse files
tikuma-lsuhschokiedsp
authored andcommitted
moved type defs around
1 parent b6aeedd commit 1613fb5

4 files changed

Lines changed: 40 additions & 68 deletions

File tree

src/ffmpegio/_typing.py

Lines changed: 0 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -33,20 +33,7 @@
3333
"""
3434

3535

36-
37-
3836
MediaType = Literal["audio", "video"]
3937

4038
FFmpegUrlType = Union[str, Path, ParseResult]
41-
FFmpegInputType = Literal["url", "filtergraph", "buffer", "fileobj"]
42-
FFmpegOutputType = Literal["url", "fileobj"]
43-
44-
45-
46-
class InputSourceDict(TypedDict):
47-
"""input source info"""
4839

49-
src_type: FFmpegInputType # True if file path/url
50-
bytes: NotRequired[bytes] # index of the source index
51-
fileobj: NotRequired[IO] # file object
52-
pipe: NotRequired[NPopen] # pipe

src/ffmpegio/configure.py

Lines changed: 38 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,16 @@
11
from __future__ import annotations
22

3-
from .typing import Literal, Any, FFmpegArgs, FFmpegUrlType
3+
from ._typing import (
4+
Literal,
5+
Any,
6+
MediaType,
7+
FFmpegUrlType,
8+
Union,
9+
NotRequired,
10+
TypedDict,
11+
IO,
12+
Buffer,
13+
)
414
from collections.abc import Sequence
515

616
from fractions import Fraction
@@ -16,6 +26,33 @@
1626
from ._utils import as_multi_option, is_non_str_sequence
1727

1828
UrlType = Literal["input", "output"]
29+
FFmpegInputType = Literal["url", "filtergraph", "buffer", "fileobj"]
30+
FFmpegOutputType = Literal["url", "fileobj"]
31+
32+
FFmpegInputUrlComposite = Union[FFmpegUrlType, FilterGraphObject, IO, Buffer]
33+
FFmpegOutputUrlComposite = Union[FFmpegUrlType, IO]
34+
35+
36+
class FFmpegArgs(TypedDict):
37+
"""FFmpeg arguments"""
38+
39+
inputs: list[
40+
tuple[FFmpegUrlType | FilterGraphObject | FFConcat, dict | None]
41+
] # list of input definitions (pairs of url and options)
42+
outputs: list[
43+
tuple[FFmpegUrlType, dict | None]
44+
] # list of output definitions (pairs of url and options)
45+
global_options: NotRequired[dict | None] # FFmpeg global options
46+
47+
48+
class InputSourceDict(TypedDict):
49+
"""input source info"""
50+
51+
src_type: FFmpegInputType # True if file path/url
52+
bytes: NotRequired[bytes] # index of the source index
53+
fileobj: NotRequired[IO] # file object
54+
pipe: NotRequired[NPopen] # pipe
55+
1956

2057

2158
def array_to_video_input(

src/ffmpegio/typing.py

Lines changed: 2 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -10,19 +10,7 @@
1010

1111
from .stream_spec import MediaType, StreamSpecDict, StreamSpecDictMediaType
1212

13-
# from typing_extensions import *
14-
13+
from .configure import FFmpegArgs, FFmpegUrlType
1514

16-
class FFmpegArgs(TypedDict):
17-
"""FFmpeg arguments"""
18-
19-
inputs: list[
20-
tuple[FFmpegUrlType | FilterGraphObject, dict | None]
21-
] # list of input definitions (pairs of url and options)
22-
outputs: list[
23-
tuple[FFmpegUrlType, dict | None]
24-
] # list of output definitions (pairs of url and options)
25-
global_options: NotRequired[dict | None] # FFmpeg global options
15+
# from typing_extensions import *
2616

27-
FFmpegInputUrlComposite = Union[FFmpegUrlType, FilterGraphObject, IO, Buffer]
28-
FFmpegOutputUrlComposite = Union[FFmpegUrlType, IO]

src/ffmpegio/utils/typing.py

Lines changed: 0 additions & 40 deletions
This file was deleted.

0 commit comments

Comments
 (0)