Skip to content

Commit

Permalink
Remove inheritance from object class, it's not needed
Browse files Browse the repository at this point in the history
  • Loading branch information
jlaine committed Oct 30, 2023
1 parent 29ef112 commit fcb87ff
Show file tree
Hide file tree
Showing 59 changed files with 72 additions and 72 deletions.
2 changes: 1 addition & 1 deletion av/audio/format.pxd
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
cimport libav as lib


cdef class AudioFormat(object):
cdef class AudioFormat:

cdef lib.AVSampleFormat sample_fmt

Expand Down
2 changes: 1 addition & 1 deletion av/audio/format.pyx
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ cdef AudioFormat get_audio_format(lib.AVSampleFormat c_format):
return format


cdef class AudioFormat(object):
cdef class AudioFormat:

"""Descriptor of audio formats."""

Expand Down
4 changes: 2 additions & 2 deletions av/audio/layout.pxd
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
from libc.stdint cimport uint64_t


cdef class AudioLayout(object):
cdef class AudioLayout:

# The layout for FFMpeg; this is essentially a bitmask of channels.
cdef uint64_t layout
Expand All @@ -17,7 +17,7 @@ cdef class AudioLayout(object):
cdef _init(self, uint64_t layout)


cdef class AudioChannel(object):
cdef class AudioChannel:

# The channel for FFmpeg.
cdef uint64_t channel
Expand Down
4 changes: 2 additions & 2 deletions av/audio/layout.pyx
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ cdef dict channel_descriptions = {
}


cdef class AudioLayout(object):
cdef class AudioLayout:

def __init__(self, layout):

Expand Down Expand Up @@ -105,7 +105,7 @@ cdef class AudioLayout(object):
return <str>out


cdef class AudioChannel(object):
cdef class AudioChannel:

def __cinit__(self, AudioLayout layout, int index):
self.channel = lib.av_channel_layout_extract_channel(layout.layout, index)
Expand Down
2 changes: 1 addition & 1 deletion av/audio/resampler.pxd
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ from av.audio.layout cimport AudioLayout
from av.filter.graph cimport Graph


cdef class AudioResampler(object):
cdef class AudioResampler:

cdef readonly bint is_passthrough

Expand Down
2 changes: 1 addition & 1 deletion av/audio/resampler.pyx
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import errno
import av.filter


cdef class AudioResampler(object):
cdef class AudioResampler:

"""AudioResampler(format=None, layout=None, rate=None)
Expand Down
2 changes: 1 addition & 1 deletion av/buffer.pxd
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@

cdef class Buffer(object):
cdef class Buffer:

cdef size_t _buffer_size(self)
cdef void* _buffer_ptr(self)
Expand Down
2 changes: 1 addition & 1 deletion av/buffer.pyx
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ from av import deprecation
from av.bytesource cimport ByteSource, bytesource


cdef class Buffer(object):
cdef class Buffer:

"""A base class for PyAV objects which support the buffer protocol, such
as :class:`.Packet` and :class:`.Plane`.
Expand Down
2 changes: 1 addition & 1 deletion av/bytesource.pxd
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
from cpython.buffer cimport Py_buffer


cdef class ByteSource(object):
cdef class ByteSource:

cdef object owner

Expand Down
2 changes: 1 addition & 1 deletion av/bytesource.pyx
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ from cpython.buffer cimport (
)


cdef class ByteSource(object):
cdef class ByteSource:

def __cinit__(self, owner):
self.owner = owner
Expand Down
2 changes: 1 addition & 1 deletion av/codec/codec.pxd
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
cimport libav as lib


cdef class Codec(object):
cdef class Codec:

cdef const lib.AVCodec *ptr
cdef const lib.AVCodecDescriptor *desc
Expand Down
2 changes: 1 addition & 1 deletion av/codec/codec.pyx
Original file line number Diff line number Diff line change
Expand Up @@ -138,7 +138,7 @@ class UnknownCodecError(ValueError):
pass


cdef class Codec(object):
cdef class Codec:

