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 0ea8d21
Browse filesBrowse the repository at this point in the historyBrowse files
Copy file name to clipboardExpand all lines: docs/tools/video/video-buffer-converter.md
+3-1Lines changed: 3 additions & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -137,7 +137,9 @@ public void onImage(BufferedImage image) {
137
137
## Error handling and edge cases
138
138
- All methods throw `NullPointerException` if src/dst is null; ensure proper checks.
139
139
-`ByteBuffer` destinations must be writable (not read-only) for `convertFromI420`.
140
-
- 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.
140
+
- A packed `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.
141
+
- I420 frames need positive dimensions. Every Y/U/V plane must be a non-null direct buffer with stride at least its plane width and capacity of at least `stride * (rows - 1L) + columns` bytes. Chroma dimensions round up to half the frame dimensions. The last row needs no trailing padding.
142
+
- I420 plane positions and limits are ignored; return a slice with the appropriate capacity to restrict a plane's memory. Read-only planes are accepted as sources, but all three destination planes must be writable. Invalid planes cause a `RuntimeException` before conversion writes any pixels.
141
143
- Ensure the correct FourCC is used for the actual memory layout you pass/expect.
142
144
- Beware of frame rotation metadata; conversions do not rotate pixels. Handle `VideoFrame.rotation` separately if your renderer requires upright images.
0 commit comments