From 9d659179e1b91fd7caaad144789d25110e73e87d Mon Sep 17 00:00:00 2001 From: lucemia Date: Thu, 28 Mar 2024 01:47:18 +0000 Subject: [PATCH 1/2] fix #380 option typing --- src/ffmpeg/dag/global_runnable/global_args.py | 92 ++++----- src/ffmpeg/dag/io/_input.py | 105 +++++----- src/ffmpeg/dag/io/_output.py | 189 ++++++++--------- src/ffmpeg/dag/io/output_args.py | 190 +++++++++--------- src/ffmpeg/types.py | 9 +- src/scripts/code_gen/gen.py | 16 +- .../dag/global_runnable/global_args.py.jinja | 1 + .../code_gen/templates/dag/io/_input.py.jinja | 1 + .../templates/dag/io/_output.py.jinja | 1 + .../templates/dag/io/output_args.py.jinja | 1 + .../code_gen/templates/filters.py.jinja | 2 +- .../code_gen/templates/streams/audio.py.jinja | 2 +- .../code_gen/templates/streams/video.py.jinja | 2 +- 13 files changed, 313 insertions(+), 298 deletions(-) diff --git a/src/ffmpeg/dag/global_runnable/global_args.py b/src/ffmpeg/dag/global_runnable/global_args.py index 29271731..96b733cb 100644 --- a/src/ffmpeg/dag/global_runnable/global_args.py +++ b/src/ffmpeg/dag/global_runnable/global_args.py @@ -4,6 +4,8 @@ from abc import ABC, abstractmethod from typing import TYPE_CHECKING, Any +from ...types import Boolean, Float, Func, Int + if TYPE_CHECKING: from ..nodes import GlobalNode, GlobalStream, OutputStream @@ -16,51 +18,51 @@ def _global_node(self, *streams: OutputStream, **kwargs: Any) -> GlobalNode: def global_args( self, *, - loglevel: str = None, - v: str = None, - report: str = None, - max_alloc: str = None, - cpuflags: str = None, - cpucount: str = None, - hide_banner: bool = None, - y: bool = None, - n: bool = None, - ignore_unknown: bool = None, - copy_unknown: bool = None, - recast_media: bool = None, - benchmark: bool = None, - benchmark_all: bool = None, - progress: str = None, - stdin: bool = None, - timelimit: str = None, - dump: bool = None, - hex: bool = None, - frame_drop_threshold: float = None, - copyts: bool = None, - start_at_zero: bool = None, - copytb: int = None, - dts_delta_threshold: float = None, - dts_error_threshold: float = None, - xerror: bool = None, - abort_on: str = None, - filter_threads: str = None, - filter_complex: str = None, - filter_complex_threads: int = None, - lavfi: str = None, - filter_complex_script: str = None, - auto_conversion_filters: bool = None, - stats: bool = None, - stats_period: str = None, - debug_ts: bool = None, - max_error_rate: float = None, - vstats: str = None, - vstats_file: str = None, - vstats_version: int = None, - init_hw_device: str = None, - filter_hw_device: str = None, - adrift_threshold: str = None, - qphist: str = None, - vsync: str = None, + loglevel: Func = None, + v: Func = None, + report: Func = None, + max_alloc: Func = None, + cpuflags: Func = None, + cpucount: Func = None, + hide_banner: Boolean = None, + y: Boolean = None, + n: Boolean = None, + ignore_unknown: Boolean = None, + copy_unknown: Boolean = None, + recast_media: Boolean = None, + benchmark: Boolean = None, + benchmark_all: Boolean = None, + progress: Func = None, + stdin: Boolean = None, + timelimit: Func = None, + dump: Boolean = None, + hex: Boolean = None, + frame_drop_threshold: Float = None, + copyts: Boolean = None, + start_at_zero: Boolean = None, + copytb: Int = None, + dts_delta_threshold: Float = None, + dts_error_threshold: Float = None, + xerror: Boolean = None, + abort_on: Func = None, + filter_threads: Func = None, + filter_complex: Func = None, + filter_complex_threads: Int = None, + lavfi: Func = None, + filter_complex_script: Func = None, + auto_conversion_filters: Boolean = None, + stats: Boolean = None, + stats_period: Func = None, + debug_ts: Boolean = None, + max_error_rate: Float = None, + vstats: Func = None, + vstats_file: Func = None, + vstats_version: Int = None, + init_hw_device: Func = None, + filter_hw_device: Func = None, + adrift_threshold: Func = None, + qphist: Func = None, + vsync: Func = None, **kwargs: Any, ) -> GlobalStream: """ diff --git a/src/ffmpeg/dag/io/_input.py b/src/ffmpeg/dag/io/_input.py index 8af9eada..7ae370a6 100644 --- a/src/ffmpeg/dag/io/_input.py +++ b/src/ffmpeg/dag/io/_input.py @@ -5,64 +5,65 @@ from typing import Any from ...streams.av import AVStream +from ...types import Boolean, Double, Float, Int, String, Time from ..nodes import InputNode def input( filename: str | Path, *, - f: str = None, - c: str = None, - codec: str = None, - t: str | float | None = None, - to: str | float | None = None, - ss: str | float | None = None, - sseof: str | float | None = None, - seek_timestamp: int = None, - accurate_seek: bool = None, - isync: int = None, - itsoffset: str | float | None = None, - itsscale: float = None, - re: bool = None, - readrate: float = None, - readrate_initial_burst: float = None, - bitexact: bool = None, - tag: str = None, - reinit_filter: int = None, - dump_attachment: str = None, - stream_loop: int = None, - discard: str = None, - thread_queue_size: int = None, - find_stream_info: bool = None, - r: str = None, - s: str = None, - pix_fmt: str = None, - display_rotation: float = None, - display_hflip: bool = None, - display_vflip: bool = None, - vn: bool = None, - vcodec: str = None, - vtag: str = None, - hwaccel: str = None, - hwaccel_device: str = None, - hwaccel_output_format: str = None, - autorotate: bool = None, - ar: int = None, - ac: int = None, - an: bool = None, - acodec: str = None, - sample_fmt: str = None, - channel_layout: str = None, - ch_layout: str = None, - guess_layout_max: int = None, - sn: bool = None, - scodec: str = None, - fix_sub_duration: bool = None, - canvas_size: str = None, - bsf: str = None, - dcodec: str = None, - dn: bool = None, - top: int = None, + f: String = None, + c: String = None, + codec: String = None, + t: Time = None, + to: Time = None, + ss: Time = None, + sseof: Time = None, + seek_timestamp: Int = None, + accurate_seek: Boolean = None, + isync: Int = None, + itsoffset: Time = None, + itsscale: Double = None, + re: Boolean = None, + readrate: Float = None, + readrate_initial_burst: Double = None, + bitexact: Boolean = None, + tag: String = None, + reinit_filter: Int = None, + dump_attachment: String = None, + stream_loop: Int = None, + discard: String = None, + thread_queue_size: Int = None, + find_stream_info: Boolean = None, + r: String = None, + s: String = None, + pix_fmt: String = None, + display_rotation: Double = None, + display_hflip: Boolean = None, + display_vflip: Boolean = None, + vn: Boolean = None, + vcodec: String = None, + vtag: String = None, + hwaccel: String = None, + hwaccel_device: String = None, + hwaccel_output_format: String = None, + autorotate: Boolean = None, + ar: Int = None, + ac: Int = None, + an: Boolean = None, + acodec: String = None, + sample_fmt: String = None, + channel_layout: String = None, + ch_layout: String = None, + guess_layout_max: Int = None, + sn: Boolean = None, + scodec: String = None, + fix_sub_duration: Boolean = None, + canvas_size: String = None, + bsf: String = None, + dcodec: String = None, + dn: Boolean = None, + top: Int = None, **kwargs: Any ) -> AVStream: """ diff --git a/src/ffmpeg/dag/io/_output.py b/src/ffmpeg/dag/io/_output.py index db2054df..50bd08f0 100644 --- a/src/ffmpeg/dag/io/_output.py +++ b/src/ffmpeg/dag/io/_output.py @@ -4,106 +4,107 @@ from pathlib import Path from typing import Any +from ...types import Boolean, Float, Func, Int, Int64, String, Time from ..nodes import FilterableStream, OutputNode, OutputStream def output( *streams: FilterableStream, filename: str | Path, - f: str = None, - c: str = None, - codec: str = None, - pre: str = None, - map: str = None, - map_metadata: str = None, - map_chapters: int = None, - t: str | float | None = None, - to: str | float | None = None, - fs: int = None, - ss: str | float | None = None, - timestamp: str = None, - metadata: str = None, - program: str = None, - stream_group: str = None, - dframes: int = None, - target: str = None, - shortest: bool = None, - shortest_buf_duration: float = None, - bitexact: bool = None, - apad: str = None, - copyinkf: bool = None, - copypriorss: int = None, - frames: int = None, - tag: str = None, - q: str = None, - qscale: str = None, - profile: str = None, - filter: str = None, - filter_script: str = None, - attach: str = None, - disposition: str = None, - thread_queue_size: int = None, - bits_per_raw_sample: int = None, - stats_enc_pre: str = None, - stats_enc_post: str = None, - stats_mux_pre: str = None, - stats_enc_pre_fmt: str = None, - stats_enc_post_fmt: str = None, - stats_mux_pre_fmt: str = None, - vframes: int = None, - r: str = None, - fpsmax: str = None, - s: str = None, - aspect: str = None, - pix_fmt: str = None, - vn: bool = None, - rc_override: str = None, - vcodec: str = None, - timecode: str = None, - _pass: int = None, - passlogfile: str = None, - vf: str = None, - intra_matrix: str = None, - inter_matrix: str = None, - chroma_intra_matrix: str = None, - vtag: str = None, - fps_mode: str = None, - force_fps: bool = None, - streamid: str = None, - force_key_frames: str = None, - b: str = None, - autoscale: bool = None, - fix_sub_duration_heartbeat: bool = None, - aframes: int = None, - aq: str = None, - ar: int = None, - ac: int = None, - an: bool = None, - acodec: str = None, - ab: str = None, - atag: str = None, - sample_fmt: str = None, - channel_layout: str = None, - ch_layout: str = None, - af: str = None, - sn: bool = None, - scodec: str = None, - stag: str = None, - muxdelay: float = None, - muxpreload: float = None, - sdp_file: str = None, - time_base: str = None, - enc_time_base: str = None, - bsf: str = None, - apre: str = None, - vpre: str = None, - spre: str = None, - fpre: str = None, - max_muxing_queue_size: int = None, - muxing_queue_data_threshold: int = None, - dcodec: str = None, - dn: bool = None, - top: int = None, + f: String = None, + c: String = None, + codec: String = None, + pre: String = None, + map: Func = None, + map_metadata: String = None, + map_chapters: Int = None, + t: Time = None, + to: Time = None, + fs: Int64 = None, + ss: Time = None, + timestamp: Func = None, + metadata: String = None, + program: String = None, + stream_group: String = None, + dframes: Int64 = None, + target: Func = None, + shortest: Boolean = None, + shortest_buf_duration: Float = None, + bitexact: Boolean = None, + apad: String = None, + copyinkf: Boolean = None, + copypriorss: Int = None, + frames: Int64 = None, + tag: String = None, + q: Func = None, + qscale: Func = None, + profile: Func = None, + filter: String = None, + filter_script: String = None, + attach: Func = None, + disposition: String = None, + thread_queue_size: Int = None, + bits_per_raw_sample: Int = None, + stats_enc_pre: String = None, + stats_enc_post: String = None, + stats_mux_pre: String = None, + stats_enc_pre_fmt: String = None, + stats_enc_post_fmt: String = None, + stats_mux_pre_fmt: String = None, + vframes: Int64 = None, + r: String = None, + fpsmax: String = None, + s: String = None, + aspect: String = None, + pix_fmt: String = None, + vn: Boolean = None, + rc_override: String = None, + vcodec: String = None, + timecode: Func = None, + _pass: Int = None, + passlogfile: String = None, + vf: String = None, + intra_matrix: String = None, + inter_matrix: String = None, + chroma_intra_matrix: String = None, + vtag: String = None, + fps_mode: String = None, + force_fps: Boolean = None, + streamid: Func = None, + force_key_frames: String = None, + b: Func = None, + autoscale: Boolean = None, + fix_sub_duration_heartbeat: Boolean = None, + aframes: Int64 = None, + aq: Func = None, + ar: Int = None, + ac: Int = None, + an: Boolean = None, + acodec: String = None, + ab: Func = None, + atag: String = None, + sample_fmt: String = None, + channel_layout: String = None, + ch_layout: String = None, + af: String = None, + sn: Boolean = None, + scodec: String = None, + stag: String = None, + muxdelay: Float = None, + muxpreload: Float = None, + sdp_file: Func = None, + time_base: String = None, + enc_time_base: String = None, + bsf: String = None, + apre: String = None, + vpre: String = None, + spre: String = None, + fpre: String = None, + max_muxing_queue_size: Int = None, + muxing_queue_data_threshold: Int = None, + dcodec: String = None, + dn: Boolean = None, + top: Int = None, **kwargs: Any ) -> OutputStream: """ diff --git a/src/ffmpeg/dag/io/output_args.py b/src/ffmpeg/dag/io/output_args.py index bbdedb17..5e29e6e0 100644 --- a/src/ffmpeg/dag/io/output_args.py +++ b/src/ffmpeg/dag/io/output_args.py @@ -5,6 +5,8 @@ from pathlib import Path from typing import TYPE_CHECKING, Any +from ...types import Boolean, Float, Func, Int, Int64, String, Time + if TYPE_CHECKING: from ..nodes import FilterableStream, OutputNode, OutputStream @@ -18,100 +20,100 @@ def output( self, *streams: "FilterableStream", filename: str | Path, - f: str = None, - c: str = None, - codec: str = None, - pre: str = None, - map: str = None, - map_metadata: str = None, - map_chapters: int = None, - t: str | float | None = None, - to: str | float | None = None, - fs: int = None, - ss: str | float | None = None, - timestamp: str = None, - metadata: str = None, - program: str = None, - stream_group: str = None, - dframes: int = None, - target: str = None, - shortest: bool = None, - shortest_buf_duration: float = None, - bitexact: bool = None, - apad: str = None, - copyinkf: bool = None, - copypriorss: int = None, - frames: int = None, - tag: str = None, - q: str = None, - qscale: str = None, - profile: str = None, - filter: str = None, - filter_script: str = None, - attach: str = None, - disposition: str = None, - thread_queue_size: int = None, - bits_per_raw_sample: int = None, - stats_enc_pre: str = None, - stats_enc_post: str = None, - stats_mux_pre: str = None, - stats_enc_pre_fmt: str = None, - stats_enc_post_fmt: str = None, - stats_mux_pre_fmt: str = None, - vframes: int = None, - r: str = None, - fpsmax: str = None, - s: str = None, - aspect: str = None, - pix_fmt: str = None, - vn: bool = None, - rc_override: str = None, - vcodec: str = None, - timecode: str = None, - _pass: int = None, - passlogfile: str = None, - vf: str = None, - intra_matrix: str = None, - inter_matrix: str = None, - chroma_intra_matrix: str = None, - vtag: str = None, - fps_mode: str = None, - force_fps: bool = None, - streamid: str = None, - force_key_frames: str = None, - b: str = None, - autoscale: bool = None, - fix_sub_duration_heartbeat: bool = None, - aframes: int = None, - aq: str = None, - ar: int = None, - ac: int = None, - an: bool = None, - acodec: str = None, - ab: str = None, - atag: str = None, - sample_fmt: str = None, - channel_layout: str = None, - ch_layout: str = None, - af: str = None, - sn: bool = None, - scodec: str = None, - stag: str = None, - muxdelay: float = None, - muxpreload: float = None, - sdp_file: str = None, - time_base: str = None, - enc_time_base: str = None, - bsf: str = None, - apre: str = None, - vpre: str = None, - spre: str = None, - fpre: str = None, - max_muxing_queue_size: int = None, - muxing_queue_data_threshold: int = None, - dcodec: str = None, - dn: bool = None, - top: int = None, + f: String = None, + c: String = None, + codec: String = None, + pre: String = None, + map: Func = None, + map_metadata: String = None, + map_chapters: Int = None, + t: Time = None, + to: Time = None, + fs: Int64 = None, + ss: Time = None, + timestamp: Func = None, + metadata: String = None, + program: String = None, + stream_group: String = None, + dframes: Int64 = None, + target: Func = None, + shortest: Boolean = None, + shortest_buf_duration: Float = None, + bitexact: Boolean = None, + apad: String = None, + copyinkf: Boolean = None, + copypriorss: Int = None, + frames: Int64 = None, + tag: String = None, + q: Func = None, + qscale: Func = None, + profile: Func = None, + filter: String = None, + filter_script: String = None, + attach: Func = None, + disposition: String = None, + thread_queue_size: Int = None, + bits_per_raw_sample: Int = None, + stats_enc_pre: String = None, + stats_enc_post: String = None, + stats_mux_pre: String = None, + stats_enc_pre_fmt: String = None, + stats_enc_post_fmt: String = None, + stats_mux_pre_fmt: String = None, + vframes: Int64 = None, + r: String = None, + fpsmax: String = None, + s: String = None, + aspect: String = None, + pix_fmt: String = None, + vn: Boolean = None, + rc_override: String = None, + vcodec: String = None, + timecode: Func = None, + _pass: Int = None, + passlogfile: String = None, + vf: String = None, + intra_matrix: String = None, + inter_matrix: String = None, + chroma_intra_matrix: String = None, + vtag: String = None, + fps_mode: String = None, + force_fps: Boolean = None, + streamid: Func = None, + force_key_frames: String = None, + b: Func = None, + autoscale: Boolean = None, + fix_sub_duration_heartbeat: Boolean = None, + aframes: Int64 = None, + aq: Func = None, + ar: Int = None, + ac: Int = None, + an: Boolean = None, + acodec: String = None, + ab: Func = None, + atag: String = None, + sample_fmt: String = None, + channel_layout: String = None, + ch_layout: String = None, + af: String = None, + sn: Boolean = None, + scodec: String = None, + stag: String = None, + muxdelay: Float = None, + muxpreload: Float = None, + sdp_file: Func = None, + time_base: String = None, + enc_time_base: String = None, + bsf: String = None, + apre: String = None, + vpre: String = None, + spre: String = None, + fpre: String = None, + max_muxing_queue_size: Int = None, + muxing_queue_data_threshold: Int = None, + dcodec: String = None, + dn: Boolean = None, + top: Int = None, **kwargs: Any, ) -> OutputStream: """ diff --git a/src/ffmpeg/types.py b/src/ffmpeg/types.py index 0226f0b6..5345526e 100644 --- a/src/ffmpeg/types.py +++ b/src/ffmpeg/types.py @@ -107,8 +107,13 @@ Sample_fmt = str | Default | LazyValue Binary = str | Default | LazyValue +# OPT Type +Func = str | int | float | Default | LazyValue +""" +ref: OPT_TYPE_FUNC +""" -Filter_Node_Option_Type = str | int | float | bool | LazyValue +Time = str | int | float | Default | LazyValue """ -This represents the type of options that can be used with FFmpeg's filter nodes. +ref: OPT_TYPE_TIME """ diff --git a/src/scripts/code_gen/gen.py b/src/scripts/code_gen/gen.py index 6bbdcdd3..89bb3bc8 100644 --- a/src/scripts/code_gen/gen.py +++ b/src/scripts/code_gen/gen.py @@ -84,21 +84,21 @@ def option_name_safe(string: str) -> str: def option_typing(self: FFMpegOption) -> str: if self.type == FFMpegOptionType.OPT_TYPE_FUNC: - return "str" + return "Func" elif self.type == FFMpegOptionType.OPT_TYPE_BOOL: - return "bool" + return "Boolean" elif self.type == FFMpegOptionType.OPT_TYPE_STRING: - return "str" + return "String" elif self.type == FFMpegOptionType.OPT_TYPE_INT: - return "int" + return "Int" elif self.type == FFMpegOptionType.OPT_TYPE_INT64: - return "int" + return "Int64" elif self.type == FFMpegOptionType.OPT_TYPE_FLOAT: - return "float" + return "Float" elif self.type == FFMpegOptionType.OPT_TYPE_DOUBLE: - return "float" + return "Double" elif self.type == FFMpegOptionType.OPT_TYPE_TIME: - return "str | float | None" + return "Time" def input_typings(self: FFMpegFilter) -> str: diff --git a/src/scripts/code_gen/templates/dag/global_runnable/global_args.py.jinja b/src/scripts/code_gen/templates/dag/global_runnable/global_args.py.jinja index 881e6b62..faf91abc 100644 --- a/src/scripts/code_gen/templates/dag/global_runnable/global_args.py.jinja +++ b/src/scripts/code_gen/templates/dag/global_runnable/global_args.py.jinja @@ -2,6 +2,7 @@ from __future__ import annotations from abc import ABC, abstractmethod from typing import TYPE_CHECKING, Any +from ...types import * if TYPE_CHECKING: from ..nodes import GlobalNode, GlobalStream, OutputStream diff --git a/src/scripts/code_gen/templates/dag/io/_input.py.jinja b/src/scripts/code_gen/templates/dag/io/_input.py.jinja index b06678c0..e16efa66 100644 --- a/src/scripts/code_gen/templates/dag/io/_input.py.jinja +++ b/src/scripts/code_gen/templates/dag/io/_input.py.jinja @@ -5,6 +5,7 @@ from pathlib import Path from ..nodes import InputNode from ...streams.av import AVStream from typing import Any +from ...types import * def input( filename: str | Path, diff --git a/src/scripts/code_gen/templates/dag/io/_output.py.jinja b/src/scripts/code_gen/templates/dag/io/_output.py.jinja index 009fde88..b04e8172 100644 --- a/src/scripts/code_gen/templates/dag/io/_output.py.jinja +++ b/src/scripts/code_gen/templates/dag/io/_output.py.jinja @@ -4,6 +4,7 @@ from pathlib import Path from ..nodes import OutputNode, OutputStream, FilterableStream from typing import Any +from ...types import * def output( *streams: FilterableStream, diff --git a/src/scripts/code_gen/templates/dag/io/output_args.py.jinja b/src/scripts/code_gen/templates/dag/io/output_args.py.jinja index 4637b1da..dab269a1 100644 --- a/src/scripts/code_gen/templates/dag/io/output_args.py.jinja +++ b/src/scripts/code_gen/templates/dag/io/output_args.py.jinja @@ -3,6 +3,7 @@ from __future__ import annotations from abc import ABC, abstractmethod from pathlib import Path from typing import TYPE_CHECKING, Any +from ...types import * if TYPE_CHECKING: from ..nodes import FilterableStream, OutputNode, OutputStream diff --git a/src/scripts/code_gen/templates/filters.py.jinja b/src/scripts/code_gen/templates/filters.py.jinja index 9716feff..5d869c51 100644 --- a/src/scripts/code_gen/templates/filters.py.jinja +++ b/src/scripts/code_gen/templates/filters.py.jinja @@ -2,7 +2,7 @@ from typing import Any, Literal from .dag.nodes import FilterNode, FilterableStream from .schema import Default, StreamType, Auto -from .types import Boolean, Duration, Color, Flags, Dictionary, Pix_fmt, Int, Int64, Double, Float, String, Video_rate, Image_size, Rational, Sample_fmt, Binary +from .types import * from .streams.video import VideoStream from .streams.audio import AudioStream from .streams.av import AVStream diff --git a/src/scripts/code_gen/templates/streams/audio.py.jinja b/src/scripts/code_gen/templates/streams/audio.py.jinja index 73100611..5941ef98 100644 --- a/src/scripts/code_gen/templates/streams/audio.py.jinja +++ b/src/scripts/code_gen/templates/streams/audio.py.jinja @@ -7,7 +7,7 @@ from typing import TYPE_CHECKING, Any, Literal from ..dag.nodes import FilterableStream, FilterNode from ..schema import Default, StreamType, Auto -from ..types import Boolean, Duration, Color, Flags, Dictionary, Pix_fmt, Int, Int64, Double, Float, String, Video_rate, Image_size, Rational, Sample_fmt, Binary +from ..types import * from ..utils.typing import override from .channel_layout import CHANNEL_LAYOUT from ..common.schema import FFMpegFilterDef diff --git a/src/scripts/code_gen/templates/streams/video.py.jinja b/src/scripts/code_gen/templates/streams/video.py.jinja index 9fca8955..afd20eb7 100644 --- a/src/scripts/code_gen/templates/streams/video.py.jinja +++ b/src/scripts/code_gen/templates/streams/video.py.jinja @@ -7,7 +7,7 @@ from typing import TYPE_CHECKING, Any, Literal from ..dag.nodes import FilterableStream, FilterNode from ..schema import Default, StreamType, Auto -from ..types import Boolean, Duration, Color, Flags, Dictionary, Pix_fmt, Int, Int64, Double, Float, String, Video_rate, Image_size, Rational, Sample_fmt, Binary +from ..types import * from ..utils.typing import override from ..common.schema import FFMpegFilterDef from ..dag.factory import filter_node_factory From 2fcf92b7355debd052851c62c6142be8bd5514f9 Mon Sep 17 00:00:00 2001 From: lucemia Date: Thu, 28 Mar 2024 02:02:25 +0000 Subject: [PATCH 2/2] update snapshot --- .../tests/__snapshots__/test_gen/test_render[_input.py].raw | 1 + .../tests/__snapshots__/test_gen/test_render[_output.py].raw | 1 + .../tests/__snapshots__/test_gen/test_render[audio.py].raw | 2 +- .../tests/__snapshots__/test_gen/test_render[filters.py].raw | 2 +- .../__snapshots__/test_gen/test_render[global_args.py].raw | 1 + .../__snapshots__/test_gen/test_render[output_args.py].raw | 1 + .../tests/__snapshots__/test_gen/test_render[video.py].raw | 2 +- 7 files changed, 7 insertions(+), 3 deletions(-) diff --git a/src/scripts/code_gen/tests/__snapshots__/test_gen/test_render[_input.py].raw b/src/scripts/code_gen/tests/__snapshots__/test_gen/test_render[_input.py].raw index cd6ddb67..e89bd824 100644 --- a/src/scripts/code_gen/tests/__snapshots__/test_gen/test_render[_input.py].raw +++ b/src/scripts/code_gen/tests/__snapshots__/test_gen/test_render[_input.py].raw @@ -6,6 +6,7 @@ from pathlib import Path from ..nodes import InputNode from ...streams.av import AVStream from typing import Any +from ...types import * def input( filename: str | Path, diff --git a/src/scripts/code_gen/tests/__snapshots__/test_gen/test_render[_output.py].raw b/src/scripts/code_gen/tests/__snapshots__/test_gen/test_render[_output.py].raw index 71faf2de..44b682bb 100644 --- a/src/scripts/code_gen/tests/__snapshots__/test_gen/test_render[_output.py].raw +++ b/src/scripts/code_gen/tests/__snapshots__/test_gen/test_render[_output.py].raw @@ -5,6 +5,7 @@ from pathlib import Path from ..nodes import OutputNode, OutputStream, FilterableStream from typing import Any +from ...types import * def output( *streams: FilterableStream, diff --git a/src/scripts/code_gen/tests/__snapshots__/test_gen/test_render[audio.py].raw b/src/scripts/code_gen/tests/__snapshots__/test_gen/test_render[audio.py].raw index 49c127ba..0f59b466 100644 --- a/src/scripts/code_gen/tests/__snapshots__/test_gen/test_render[audio.py].raw +++ b/src/scripts/code_gen/tests/__snapshots__/test_gen/test_render[audio.py].raw @@ -8,7 +8,7 @@ from typing import TYPE_CHECKING, Any, Literal from ..dag.nodes import FilterableStream, FilterNode from ..schema import Default, StreamType, Auto -from ..types import Boolean, Duration, Color, Flags, Dictionary, Pix_fmt, Int, Int64, Double, Float, String, Video_rate, Image_size, Rational, Sample_fmt, Binary +from ..types import * from ..utils.typing import override from .channel_layout import CHANNEL_LAYOUT from ..common.schema import FFMpegFilterDef diff --git a/src/scripts/code_gen/tests/__snapshots__/test_gen/test_render[filters.py].raw b/src/scripts/code_gen/tests/__snapshots__/test_gen/test_render[filters.py].raw index 60a5dce2..ca3e3fd8 100644 --- a/src/scripts/code_gen/tests/__snapshots__/test_gen/test_render[filters.py].raw +++ b/src/scripts/code_gen/tests/__snapshots__/test_gen/test_render[filters.py].raw @@ -3,7 +3,7 @@ from typing import Any, Literal from .dag.nodes import FilterNode, FilterableStream from .schema import Default, StreamType, Auto -from .types import Boolean, Duration, Color, Flags, Dictionary, Pix_fmt, Int, Int64, Double, Float, String, Video_rate, Image_size, Rational, Sample_fmt, Binary +from .types import * from .streams.video import VideoStream from .streams.audio import AudioStream from .streams.av import AVStream diff --git a/src/scripts/code_gen/tests/__snapshots__/test_gen/test_render[global_args.py].raw b/src/scripts/code_gen/tests/__snapshots__/test_gen/test_render[global_args.py].raw index a76d2d20..8076baad 100644 --- a/src/scripts/code_gen/tests/__snapshots__/test_gen/test_render[global_args.py].raw +++ b/src/scripts/code_gen/tests/__snapshots__/test_gen/test_render[global_args.py].raw @@ -3,6 +3,7 @@ from __future__ import annotations from abc import ABC, abstractmethod from typing import TYPE_CHECKING, Any +from ...types import * if TYPE_CHECKING: from ..nodes import GlobalNode, GlobalStream, OutputStream diff --git a/src/scripts/code_gen/tests/__snapshots__/test_gen/test_render[output_args.py].raw b/src/scripts/code_gen/tests/__snapshots__/test_gen/test_render[output_args.py].raw index 59a46e1c..f0777211 100644 --- a/src/scripts/code_gen/tests/__snapshots__/test_gen/test_render[output_args.py].raw +++ b/src/scripts/code_gen/tests/__snapshots__/test_gen/test_render[output_args.py].raw @@ -4,6 +4,7 @@ from __future__ import annotations from abc import ABC, abstractmethod from pathlib import Path from typing import TYPE_CHECKING, Any +from ...types import * if TYPE_CHECKING: from ..nodes import FilterableStream, OutputNode, OutputStream diff --git a/src/scripts/code_gen/tests/__snapshots__/test_gen/test_render[video.py].raw b/src/scripts/code_gen/tests/__snapshots__/test_gen/test_render[video.py].raw index edf90678..b18789d4 100644 --- a/src/scripts/code_gen/tests/__snapshots__/test_gen/test_render[video.py].raw +++ b/src/scripts/code_gen/tests/__snapshots__/test_gen/test_render[video.py].raw @@ -8,7 +8,7 @@ from typing import TYPE_CHECKING, Any, Literal from ..dag.nodes import FilterableStream, FilterNode from ..schema import Default, StreamType, Auto -from ..types import Boolean, Duration, Color, Flags, Dictionary, Pix_fmt, Int, Int64, Double, Float, String, Video_rate, Image_size, Rational, Sample_fmt, Binary +from ..types import * from ..utils.typing import override from ..common.schema import FFMpegFilterDef from ..dag.factory import filter_node_factory