Skip to content

Commit

Permalink
update snapshot
Browse files Browse the repository at this point in the history
  • Loading branch information
lucemia committed Mar 14, 2024
1 parent a1689ba commit 74efae5
Show file tree
Hide file tree
Showing 9 changed files with 222 additions and 261 deletions.
8 changes: 7 additions & 1 deletion src/ffmpeg/common/schema.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,14 @@


class StreamType(str, Enum):
video = "video"
"""
The type of a stream. (audio or video)
"""

audio = "audio"
"""it is an audio stream"""
video = "video"
"""it is a video stream"""


class FFMpegFilterOptionType(str, Enum):
Expand Down
61 changes: 14 additions & 47 deletions src/ffmpeg/common/tests/__snapshots__/test_serialize.ambr
Original file line number Diff line number Diff line change
Expand Up @@ -112,16 +112,10 @@
],
"name": "trim",
"input_typings": [
{
"__class__": "ffmpeg.schema.StreamType",
"value": "video"
}
"video"
],
"output_typings": [
{
"__class__": "ffmpeg.schema.StreamType",
"value": "video"
}
"video"
]
},
"index": 0
Expand Down Expand Up @@ -154,16 +148,10 @@
],
"name": "trim",
"input_typings": [
{
"__class__": "ffmpeg.schema.StreamType",
"value": "video"
}
"video"
],
"output_typings": [
{
"__class__": "ffmpeg.schema.StreamType",
"value": "video"
}
"video"
]
},
"index": 0
Expand All @@ -172,17 +160,17 @@
"name": "concat",
"input_typings": [
{
"__class__": "ffmpeg.schema.StreamType",
"__class__": "ffmpeg.common.schema.StreamType",
"value": "video"
},
{
"__class__": "ffmpeg.schema.StreamType",
"__class__": "ffmpeg.common.schema.StreamType",
"value": "video"
}
],
"output_typings": [
{
"__class__": "ffmpeg.schema.StreamType",
"__class__": "ffmpeg.common.schema.StreamType",
"value": "video"
}
]
Expand All @@ -208,54 +196,33 @@
],
"name": "hflip",
"input_typings": [
{
"__class__": "ffmpeg.schema.StreamType",
"value": "video"
}
"video"
],
"output_typings": [
{
"__class__": "ffmpeg.schema.StreamType",
"value": "video"
}
"video"
]
},
"index": 0
}
],
"name": "overlay",
"input_typings": [
{
"__class__": "ffmpeg.schema.StreamType",
"value": "video"
},
{
"__class__": "ffmpeg.schema.StreamType",
"value": "video"
}
"video",
"video"
],
"output_typings": [
{
"__class__": "ffmpeg.schema.StreamType",
"value": "video"
}
"video"
]
},
"index": 0
}
],
"name": "drawbox",
"input_typings": [
{
"__class__": "ffmpeg.schema.StreamType",
"value": "video"
}
"video"
],
"output_typings": [
{
"__class__": "ffmpeg.schema.StreamType",
"value": "video"
}
"video"
]
},
"index": 0
Expand Down
11 changes: 2 additions & 9 deletions src/ffmpeg/dag/factory.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,19 +9,12 @@
def filter_node_factory(filter: FFMpegFilterDef, *inputs: FilterableStream, **kwargs: Any) -> FilterNode:

if isinstance(filter.typings_input, str):
input_typings = eval(
filter.typings_input,
{
"StreamType": StreamType,
"re": re,
}
| kwargs,
)
input_typings = tuple(eval(filter.typings_input, {"StreamType": StreamType, "re": re, **kwargs}))
else:
input_typings = filter.typings_input

if isinstance(filter.typings_output, str):
output_typings = eval(filter.typings_output)
output_typings = tuple(eval(filter.typings_output, {"StreamType": StreamType, "re": re, **kwargs}))
else:
output_typings = filter.typings_output

Expand Down
Loading

0 comments on commit 74efae5

Please sign in to comment.