Fix memory leak in NativeToJavaVideoFrame.

This method used to just wrap frame when passed a native frame and
create a new one when passed non-native frame. This caused a memory
leak when a new frame was returned because the caller didn't release
the frame. Now the method always returns a new frame and the caller is
responsible for releasing it.

Bug: webrtc:8892, b/72675429
Change-Id: I06d67a6ed4c059cae1d709c51b0266f9c72fef1a
Reviewed-on: https://webrtc-review.googlesource.com/53840
Reviewed-by: Anders Carlsson <andersc@webrtc.org>
Commit-Queue: Sami Kalliomäki <sakal@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#22033}
This commit is contained in:
Sami Kalliomäki
2018-02-15 13:58:15 +01:00
committed by Commit Bot
parent 2c599d663d
commit 2bde85046a
8 changed files with 32 additions and 14 deletions

View File

@ -177,6 +177,7 @@ public class VideoFrame {
buffer.retain();
}
@CalledByNative
public void release() {
buffer.release();
}