You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Commit 163a017
Browse filesBrowse the repository at this point in the historyBrowse files
fix: convert only the window between position and limit of a ByteBuffer (#415)
VideoBufferConverter passes direct buffers as slices and heap buffers with offset and length, so slices and buffers with a position no longer read or write outside their window. The position stays as it is.
Copy file name to clipboardExpand all lines: docs/tools/video/video-buffer-converter.md
+1Lines changed: 1 addition & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -135,6 +135,7 @@ public void onImage(BufferedImage image) {
135
135
## Error handling and edge cases
136
136
- All methods throw `NullPointerException` if src/dst is null; ensure proper checks.
137
137
-`ByteBuffer` destinations must be writable (not read-only) for `convertFromI420`.
138
+
- A `ByteBuffer` is read or written between its position and its limit only, also when it is a slice or a view of a larger buffer. The window must hold the whole frame; the position and limit stay as they are.
138
139
- Ensure the correct FourCC is used for the actual memory layout you pass/expect.
139
140
- Beware of frame rotation metadata; conversions do not rotate pixels. Handle `VideoFrame.rotation` separately if your renderer requires upright images.
0 commit comments