"""Codec(name, mode='r')
Expand Down
2 changes: 1 addition & 1 deletion av/codec/context.pxd
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ from av.frame cimport Frame
from av.packet cimport Packet


cdef class CodecContext(object):
cdef class CodecContext:

cdef lib.AVCodecContext *ptr

Expand Down
2 changes: 1 addition & 1 deletion av/codec/context.pyx
Original file line number Diff line number Diff line change
Expand Up @@ -135,7 +135,7 @@ Flags2 = define_enum('Flags2', __name__, (
), is_flags=True)


cdef class CodecContext(object):
cdef class CodecContext:

@staticmethod
def create(codec, mode=None):
Expand Down
2 changes: 1 addition & 1 deletion av/container/core.pxd
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ ctypedef struct timeout_info:
double timeout


cdef class Container(object):
cdef class Container:

cdef readonly bint writeable
cdef lib.AVFormatContext *ptr
Expand Down
2 changes: 1 addition & 1 deletion av/container/core.pyx
Original file line number Diff line number Diff line change
Expand Up @@ -166,7 +166,7 @@ Flags = define_enum('Flags', __name__, (
), is_flags=True)


cdef class Container(object):
cdef class Container:

def __cinit__(self, sentinel, file_, format_name, options,
container_options, stream_options,
Expand Down
2 changes: 1 addition & 1 deletion av/container/pyio.pxd
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ cdef void pyio_close_gil(lib.AVIOContext *pb)
cdef void pyio_close_custom_gil(lib.AVIOContext *pb)


cdef class PyIOFile(object):
cdef class PyIOFile:

# File-like source.
cdef readonly object file
Expand Down
2 changes: 1 addition & 1 deletion av/container/pyio.pyx
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ from av.error cimport stash_exception
ctypedef int64_t (*seek_func_t)(void *opaque, int64_t offset, int whence) noexcept nogil


cdef class PyIOFile(object):
cdef class PyIOFile:

def __cinit__(self, file, buffer_size, writeable=None):

Expand Down
2 changes: 1 addition & 1 deletion av/container/streams.pxd
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
from av.stream cimport Stream


cdef class StreamContainer(object):
cdef class StreamContainer:

cdef list _streams

Expand Down
2 changes: 1 addition & 1 deletion av/container/streams.pyx
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ def _flatten(input_):
yield x


cdef class StreamContainer(object):
cdef class StreamContainer:

"""
Expand Down
4 changes: 2 additions & 2 deletions av/deprecation.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ class MethodDeprecationWarning(AVDeprecationWarning):
warnings.filterwarnings("default", "", AVDeprecationWarning)


class renamed_attr(object):
class renamed_attr:

"""Proxy for renamed attributes (or methods) on classes.
Getting and setting values will be redirected to the provided name,
Expand Down Expand Up @@ -68,7 +68,7 @@ def __set__(self, instance, value):
setattr(instance, self.new_name, value)


class method(object):
class method:
def __init__(self, func):
functools.update_wrapper(self, func, ("__name__", "__doc__"))
self.func = func
Expand Down
2 changes: 1 addition & 1 deletion av/descriptor.pxd
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
cimport libav as lib


cdef class Descriptor(object):
cdef class Descriptor:

# These are present as:
# - AVCodecContext.av_class (same as avcodec_get_class())
Expand Down
2 changes: 1 addition & 1 deletion av/descriptor.pyx
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ cdef Descriptor wrap_avclass(const lib.AVClass *ptr):
return obj


cdef class Descriptor(object):
cdef class Descriptor:

def __cinit__(self, sentinel):
if sentinel is not _cinit_sentinel:
Expand Down
2 changes: 1 addition & 1 deletion av/dictionary.pxd
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
cimport libav as lib


cdef class _Dictionary(object):
cdef class _Dictionary:

cdef lib.AVDictionary *ptr

Expand Down
2 changes: 1 addition & 1 deletion av/dictionary.pyx
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ from collections.abc import MutableMapping
from av.error cimport err_check


cdef class _Dictionary(object):
cdef class _Dictionary:

def __cinit__(self, *args, **kwargs):
for arg in args:
Expand Down
4 changes: 2 additions & 2 deletions av/enum.pyx
Original file line number Diff line number Diff line change
Expand Up @@ -135,7 +135,7 @@ def _unpickle(mod_name, cls_name, item_name):
copyreg.constructor(_unpickle)


cdef class EnumItem(object):
cdef class EnumItem:

"""
Enumerations are when an attribute may only take on a single value at once, and
Expand Down Expand Up @@ -322,7 +322,7 @@ cdef class EnumFlag(EnumItem):
return bool(self.value)


