Skip to content

fix: accept custom frame buffers in VideoFrame.copy() and pushFrame() - #455

Merged
devopvoid merged 2 commits into
mainfrom
fix/custom-frame-buffers
Oct 26, 2026
Merged

devopvoid merged 2 commits into
mainfrom
fix/custom-frame-buffers

Conversation

@devopvoid

@devopvoid devopvoid commented Oct 26, 2026 •

Copy link
Copy Markdown
Owner

A custom VideoFrameBuffer failed in VideoFrame.copy() with a ClassCastException and in CustomVideoSource.pushFrame() with a NoSuchFieldError.

Both now take the pixels from toI420() through toNativeBuffer: a NativeI420Buffer returned there is shared, any other I420 buffer is copied after the plane checks of #454. Copying a released NativeI420Buffer now throws instead of reading freed memory.

Both now take the pixels from toI420() through one native conversion,
which shares a NativeI420Buffer and checks the size, strides and plane
capacities of any other I420 buffer before copying it.
# Conflicts:
#	webrtc-jni/src/main/cpp/src/api/VideoFrame.cpp
@devopvoid
devopvoid merged commit 15d93cd into main Oct 26, 2026
25 checks passed
@devopvoid
devopvoid deleted the fix/custom-frame-buffers branch October 26, 2026 15:57
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant