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
1 change: 1 addition & 0 deletions av/audio/codeccontext.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
from cython.cimports.av.packet import Packet


@cython.final
@cython.cclass
class AudioCodecContext(CodecContext):
@cython.cfunc
Expand Down
1 change: 1 addition & 0 deletions av/audio/fifo.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
from cython.cimports.av.error import err_check


@cython.final
@cython.cclass
class AudioFifo:
"""A simple audio sample FIFO (First In First Out) buffer."""
Expand Down
1 change: 1 addition & 0 deletions av/audio/format.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ def get_audio_format(c_format: lib.AVSampleFormat) -> AudioFormat:
return format


@cython.final
@cython.cclass
class AudioFormat:
"""Descriptor of audio formats."""
Expand Down
1 change: 1 addition & 0 deletions av/audio/frame.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ def alloc_audio_frame() -> AudioFrame:
}


@cython.final
@cython.cclass
class AudioFrame(Frame):
"""A frame of audio."""
Expand Down
1 change: 1 addition & 0 deletions av/audio/layout.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ def get_audio_layout(c_layout: lib.AVChannelLayout) -> AudioLayout:
return layout


@cython.final
@cython.cclass
class AudioLayout:
def __cinit__(self, layout):
Expand Down
1 change: 1 addition & 0 deletions av/audio/plane.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
from cython.cimports.av.audio.frame import AudioFrame


@cython.final
@cython.cclass
class AudioPlane(Plane):
def __cinit__(self, frame: AudioFrame, index: cython.int):
Expand Down
1 change: 1 addition & 0 deletions av/audio/resampler.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
from av.error import FFmpegError


@cython.final
@cython.cclass
class AudioResampler:
"""AudioResampler(format=None, layout=None, rate=None)
Expand Down
1 change: 1 addition & 0 deletions av/audio/stream.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
from cython.cimports.av.packet import Packet


@cython.final
@cython.cclass
class AudioStream(Stream):
def __repr__(self):
Expand Down
1 change: 1 addition & 0 deletions av/bitstream.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
from cython.cimports.libc.errno import EAGAIN


@cython.final
@cython.cclass
class BitStreamFilterContext:
"""
Expand Down
1 change: 1 addition & 0 deletions av/buffer.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
from cython.cimports.libc.string import memcpy


@cython.final
@cython.cclass
class ByteSource:
def __cinit__(self, owner):
Expand Down
1 change: 1 addition & 0 deletions av/codec/codec.py
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,7 @@ class UnknownCodecError(ValueError):
pass


