Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 4 additions & 3 deletions av/codec/context.pyi
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,6 @@ class ThreadType(Flag):
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: ...

class Flags(IntEnum):
unaligned = cast(int, ...)
Expand Down Expand Up @@ -145,7 +143,6 @@ class CodecContext:
trailing_padding: int
stats_in: str | None
thread_count: int
thread_type: ThreadType
skip_frame: Literal[
"NONE", "DEFAULT", "NONREF", "BIDIR", "NONINTRA", "NONKEY", "ALL"
]
Expand Down Expand Up @@ -176,6 +173,10 @@ class CodecContext:
@property
def frame_num(self) -> int: ...
@property
def thread_type(self) -> ThreadType: ...
@thread_type.setter
def thread_type(self, value: int | str | ThreadType) -> None: ...
@property
def active_thread_type(self) -> ThreadType: ...
@property
def initial_padding(self) -> int: ...
Expand Down
3 changes: 0 additions & 3 deletions av/codec/hwaccel.pxd
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
cimport libav as lib

from av.codec.codec cimport Codec


cdef class HWConfig:
cdef object __weakref__
Expand All @@ -18,7 +16,6 @@ cdef class HWDevice:

cdef class HWAccel:
cdef str _device
cdef readonly Codec codec
cdef readonly HWConfig config
cdef lib.AVBufferRef *ptr
cdef public dict options
Expand Down
89 changes: 89 additions & 0 deletions av/error.pyi
Original file line number Diff line number Diff line change
@@ -1,7 +1,96 @@
import builtins
from enum import IntEnum

__all__ = [
"ErrorType",
"FFmpegError",
"LookupError",
"HTTPError",
"HTTPClientError",
"UndefinedError",
"PermissionError",
"BlockingIOError",
"ChildProcessError",
"ConnectionAbortedError",
"ConnectionRefusedError",
"ConnectionResetError",
"FileExistsError",
"InterruptedError",
"IsADirectoryError",
"FileNotFoundError",
"NotADirectoryError",
"BrokenPipeError",
"ProcessLookupError",
"TimeoutError",
"MemoryError",
"NotImplementedError",
"OverflowError",
"OSError",
"ArgumentError",
"BSFNotFoundError",
"BugError",
"BufferTooSmallError",
"DecoderNotFoundError",
"DemuxerNotFoundError",
"EncoderNotFoundError",
"EOFError",
"ExitError",
"ExternalError",
"FilterNotFoundError",
"InvalidDataError",
"MuxerNotFoundError",
"OptionNotFoundError",
"PatchWelcomeError",
"ProtocolNotFoundError",
"UnknownError",
"ExperimentalError",
"InputChangedError",
"OutputChangedError",
"HTTPBadRequestError",
"HTTPUnauthorizedError",
"HTTPForbiddenError",
"HTTPNotFoundError",
"HTTPTooManyRequestsError",
"HTTPOtherClientError",
"HTTPServerError",
"PyAVCallbackError",
]

classes: dict[int, Exception]

class ErrorType(IntEnum):
BSF_NOT_FOUND = ...
BUG = ...
BUFFER_TOO_SMALL = ...
DECODER_NOT_FOUND = ...
DEMUXER_NOT_FOUND = ...
ENCODER_NOT_FOUND = ...
EOF = ...
EXIT = ...
EXTERNAL = ...
FILTER_NOT_FOUND = ...
INVALIDDATA = ...
MUXER_NOT_FOUND = ...
OPTION_NOT_FOUND = ...
PATCHWELCOME = ...
PROTOCOL_NOT_FOUND = ...
UNKNOWN = ...
EXPERIMENTAL = ...
INPUT_CHANGED = ...
OUTPUT_CHANGED = ...
HTTP_BAD_REQUEST = ...
HTTP_UNAUTHORIZED = ...
HTTP_FORBIDDEN = ...
HTTP_NOT_FOUND = ...
HTTP_TOO_MANY_REQUESTS = ...
HTTP_OTHER_4XX = ...
HTTP_SERVER_ERROR = ...
PYAV_CALLBACK = ...
@property
def tag(self) -> bytes: ...
@property
def strerror(self) -> str: ...

def code_to_tag(code: int) -> bytes: ...
def tag_to_code(tag: bytes) -> int: ...
def err_check(res: int, filename: str | None = None) -> int: ...
Expand Down
5 changes: 4 additions & 1 deletion av/video/stream.pyi
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,10 @@ class VideoStream(Stream):
# from codec context
format: VideoFormat
thread_count: int
thread_type: ThreadType
@property
def thread_type(self) -> ThreadType: ...
@thread_type.setter
def thread_type(self, value: int | str | ThreadType) -> None: ...
width: int
height: int
bits_per_coded_sample: int
Expand Down
Loading