Debian Codegraph @

av/codec/hwaccel.pyi

raw
1 from enum import IntEnum
2 from typing import cast
3
4 from av.codec.codec import Codec
5 from av.video.format import VideoFormat
6
7 class HWDeviceType(IntEnum):
8 none = cast(int, ...)
9 vdpau = cast(int, ...)
10 cuda = cast(int, ...)
11 vaapi = cast(int, ...)
12 dxva2 = cast(int, ...)
13 qsv = cast(int, ...)
14 videotoolbox = cast(int, ...)
15 d3d11va = cast(int, ...)
16 drm = cast(int, ...)
17 opencl = cast(int, ...)
18 mediacodec = cast(int, ...)
19 vulkan = cast(int, ...)
20 d3d12va = cast(int, ...)
21
22 class HWConfigMethod(IntEnum):
23 none = cast(int, ...)
24 hw_device_ctx = cast(int, ...)
25 hw_frame_ctx = cast(int, ...)
26 internal = cast(int, ...)
27 ad_hoc = cast(int, ...)
28
29 class HWConfig:
30 @property
31 def device_type(self) -> HWDeviceType: ...
32 @property
33 def format(self) -> VideoFormat: ...
34 @property
35 def methods(self) -> HWConfigMethod: ...
36 @property
37 def is_supported(self) -> bool: ...
38
39 class HWAccel:
40 options: dict[str, object]
41
42 @property
43 def is_hw_owned(self) -> bool: ...
44 @property
45 def device_id(self) -> int: ...
46 def __init__(
47 self,
48 device_type: str | HWDeviceType,
49 device: str | int | None = None,
50 allow_software_fallback: bool = False,
51 options: dict[str, object] | None = None,
52 flags: int | None = None,
53 is_hw_owned: bool = False,
54 ) -> None: ...
55 def create(self, codec: Codec) -> HWAccel: ...
56
57 def hwdevices_available() -> list[str]: ...