|
| 1 | +from collections.abc import Callable, Sequence |
| 2 | +from typing import Annotated, overload |
| 3 | + |
| 4 | +from numpy.typing import NDArray |
| 5 | + |
| 6 | +import spdl.io.lib._spdl_ffmpeg8 |
| 7 | + |
| 8 | + |
| 9 | +class CUDAConfig: |
| 10 | + pass |
| 11 | + |
| 12 | +def cuda_config(device_index: int, stream: int = 0, allocator: tuple[Callable[[int, int, int], int], Callable[[int], None]] | None = None) -> CUDAConfig: ... |
| 13 | + |
| 14 | +class CUDABuffer: |
| 15 | + @property |
| 16 | + def __cuda_array_interface__(self) -> dict: ... |
| 17 | + |
| 18 | + @property |
| 19 | + def device_index(self) -> int: ... |
| 20 | + |
| 21 | +class NvDecDecoder: |
| 22 | + def reset(self) -> None: ... |
| 23 | + |
| 24 | + def init(self, device_config: CUDAConfig, codec: spdl.io.lib._spdl_ffmpeg8.VideoCodec, *, crop_left: int = 0, crop_top: int = 0, crop_right: int = 0, crop_bottom: int = 0, scale_width: int = -1, scale_height: int = -1) -> None: ... |
| 25 | + |
| 26 | + def decode(self, packets: spdl.io.lib._spdl_ffmpeg8.VideoPackets) -> list[CUDABuffer]: ... |
| 27 | + |
| 28 | + def flush(self) -> list[CUDABuffer]: ... |
| 29 | + |
| 30 | +@overload |
| 31 | +def decode_image_nvjpeg(data: bytes, *, device_config: CUDAConfig, scale_width: int = -1, scale_height: int = -1, pix_fmt: str = 'rgb', _zero_clear: bool = False) -> None: ... |
| 32 | + |
| 33 | +@overload |
| 34 | +def decode_image_nvjpeg(data: Sequence[bytes], *, device_config: CUDAConfig, scale_width: int, scale_height: int, pix_fmt: str = 'rgb', _zero_clear: bool = False) -> None: ... |
| 35 | + |
| 36 | +def cpu_storage(size: int) -> spdl.io.lib._spdl_ffmpeg8.CPUStorage: ... |
| 37 | + |
| 38 | +@overload |
| 39 | +def transfer_buffer(buffer: spdl.io.lib._spdl_ffmpeg8.CPUBuffer, *, device_config: CUDAConfig) -> CUDABuffer: ... |
| 40 | + |
| 41 | +@overload |
| 42 | +def transfer_buffer(buffer: Annotated[NDArray, dict(order='C', device='cpu')], *, device_config: CUDAConfig) -> CUDABuffer: ... |
| 43 | + |
| 44 | +def transfer_buffer_cpu(buffer: Annotated[NDArray, dict(order='C', device='cuda')]) -> spdl.io.lib._spdl_ffmpeg8.CPUBuffer: ... |
| 45 | + |
| 46 | +def init() -> None: ... |
| 47 | + |
| 48 | +def built_with_cuda() -> bool: ... |
| 49 | + |
| 50 | +def built_with_nvcodec() -> bool: ... |
| 51 | + |
| 52 | +def built_with_nvjpeg() -> bool: ... |
| 53 | + |
| 54 | +def synchronize_stream(arg: CUDAConfig, /) -> None: ... |
| 55 | + |
| 56 | +def nv12_to_planar_rgb(buffers: Sequence[CUDABuffer], *, device_config: CUDAConfig, matrix_coeff: int = 1) -> CUDABuffer: ... |
| 57 | + |
| 58 | +def nv12_to_planar_bgr(buffers: Sequence[CUDABuffer], *, device_config: CUDAConfig, matrix_coeff: int = 1) -> CUDABuffer: ... |
0 commit comments