cdef class EnumProperty(object):
cdef class EnumProperty:

cdef object enum
cdef object fget
Expand Down
2 changes: 1 addition & 1 deletion av/filter/context.pxd
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ from av.filter.filter cimport Filter
from av.filter.graph cimport Graph


cdef class FilterContext(object):
cdef class FilterContext:

cdef lib.AVFilterContext *ptr
cdef readonly Graph graph
Expand Down
2 changes: 1 addition & 1 deletion av/filter/context.pyx
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ cdef FilterContext wrap_filter_context(Graph graph, Filter filter, lib.AVFilterC
return self


cdef class FilterContext(object):
cdef class FilterContext:

def __cinit__(self, sentinel):
if sentinel is not _cinit_sentinel:
Expand Down
2 changes: 1 addition & 1 deletion av/filter/filter.pxd
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ cimport libav as lib
from av.descriptor cimport Descriptor


cdef class Filter(object):
cdef class Filter:

cdef const lib.AVFilter *ptr

Expand Down
2 changes: 1 addition & 1 deletion av/filter/filter.pyx
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ cpdef enum FilterFlags:
SUPPORT_TIMELINE_INTERNAL = lib.AVFILTER_FLAG_SUPPORT_TIMELINE_INTERNAL


cdef class Filter(object):
cdef class Filter:

def __cinit__(self, name):
if name is _cinit_sentinel:
Expand Down
2 changes: 1 addition & 1 deletion av/filter/graph.pxd
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ cimport libav as lib
from av.filter.context cimport FilterContext


cdef class Graph(object):
cdef class Graph:

cdef lib.AVFilterGraph *ptr

Expand Down
2 changes: 1 addition & 1 deletion av/filter/graph.pyx
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ from av.video.format cimport VideoFormat
from av.video.frame cimport VideoFrame


cdef class Graph(object):
cdef class Graph:

def __cinit__(self):

Expand Down
2 changes: 1 addition & 1 deletion av/filter/link.pxd
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ from av.filter.graph cimport Graph
from av.filter.pad cimport FilterContextPad


cdef class FilterLink(object):
cdef class FilterLink:

cdef readonly Graph graph
cdef lib.AVFilterLink *ptr
Expand Down
2 changes: 1 addition & 1 deletion av/filter/link.pyx
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ from av.filter.graph cimport Graph
cdef _cinit_sentinel = object()


cdef class FilterLink(object):
cdef class FilterLink:

def __cinit__(self, sentinel):
if sentinel is not _cinit_sentinel:
Expand Down
2 changes: 1 addition & 1 deletion av/filter/pad.pxd
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ from av.filter.filter cimport Filter
from av.filter.link cimport FilterLink


cdef class FilterPad(object):
cdef class FilterPad:

cdef readonly Filter filter
cdef readonly FilterContext context
Expand Down
2 changes: 1 addition & 1 deletion av/filter/pad.pyx
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ from av.filter.link cimport wrap_filter_link
cdef object _cinit_sentinel = object()


cdef class FilterPad(object):
cdef class FilterPad:

def __cinit__(self, sentinel):
if sentinel is not _cinit_sentinel:
Expand Down
2 changes: 1 addition & 1 deletion av/format.pxd
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
cimport libav as lib


cdef class ContainerFormat(object):
cdef class ContainerFormat:

cdef readonly str name

Expand Down
2 changes: 1 addition & 1 deletion av/format.pyx
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ Flags = define_enum('Flags', __name__, (
), is_flags=True)


cdef class ContainerFormat(object):
cdef class ContainerFormat:

"""Descriptor of a container format.
Expand Down
2 changes: 1 addition & 1 deletion av/frame.pxd
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ from av.packet cimport Packet
from av.sidedata.sidedata cimport _SideDataContainer


cdef class Frame(object):
cdef class Frame:

cdef lib.AVFrame *ptr

Expand Down
2 changes: 1 addition & 1 deletion av/frame.pyx
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ from fractions import Fraction
from av.sidedata.sidedata import SideDataContainer


cdef class Frame(object):
cdef class Frame:
"""
Base class for audio and video frames.
Expand Down
Loading

0 comments on commit fcb87ff

Please sign in to comment.