@cython.final
@cython.cclass
class Codec:
"""Codec(name, mode='r')
Expand Down
2 changes: 2 additions & 0 deletions av/codec/hwaccel.py
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,7 @@ def wrap_hwconfig(ptr: cython.pointer[cython.const[lib.AVCodecHWConfig]]) -> HWC
return config


@cython.final
@cython.cclass
class HWConfig:
def __init__(self, sentinel):
Expand Down Expand Up @@ -103,6 +104,7 @@ def hwdevices_available():
return result


@cython.final
@cython.cclass
class HWAccel:
def __init__(
Expand Down
13 changes: 7 additions & 6 deletions av/container/input.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
from cython.cimports.av.packet import Packet
from cython.cimports.av.stream import Stream, wrap_stream
from cython.cimports.av.utils import avdict_to_dict
from cython.cimports.libc.stdint import int64_t
from cython.cimports.libc.stdint import int64_t, uint8_t
from cython.cimports.libc.stdlib import free, malloc


Expand All @@ -20,6 +20,7 @@ def close_input(self: InputContainer):
self._myflag &= ~2 # enum.input_was_opened = False


@cython.final
@cython.cclass
class InputContainer(Container):
def __cinit__(self, *args, **kwargs):
Expand Down Expand Up @@ -153,9 +154,9 @@ def demux(self, *args, **kwargs):
streams: list[Stream] = self.streams.get(*args, **kwargs)
if self.ptr.nb_streams == 0:
return
include_stream: cython.pointer[cython.bint] = cython.cast(
cython.pointer[cython.bint],
malloc(self.ptr.nb_streams * cython.sizeof(bint)),
include_stream: cython.pointer[uint8_t] = cython.cast(
cython.pointer[uint8_t],
malloc(self.ptr.nb_streams * cython.sizeof(uint8_t)),
)
if include_stream == cython.NULL:
raise MemoryError()
Expand All @@ -168,12 +169,12 @@ def demux(self, *args, **kwargs):
self.set_timeout(self.read_timeout)
try:
for i in range(self.ptr.nb_streams):
include_stream[i] = False
include_stream[i] = 0
for stream in streams:
i = stream.index
if i >= self.ptr.nb_streams:
raise ValueError(f"stream index {i} out of range")
include_stream[i] = True
include_stream[i] = 1

# Pre-allocate a AVPacket that is reused as the read buffer.
with cython.nogil:
Expand Down
1 change: 1 addition & 0 deletions av/container/output.py
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ def close_output(self: OutputContainer):
self._myflag |= 8 # enum.done = True


@cython.final
@cython.cclass
class OutputContainer(Container):
def __cinit__(self, *args, **kwargs):
Expand Down
1 change: 1 addition & 0 deletions av/container/pyio.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
)


@cython.final
@cython.cclass
class PyIOFile:
def __cinit__(self, file, buffer_size, writeable=None):
Expand Down
1 change: 1 addition & 0 deletions av/container/streams.py
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@ def _get_best_stream_index(
return stream_index


@cython.final
@cython.cclass
class StreamContainer:
"""
Expand Down
1 change: 1 addition & 0 deletions av/descriptor.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ def wrap_avclass(ptr: cython.pointer[cython.const[lib.AVClass]]) -> Descriptor |
return obj


@cython.final
@cython.cclass
class Descriptor:
def __cinit__(self, sentinel):
Expand Down
1 change: 1 addition & 0 deletions av/dictionary.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
from cython.cimports.av.error import err_check


