diff --git a/av/codec/codec.pyi b/av/codec/codec.pyi index 5203b6101..a59381115 100644 --- a/av/codec/codec.pyi +++ b/av/codec/codec.pyi @@ -1,6 +1,6 @@ from collections.abc import Sequence from enum import Flag, IntEnum, IntFlag -from typing import ClassVar, Literal, cast, overload +from typing import Literal, overload from av.audio.codeccontext import AudioCodecContext from av.audio.format import AudioFormat @@ -13,46 +13,47 @@ from .context import CodecContext from .hwaccel import HWConfig class Properties(Flag): - NONE = cast(ClassVar[Properties], ...) - INTRA_ONLY = cast(ClassVar[Properties], ...) - LOSSY = cast(ClassVar[Properties], ...) - LOSSLESS = cast(ClassVar[Properties], ...) - REORDER = cast(ClassVar[Properties], ...) - FIELDS = cast(ClassVar[Properties], ...) - ENHANCEMENT = cast(ClassVar[Properties], ...) - BITMAP_SUB = cast(ClassVar[Properties], ...) - TEXT_SUB = cast(ClassVar[Properties], ...) + _value_: int + NONE = 0 + INTRA_ONLY = ... + LOSSY = ... + LOSSLESS = ... + REORDER = ... + FIELDS = ... + ENHANCEMENT = ... + BITMAP_SUB = ... + TEXT_SUB = ... class Capabilities(IntEnum): - none = cast(int, ...) - draw_horiz_band = cast(int, ...) - dr1 = cast(int, ...) - delay = cast(int, ...) - small_last_frame = cast(int, ...) - experimental = cast(int, ...) - channel_conf = cast(int, ...) - frame_threads = cast(int, ...) - slice_threads = cast(int, ...) - param_change = cast(int, ...) - auto_threads = cast(int, ...) - variable_frame_size = cast(int, ...) - avoid_probing = cast(int, ...) - hardware = cast(int, ...) - hybrid = cast(int, ...) - encoder_reordered_opaque = cast(int, ...) - encoder_flush = cast(int, ...) - encoder_recon_frame = cast(int, ...) + none = 0 + draw_horiz_band = ... + dr1 = ... + delay = ... + small_last_frame = ... + experimental = ... + channel_conf = ... + frame_threads = ... + slice_threads = ... + param_change = ... + auto_threads = ... + variable_frame_size = ... + avoid_probing = ... + hardware = ... + hybrid = ... + encoder_reordered_opaque = ... + encoder_flush = ... + encoder_recon_frame = ... class PixFmtLoss(IntFlag): - NONE = cast(ClassVar[PixFmtLoss], ...) - RESOLUTION = cast(ClassVar[PixFmtLoss], ...) - DEPTH = cast(ClassVar[PixFmtLoss], ...) - COLORSPACE = cast(ClassVar[PixFmtLoss], ...) - ALPHA = cast(ClassVar[PixFmtLoss], ...) - COLORQUANT = cast(ClassVar[PixFmtLoss], ...) - CHROMA = cast(ClassVar[PixFmtLoss], ...) - EXCESS_RESOLUTION = cast(ClassVar[PixFmtLoss], ...) - EXCESS_DEPTH = cast(ClassVar[PixFmtLoss], ...) + NONE = 0 + RESOLUTION = 0x0001 + DEPTH = 0x0002 + COLORSPACE = 0x0004 + ALPHA = 0x0008 + COLORQUANT = 0x0010 + CHROMA = 0x0020 + EXCESS_RESOLUTION = 0x0040 + EXCESS_DEPTH = 0x0080 class UnknownCodecError(ValueError): ... @@ -149,4 +150,3 @@ def find_best_pix_fmt_of_list( members. For exact behavior see: libavutil/pixdesc.c/get_pix_fmt_score() in ffmpeg source code. """ - ... diff --git a/av/codec/context.pyi b/av/codec/context.pyi index d34d5b2d0..59b5f9054 100644 --- a/av/codec/context.pyi +++ b/av/codec/context.pyi @@ -1,7 +1,7 @@ from dataclasses import dataclass from enum import Flag, IntEnum, IntFlag from fractions import Fraction -from typing import ClassVar, Literal, cast, overload +from typing import Literal, overload from av.audio import _AudioCodecName from av.audio.codeccontext import AudioCodecContext @@ -17,82 +17,81 @@ from .codec import Codec from .hwaccel import HWAccel class ThreadType(Flag): - NONE = cast(ClassVar[ThreadType], ...) - FRAME = cast(ClassVar[ThreadType], ...) - SLICE = cast(ClassVar[ThreadType], ...) - AUTO = cast(ClassVar[ThreadType], ...) - def __get__(self, i: object | None, owner: type | None = None) -> ThreadType: ... - def __set__(self, instance: object, value: int | str | ThreadType) -> None: ... + _value_: int + NONE = ... + FRAME = ... + SLICE = ... + AUTO = ... class Flags(IntEnum): - unaligned = cast(int, ...) - qscale = cast(int, ...) - four_mv = cast(int, ...) - output_corrupt = cast(int, ...) - qpel = cast(int, ...) - recon_frame = cast(int, ...) - copy_opaque = cast(int, ...) - frame_duration = cast(int, ...) - pass1 = cast(int, ...) - pass2 = cast(int, ...) - loop_filter = cast(int, ...) - gray = cast(int, ...) - psnr = cast(int, ...) - interlaced_dct = cast(int, ...) - low_delay = cast(int, ...) - global_header = cast(int, ...) - bitexact = cast(int, ...) - ac_pred = cast(int, ...) - interlaced_me = cast(int, ...) - closed_gop = cast(int, ...) + unaligned = ... + qscale = ... + four_mv = ... + output_corrupt = ... + qpel = ... + recon_frame = ... + copy_opaque = ... + frame_duration = ... + pass1 = ... + pass2 = ... + loop_filter = ... + gray = ... + psnr = ... + interlaced_dct = ... + low_delay = ... + global_header = ... + bitexact = ... + ac_pred = ... + interlaced_me = ... + closed_gop = ... class Flags2(IntEnum): - fast = cast(int, ...) - no_output = cast(int, ...) - local_header = cast(int, ...) - chunks = cast(int, ...) - ignore_crop = cast(int, ...) - show_all = cast(int, ...) - export_mvs = cast(int, ...) - skip_manual = cast(int, ...) - ro_flush_noop = cast(int, ...) - icc_profiles = cast(int, ...) + fast = ... + no_output = ... + local_header = ... + chunks = ... + ignore_crop = ... + show_all = ... + export_mvs = ... + skip_manual = ... + ro_flush_noop = ... + icc_profiles = ... class OptionType(IntEnum): - FLAGS = cast(int, ...) - INT = cast(int, ...) - INT64 = cast(int, ...) - DOUBLE = cast(int, ...) - FLOAT = cast(int, ...) - STRING = cast(int, ...) - RATIONAL = cast(int, ...) - BINARY = cast(int, ...) - DICT = cast(int, ...) - UINT64 = cast(int, ...) - CONST = cast(int, ...) - IMAGE_SIZE = cast(int, ...) - PIXEL_FMT = cast(int, ...) - SAMPLE_FMT = cast(int, ...) - VIDEO_RATE = cast(int, ...) - DURATION = cast(int, ...) - COLOR = cast(int, ...) - CHANNEL_LAYOUT = cast(int, ...) - BOOL = cast(int, ...) - UINT = cast(int, ...) + FLAGS = ... + INT = ... + INT64 = ... + DOUBLE = ... + FLOAT = ... + STRING = ... + RATIONAL = ... + BINARY = ... + DICT = ... + UINT64 = ... + CONST = ... + IMAGE_SIZE = ... + PIXEL_FMT = ... + SAMPLE_FMT = ... + VIDEO_RATE = ... + DURATION = ... + COLOR = ... + CHANNEL_LAYOUT = ... + BOOL = ... + UINT = ... class OptionFlags(IntFlag): - ENCODING_PARAM = cast(int, ...) - DECODING_PARAM = cast(int, ...) - AUDIO_PARAM = cast(int, ...) - VIDEO_PARAM = cast(int, ...) - SUBTITLE_PARAM = cast(int, ...) - EXPORT = cast(int, ...) - READONLY = cast(int, ...) - BITSTREAM_FILTER_PARAM = cast(int, ...) - RUNTIME_PARAM = cast(int, ...) - FILTERING_PARAM = cast(int, ...) - DEPRECATED = cast(int, ...) - CHILD_CONSTS = cast(int, ...) + ENCODING_PARAM = ... + DECODING_PARAM = ... + AUDIO_PARAM = ... + VIDEO_PARAM = ... + SUBTITLE_PARAM = ... + EXPORT = ... + READONLY = ... + BITSTREAM_FILTER_PARAM = ... + RUNTIME_PARAM = ... + FILTERING_PARAM = ... + DEPRECATED = ... + CHILD_CONSTS = ... @dataclass(frozen=True, slots=True) class CodecOptionChoice: diff --git a/av/codec/hwaccel.pyi b/av/codec/hwaccel.pyi index 28a9d4292..7ecb2ecf5 100644 --- a/av/codec/hwaccel.pyi +++ b/av/codec/hwaccel.pyi @@ -1,32 +1,31 @@ from enum import IntEnum -from typing import cast from av.codec.codec import Codec from av.video.format import VideoFormat class HWDeviceType(IntEnum): - none = cast(int, ...) - vdpau = cast(int, ...) - cuda = cast(int, ...) - vaapi = cast(int, ...) - dxva2 = cast(int, ...) - qsv = cast(int, ...) - videotoolbox = cast(int, ...) - d3d11va = cast(int, ...) - drm = cast(int, ...) - opencl = cast(int, ...) - mediacodec = cast(int, ...) - vulkan = cast(int, ...) - d3d12va = cast(int, ...) - amf = cast(int, ...) - ohcodec = cast(int, ...) + none = ... + vdpau = ... + cuda = ... + vaapi = ... + dxva2 = ... + qsv = ... + videotoolbox = ... + d3d11va = ... + drm = ... + opencl = ... + mediacodec = ... + vulkan = ... + d3d12va = ... + amf = ... + ohcodec = ... class HWConfigMethod(IntEnum): - none = cast(int, ...) - hw_device_ctx = cast(int, ...) - hw_frame_ctx = cast(int, ...) - internal = cast(int, ...) - ad_hoc = cast(int, ...) + none = ... + hw_device_ctx = ... + hw_frame_ctx = ... + internal = ... + ad_hoc = ... class HWConfig: @property diff --git a/av/container/core.pyi b/av/container/core.pyi index 5f25e7030..c92a4987a 100644 --- a/av/container/core.pyi +++ b/av/container/core.pyi @@ -3,7 +3,7 @@ from enum import Flag, IntEnum from fractions import Fraction from pathlib import Path from types import TracebackType -from typing import Any, ClassVar, Literal, Self, TypedDict, cast, overload +from typing import Any, Literal, Self, TypedDict, overload from av.codec.hwaccel import HWAccel from av.format import ContainerFormat @@ -16,58 +16,59 @@ from .streams import StreamContainer Real = int | float | Fraction | AVRational class Flags(Flag): - gen_pts = cast(ClassVar[Flags], ...) - ign_idx = cast(ClassVar[Flags], ...) - non_block = cast(ClassVar[Flags], ...) - ign_dts = cast(ClassVar[Flags], ...) - no_fillin = cast(ClassVar[Flags], ...) - no_parse = cast(ClassVar[Flags], ...) - no_buffer = cast(ClassVar[Flags], ...) - custom_io = cast(ClassVar[Flags], ...) - discard_corrupt = cast(ClassVar[Flags], ...) - flush_packets = cast(ClassVar[Flags], ...) - bitexact = cast(ClassVar[Flags], ...) - sort_dts = cast(ClassVar[Flags], ...) - fast_seek = cast(ClassVar[Flags], ...) - shortest = cast(ClassVar[Flags], ...) - auto_bsf = cast(ClassVar[Flags], ...) + _value_: int + gen_pts = ... + ign_idx = ... + non_block = ... + ign_dts = ... + no_fillin = ... + no_parse = ... + no_buffer = ... + custom_io = ... + discard_corrupt = ... + flush_packets = ... + bitexact = ... + sort_dts = ... + fast_seek = ... + shortest = ... + auto_bsf = ... class AudioCodec(IntEnum): - none = cast(int, ...) - pcm_alaw = cast(int, ...) - pcm_bluray = cast(int, ...) - pcm_dvd = cast(int, ...) - pcm_f16le = cast(int, ...) - pcm_f24le = cast(int, ...) - pcm_f32be = cast(int, ...) - pcm_f32le = cast(int, ...) - pcm_f64be = cast(int, ...) - pcm_f64le = cast(int, ...) - pcm_lxf = cast(int, ...) - pcm_mulaw = cast(int, ...) - pcm_s16be = cast(int, ...) - pcm_s16be_planar = cast(int, ...) - pcm_s16le = cast(int, ...) - pcm_s16le_planar = cast(int, ...) - pcm_s24be = cast(int, ...) - pcm_s24daud = cast(int, ...) - pcm_s24le = cast(int, ...) - pcm_s24le_planar = cast(int, ...) - pcm_s32be = cast(int, ...) - pcm_s32le = cast(int, ...) - pcm_s32le_planar = cast(int, ...) - pcm_s64be = cast(int, ...) - pcm_s64le = cast(int, ...) - pcm_s8 = cast(int, ...) - pcm_s8_planar = cast(int, ...) - pcm_u16be = cast(int, ...) - pcm_u16le = cast(int, ...) - pcm_u24be = cast(int, ...) - pcm_u24le = cast(int, ...) - pcm_u32be = cast(int, ...) - pcm_u32le = cast(int, ...) - pcm_u8 = cast(int, ...) - pcm_vidc = cast(int, ...) + none = ... + pcm_alaw = ... + pcm_bluray = ... + pcm_dvd = ... + pcm_f16le = ... + pcm_f24le = ... + pcm_f32be = ... + pcm_f32le = ... + pcm_f64be = ... + pcm_f64le = ... + pcm_lxf = ... + pcm_mulaw = ... + pcm_s16be = ... + pcm_s16be_planar = ... + pcm_s16le = ... + pcm_s16le_planar = ... + pcm_s24be = ... + pcm_s24daud = ... + pcm_s24le = ... + pcm_s24le_planar = ... + pcm_s32be = ... + pcm_s32le = ... + pcm_s32le_planar = ... + pcm_s64be = ... + pcm_s64le = ... + pcm_s8 = ... + pcm_s8_planar = ... + pcm_u16be = ... + pcm_u16le = ... + pcm_u24be = ... + pcm_u24le = ... + pcm_u32be = ... + pcm_u32le = ... + pcm_u8 = ... + pcm_vidc = ... class Chapter(TypedDict): id: int diff --git a/av/format.pyi b/av/format.pyi index 7223bab5e..ade5f9641 100644 --- a/av/format.pyi +++ b/av/format.pyi @@ -1,26 +1,27 @@ __all__ = ("Flags", "ContainerFormat", "formats_available") from enum import Flag -from typing import ClassVar, Literal, cast +from typing import Literal class Flags(Flag): - no_file = cast(ClassVar[Flags], ...) - need_number = cast(ClassVar[Flags], ...) - experimental = cast(ClassVar[Flags], ...) - show_ids = cast(ClassVar[Flags], ...) - global_header = cast(ClassVar[Flags], ...) - no_timestamps = cast(ClassVar[Flags], ...) - generic_index = cast(ClassVar[Flags], ...) - ts_discont = cast(ClassVar[Flags], ...) - variable_fps = cast(ClassVar[Flags], ...) - no_dimensions = cast(ClassVar[Flags], ...) - no_streams = cast(ClassVar[Flags], ...) - no_bin_search = cast(ClassVar[Flags], ...) - no_gen_search = cast(ClassVar[Flags], ...) - no_byte_seek = cast(ClassVar[Flags], ...) - ts_nonstrict = cast(ClassVar[Flags], ...) - ts_negative = cast(ClassVar[Flags], ...) - seek_to_pts = cast(ClassVar[Flags], ...) + _value_: int + no_file = ... + need_number = ... + experimental = ... + show_ids = ... + global_header = ... + no_timestamps = ... + generic_index = ... + ts_discont = ... + variable_fps = ... + no_dimensions = ... + no_streams = ... + no_bin_search = ... + no_gen_search = ... + no_byte_seek = ... + ts_nonstrict = ... + ts_negative = ... + seek_to_pts = ... class ContainerFormat: def __init__(self, name: str, mode: Literal["r", "w"] | None = None) -> None: ... diff --git a/av/sidedata/encparams.pyi b/av/sidedata/encparams.pyi index de962ba51..bd30eb472 100644 --- a/av/sidedata/encparams.pyi +++ b/av/sidedata/encparams.pyi @@ -1,13 +1,13 @@ from enum import IntEnum -from typing import Any, cast +from typing import Any import numpy as np class VideoEncParamsType(IntEnum): - NONE = cast(int, ...) - VP9 = cast(int, ...) - H264 = cast(int, ...) - MPEG2 = cast(int, ...) + NONE = ... + VP9 = ... + H264 = ... + MPEG2 = ... class VideoEncParams: nb_blocks: int diff --git a/av/sidedata/sidedata.pyi b/av/sidedata/sidedata.pyi index 94f500b13..d7074e261 100644 --- a/av/sidedata/sidedata.pyi +++ b/av/sidedata/sidedata.pyi @@ -1,42 +1,43 @@ from collections.abc import Iterator, Mapping, Sequence from enum import Enum -from typing import ClassVar, cast, overload +from typing import overload from av.buffer import Buffer class Type(Enum): - PANSCAN = cast(ClassVar[Type], ...) - A53_CC = cast(ClassVar[Type], ...) - STEREO3D = cast(ClassVar[Type], ...) - MATRIXENCODING = cast(ClassVar[Type], ...) - DOWNMIX_INFO = cast(ClassVar[Type], ...) - REPLAYGAIN = cast(ClassVar[Type], ...) - DISPLAYMATRIX = cast(ClassVar[Type], ...) - AFD = cast(ClassVar[Type], ...) - MOTION_VECTORS = cast(ClassVar[Type], ...) - SKIP_SAMPLES = cast(ClassVar[Type], ...) - AUDIO_SERVICE_TYPE = cast(ClassVar[Type], ...) - MASTERING_DISPLAY_METADATA = cast(ClassVar[Type], ...) - GOP_TIMECODE = cast(ClassVar[Type], ...) - SPHERICAL = cast(ClassVar[Type], ...) - CONTENT_LIGHT_LEVEL = cast(ClassVar[Type], ...) - ICC_PROFILE = cast(ClassVar[Type], ...) - S12M_TIMECODE = cast(ClassVar[Type], ...) - DYNAMIC_HDR_PLUS = cast(ClassVar[Type], ...) - REGIONS_OF_INTEREST = cast(ClassVar[Type], ...) - VIDEO_ENC_PARAMS = cast(ClassVar[Type], ...) - SEI_UNREGISTERED = cast(ClassVar[Type], ...) - FILM_GRAIN_PARAMS = cast(ClassVar[Type], ...) - DETECTION_BBOXES = cast(ClassVar[Type], ...) - DOVI_RPU_BUFFER = cast(ClassVar[Type], ...) - DOVI_METADATA = cast(ClassVar[Type], ...) - DYNAMIC_HDR_VIVID = cast(ClassVar[Type], ...) - AMBIENT_VIEWING_ENVIRONMENT = cast(ClassVar[Type], ...) - VIDEO_HINT = cast(ClassVar[Type], ...) - LCEVC = cast(ClassVar[Type], ...) - VIEW_ID = cast(ClassVar[Type], ...) - THREE_D_REFERENCE_DISPLAYS = cast(ClassVar[Type], ...) - EXIF = cast(ClassVar[Type], ...) + _value_: int + PANSCAN = ... + A53_CC = ... + STEREO3D = ... + MATRIXENCODING = ... + DOWNMIX_INFO = ... + REPLAYGAIN = ... + DISPLAYMATRIX = ... + AFD = ... + MOTION_VECTORS = ... + SKIP_SAMPLES = ... + AUDIO_SERVICE_TYPE = ... + MASTERING_DISPLAY_METADATA = ... + GOP_TIMECODE = ... + SPHERICAL = ... + CONTENT_LIGHT_LEVEL = ... + ICC_PROFILE = ... + S12M_TIMECODE = ... + DYNAMIC_HDR_PLUS = ... + REGIONS_OF_INTEREST = ... + VIDEO_ENC_PARAMS = ... + SEI_UNREGISTERED = ... + FILM_GRAIN_PARAMS = ... + DETECTION_BBOXES = ... + DOVI_RPU_BUFFER = ... + DOVI_METADATA = ... + DYNAMIC_HDR_VIVID = ... + AMBIENT_VIEWING_ENVIRONMENT = ... + VIDEO_HINT = ... + LCEVC = ... + VIEW_ID = ... + THREE_D_REFERENCE_DISPLAYS = ... + EXIF = ... class SideData(Buffer): type: Type diff --git a/av/stream.pyi b/av/stream.pyi index bbbdbbc3c..93d7b1554 100644 --- a/av/stream.pyi +++ b/av/stream.pyi @@ -1,6 +1,6 @@ from enum import IntEnum, IntFlag from fractions import Fraction -from typing import Literal, cast +from typing import Literal from av.rational import AVRational @@ -9,34 +9,34 @@ from .container import Container from .index import IndexEntries class Disposition(IntFlag): - default = cast(int, ...) - dub = cast(int, ...) - original = cast(int, ...) - comment = cast(int, ...) - lyrics = cast(int, ...) - karaoke = cast(int, ...) - forced = cast(int, ...) - hearing_impaired = cast(int, ...) - visual_impaired = cast(int, ...) - clean_effects = cast(int, ...) - attached_pic = cast(int, ...) - timed_thumbnails = cast(int, ...) - non_diegetic = cast(int, ...) - captions = cast(int, ...) - descriptions = cast(int, ...) - metadata = cast(int, ...) - dependent = cast(int, ...) - still_image = cast(int, ...) - multilayer = cast(int, ...) + default = ... + dub = ... + original = ... + comment = ... + lyrics = ... + karaoke = ... + forced = ... + hearing_impaired = ... + visual_impaired = ... + clean_effects = ... + attached_pic = ... + timed_thumbnails = ... + non_diegetic = ... + captions = ... + descriptions = ... + metadata = ... + dependent = ... + still_image = ... + multilayer = ... class Discard(IntEnum): - none = cast(int, ...) - default = cast(int, ...) - nonref = cast(int, ...) - bidir = cast(int, ...) - nonintra = cast(int, ...) - nonkey = cast(int, ...) - all = cast(int, ...) + none = ... + default = ... + nonref = ... + bidir = ... + nonintra = ... + nonkey = ... + all = ... class Stream: name: str | None diff --git a/av/video/reformatter.pyi b/av/video/reformatter.pyi index 584c77452..87838613f 100644 --- a/av/video/reformatter.pyi +++ b/av/video/reformatter.pyi @@ -1,47 +1,46 @@ from enum import IntEnum, IntFlag -from typing import cast from .frame import VideoFrame class Interpolation(IntFlag): - FAST_BILINEAR = cast(int, ...) - BILINEAR = cast(int, ...) - BICUBIC = cast(int, ...) - X = cast(int, ...) - POINT = cast(int, ...) - AREA = cast(int, ...) - BICUBLIN = cast(int, ...) - GAUSS = cast(int, ...) - SINC = cast(int, ...) - LANCZOS = cast(int, ...) - SPLINE = cast(int, ...) - STRICT = cast(int, ...) - PRINT_INFO = cast(int, ...) - FULL_CHR_H_INT = cast(int, ...) - FULL_CHR_H_INP = cast(int, ...) - DIRECT_BGR = cast(int, ...) - ACCURATE_RND = cast(int, ...) - BITEXACT = cast(int, ...) - UNSTABLE = cast(int, ...) - ERROR_DIFFUSION = cast(int, ...) + FAST_BILINEAR = ... + BILINEAR = ... + BICUBIC = ... + X = ... + POINT = ... + AREA = ... + BICUBLIN = ... + GAUSS = ... + SINC = ... + LANCZOS = ... + SPLINE = ... + STRICT = ... + PRINT_INFO = ... + FULL_CHR_H_INT = ... + FULL_CHR_H_INP = ... + DIRECT_BGR = ... + ACCURATE_RND = ... + BITEXACT = ... + UNSTABLE = ... + ERROR_DIFFUSION = ... class Colorspace(IntEnum): - ITU709 = cast(int, ...) - FCC = cast(int, ...) - ITU601 = cast(int, ...) - ITU624 = cast(int, ...) - SMPTE170M = cast(int, ...) - SMPTE240M = cast(int, ...) - DEFAULT = cast(int, ...) - BT2020 = cast(int, ...) - itu709 = cast(int, ...) - fcc = cast(int, ...) - itu601 = cast(int, ...) - itu624 = cast(int, ...) - smpte170m = cast(int, ...) - smpte240m = cast(int, ...) - default = cast(int, ...) - bt2020 = cast(int, ...) + ITU709 = ... + FCC = ... + ITU601 = ... + ITU624 = ... + SMPTE170M = ... + SMPTE240M = ... + DEFAULT = ... + BT2020 = ... + itu709 = ... + fcc = ... + itu601 = ... + itu624 = ... + smpte170m = ... + smpte240m = ... + default = ... + bt2020 = ... class ColorRange(IntEnum): UNSPECIFIED = 0 @@ -50,48 +49,48 @@ class ColorRange(IntEnum): NB = 3 class ColorTrc(IntEnum): - BT709 = cast(int, ...) - UNSPECIFIED = cast(int, ...) - GAMMA22 = cast(int, ...) - GAMMA28 = cast(int, ...) - SMPTE170M = cast(int, ...) - SMPTE240M = cast(int, ...) - LINEAR = cast(int, ...) - LOG = cast(int, ...) - LOG_SQRT = cast(int, ...) - IEC61966_2_4 = cast(int, ...) - BT1361_ECG = cast(int, ...) - IEC61966_2_1 = cast(int, ...) - BT2020_10 = cast(int, ...) - BT2020_12 = cast(int, ...) - SMPTE2084 = cast(int, ...) - SMPTE428 = cast(int, ...) - ARIB_STD_B67 = cast(int, ...) - V_LOG = cast(int, ...) + BT709 = ... + UNSPECIFIED = ... + GAMMA22 = ... + GAMMA28 = ... + SMPTE170M = ... + SMPTE240M = ... + LINEAR = ... + LOG = ... + LOG_SQRT = ... + IEC61966_2_4 = ... + BT1361_ECG = ... + IEC61966_2_1 = ... + BT2020_10 = ... + BT2020_12 = ... + SMPTE2084 = ... + SMPTE428 = ... + ARIB_STD_B67 = ... + V_LOG = ... class ColorPrimaries(IntEnum): - BT709 = cast(int, ...) - UNSPECIFIED = cast(int, ...) - BT470M = cast(int, ...) - BT470BG = cast(int, ...) - SMPTE170M = cast(int, ...) - SMPTE240M = cast(int, ...) - FILM = cast(int, ...) - BT2020 = cast(int, ...) - SMPTE428 = cast(int, ...) - SMPTE431 = cast(int, ...) - SMPTE432 = cast(int, ...) - EBU3213 = cast(int, ...) - V_GAMUT = cast(int, ...) + BT709 = ... + UNSPECIFIED = ... + BT470M = ... + BT470BG = ... + SMPTE170M = ... + SMPTE240M = ... + FILM = ... + BT2020 = ... + SMPTE428 = ... + SMPTE431 = ... + SMPTE432 = ... + EBU3213 = ... + V_GAMUT = ... class ChromaLocation(IntEnum): - UNSPECIFIED = cast(int, ...) - LEFT = cast(int, ...) - CENTER = cast(int, ...) - TOPLEFT = cast(int, ...) - TOP = cast(int, ...) - BOTTOMLEFT = cast(int, ...) - BOTTOM = cast(int, ...) + UNSPECIFIED = ... + LEFT = ... + CENTER = ... + TOPLEFT = ... + TOP = ... + BOTTOMLEFT = ... + BOTTOM = ... class VideoReformatter: def reformat( diff --git a/av/video/stream.pyi b/av/video/stream.pyi index 9be73b477..7368bfea4 100644 --- a/av/video/stream.pyi +++ b/av/video/stream.pyi @@ -1,5 +1,5 @@ from collections.abc import Iterator, Sequence -from typing import Literal +from typing import Any, Literal from av.codec.context import ThreadType from av.packet import Packet @@ -29,7 +29,7 @@ class VideoStream(Stream): # from codec context format: VideoFormat thread_count: int - thread_type: ThreadType + thread_type: ThreadType | Any width: int height: int bits_per_coded_sample: int