2026-06-16 17:09:34 +00:00
|
|
|
import cython
|
2026-02-06 22:23:20 +01:00
|
|
|
|
2026-06-16 17:09:34 +00:00
|
|
|
|
|
|
|
|
@cython.cclass
|
|
|
|
|
class Plane(Buffer):
|
2026-02-06 22:23:20 +01:00
|
|
|
"""
|
|
|
|
|
Base class for audio and video planes.
|
|
|
|
|
|
|
|
|
|
See also :class:`~av.audio.plane.AudioPlane` and :class:`~av.video.plane.VideoPlane`.
|
|
|
|
|
"""
|
|
|
|
|
|
2026-06-16 17:09:34 +00:00
|
|
|
def __cinit__(self, frame: Frame, index: cython.int):
|
2026-02-06 22:23:20 +01:00
|
|
|
self.frame = frame
|
|
|
|
|
self.index = index
|
|
|
|
|
|
|
|
|
|
def __repr__(self):
|
|
|
|
|
return (
|
|
|
|
|
f"<av.{self.__class__.__name__} {self.buffer_size} bytes; "
|
|
|
|
|
f"buffer_ptr=0x{self.buffer_ptr:x}; at 0x{id(self):x}>"
|
|
|
|
|
)
|
|
|
|
|
|
2026-06-16 17:09:34 +00:00
|
|
|
@cython.cfunc
|
|
|
|
|
def _buffer_ptr(self) -> cython.p_void:
|
2026-02-06 22:23:20 +01:00
|
|
|
return self.frame.ptr.extended_data[self.index]
|