@cython.final
@cython.cclass
class Dictionary:
def __cinit__(self, *args, **kwargs):
Expand Down
1 change: 1 addition & 0 deletions av/filter/context.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ def wrap_filter_context(
return self


@cython.final
@cython.cclass
class FilterContext:
def __cinit__(self, sentinel):
Expand Down
1 change: 1 addition & 0 deletions av/filter/filter.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ def wrap_filter(ptr: cython.pointer[cython.const[lib.AVFilter]]) -> Filter:
return filter_


@cython.final
@cython.cclass
class Filter:
def __cinit__(self, name):
Expand Down
1 change: 1 addition & 0 deletions av/filter/graph.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
from cython.cimports.av.video.frame import VideoFrame


@cython.final
@cython.cclass
class Graph:
def __cinit__(self):
Expand Down
2 changes: 2 additions & 0 deletions av/filter/link.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
_cinit_sentinel = cython.declare(object, object())


@cython.final
@cython.cclass
class FilterLink:
def __cinit__(self, sentinel):
Expand Down Expand Up @@ -78,6 +79,7 @@ def name(self):
return lib.avfilter_pad_get_name(self.base_ptr, self.index)


@cython.final
@cython.cclass
class FilterContextPad(FilterPad):
def __repr__(self):
Expand Down
1 change: 1 addition & 0 deletions av/format.py
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,7 @@ class Flags(Flag):
# fmt: on


@cython.final
@cython.cclass
class ContainerFormat:
"""Descriptor of a container format.
Expand Down
2 changes: 2 additions & 0 deletions av/index.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ def wrap_index_entry(ptr: cython.pointer[cython.const[lib.AVIndexEntry]]) -> Ind
return obj


@cython.final
@cython.cclass
class IndexEntry:
"""A single entry from a stream's index.
Expand Down Expand Up @@ -71,6 +72,7 @@ def wrap_index_entries(ptr: cython.pointer[lib.AVStream]) -> IndexEntries:
return obj


@cython.final
@cython.cclass
class IndexEntries:
"""A sequence-like view of FFmpeg's per-stream index entries.
Expand Down
1 change: 1 addition & 0 deletions av/logging.py
Original file line number Diff line number Diff line change
Expand Up @@ -170,6 +170,7 @@ def get_last_error():
thread_captures = cython.declare(dict, {})


@cython.final
@cython.cclass
class Capture:
"""A context manager for capturing logs.
Expand Down
1 change: 1 addition & 0 deletions av/opaque.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ def key_free(opaque: cython.p_void, data: u8ptr) -> cython.void:
opaque_container.pop(name)


@cython.final
@cython.cclass
class OpaqueContainer:
def __cinit__(self):
Expand Down
2 changes: 2 additions & 0 deletions av/option.py
Original file line number Diff line number Diff line change
Expand Up @@ -124,6 +124,7 @@ def is_filtering_param(self):
return flag_in_bitfield(self.ptr.flags, lib.AV_OPT_FLAG_FILTERING_PARAM)


@cython.final
@cython.cclass
class Option(BaseOption):
@property
Expand Down Expand Up @@ -186,6 +187,7 @@ def wrap_option_choice(
return obj


@cython.final
@cython.cclass
class OptionChoice(BaseOption):
"""
Expand Down
2 changes: 2 additions & 0 deletions av/packet.py
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,7 @@ def packet_sidedata_type_from_literal(dtype: PktSideDataT) -> lib.AVPacketSideDa
return get_args(PktSideDataT).index(dtype)


@cython.final
@cython.cclass
class PacketSideData(Buffer):
@staticmethod
Expand Down Expand Up @@ -207,6 +208,7 @@ def _python_free(
Py_DECREF(cython.cast(object, opaque))


@cython.final
@cython.cclass
class Packet(Buffer):
"""A packet of encoded data within a :class:`~av.format.Stream`.
Expand Down
2 changes: 2 additions & 0 deletions av/sidedata/encparams.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ class VideoEncParamsType(IntEnum):
MPEG2 = lib.AV_VIDEO_ENC_PARAMS_MPEG2


@cython.final
@cython.cclass
class VideoEncParams(SideData):
def __repr__(self):
Expand Down Expand Up @@ -129,6 +130,7 @@ def qp_map(self):
return map


@cython.final
@cython.cclass
class VideoBlockParams:
def __init__(self, video_enc_params: VideoEncParams, idx: cython.int) -> None:
Expand Down
2 changes: 2 additions & 0 deletions av/sidedata/motionvectors.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
_cinit_bypass_sentinel = cython.declare(object, object())


@cython.final
@cython.cclass
class MotionVectors(SideData):
def __init__(self, sentinel, frame: Frame, index: cython.int):
Expand Down Expand Up @@ -70,6 +71,7 @@ def to_ndarray(self):
)


@cython.final
@cython.cclass
class MotionVector:
"""
Expand Down
2 changes: 2 additions & 0 deletions av/stream.py
Original file line number Diff line number Diff line change
Expand Up @@ -279,6 +279,7 @@ def type(self):
return "unknown" if media_type == cython.NULL else media_type


@cython.final
@cython.cclass
class DataStream(Stream):
def __repr__(self):
Expand All @@ -297,6 +298,7 @@ def name(self):
return desc.name


@cython.final
@cython.cclass
class AttachmentStream(Stream):
"""
Expand Down
1 change: 1 addition & 0 deletions av/subtitles/codeccontext.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
from cython.cimports.libc.string import memcpy


@cython.final
@cython.cclass
class SubtitleCodecContext(CodecContext):
@property
Expand Down
1 change: 1 addition & 0 deletions av/subtitles/stream.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
from cython.cimports.av.stream import Stream


@cython.final
@cython.cclass
class SubtitleStream(Stream):
def __getattr__(self, name):
Expand Down
Loading
Loading