-
Notifications
You must be signed in to change notification settings - Fork 366
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Make VideoFrame.from_numpy_buffer support buffers with padding
Some devices have hardware that creates image buffers with padding, so adding support here means less frame buffer copying is required. Specifically, we extend the support to buffers where the pixel rows are contiguous, though the image doesn't comprise all the pixels on the row (and is therefore not strictly contiguous). We also support yuv420p images with padding. These have padding in the middle of the UV rows as well as at the end, so can't be trimmed by the application before being passed in. Instead, the true image width must be passed. Tests are also added to ensure all these cases now avoid copying.
- Loading branch information
1 parent
23a1cc4
commit 8cb4261
Showing
2 changed files
with
235 additions
and
16 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters