Skip to content

Commit

Permalink
Bump version
Browse files Browse the repository at this point in the history
  • Loading branch information
WyattBlue committed Jan 5, 2024
1 parent 08b54db commit 32f9b88
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 3 deletions.
2 changes: 1 addition & 1 deletion av/about.py
Original file line number Diff line number Diff line change
@@ -1 +1 @@
__version__ = "12.0.1"
__version__ = "12.0.2"
5 changes: 4 additions & 1 deletion av/video/frame.pyi
Original file line number Diff line number Diff line change
Expand Up @@ -32,11 +32,14 @@ class VideoFrame(Frame):
def from_image(img: Image.Image) -> VideoFrame: ...
@staticmethod
def from_ndarray(array: np.ndarray, format: str = "rgb24") -> VideoFrame: ...
@staticmethod
def from_numpy_buffer(array: np.ndarray, format: str = "rgb24"): ...

def __init__(
self, name: str, width: int = 0, height: int = 0, format: str = "yuv420p"
): ...
def to_image(self, **kwargs) -> Image.Image: ...
def to_ndarray(self, **kwargs) -> np.ndarray: ...
def to_ndarray(self, enable_fast_path: bool = False, **kwargs) -> np.ndarray: ...
def reformat(
self,
width: int | None = None,
Expand Down
3 changes: 2 additions & 1 deletion av/video/frame.pyx
Original file line number Diff line number Diff line change
Expand Up @@ -241,7 +241,7 @@ cdef class VideoFrame(Frame):

return Image.frombytes("RGB", (plane.width, plane.height), bytes(o_buf), "raw", "RGB", 0, 1)

def to_ndarray(self, **kwargs):
def to_ndarray(self, enable_fast_path=False, **kwargs):
"""Get a numpy array of this frame.
Any ``**kwargs`` are passed to :meth:`.VideoReformatter.reformat`.
Expand All @@ -264,6 +264,7 @@ cdef class VideoFrame(Frame):
assert frame.height % 2 == 0
# Fast path for the case that the entire YUV data is contiguous
if (
enable_fast_path and
frame.planes[0].line_size == frame.planes[0].width and
frame.planes[1].line_size == frame.planes[1].width and
frame.planes[2].line_size == frame.planes[2].width
Expand Down

0 comments on commit 32f9b88

Please sign in to comment.