Update JavaI420Buffer.allocate to use native allocations.
This ensures memory is released timely and avoids problems with garbage collection. Native buffers don't support array operation, so FileVideoCapturer had to be update to use FileChannel to write ByteBuffers directly. Bug: None Change-Id: I3f63d2adc159e9f39f0c68dd0bd6b1747686584e Reviewed-on: https://webrtc-review.googlesource.com/55262 Commit-Queue: Sami Kalliomäki <sakal@webrtc.org> Reviewed-by: Anders Carlsson <andersc@webrtc.org> Cr-Commit-Position: refs/heads/master@{#22118}
This commit is contained in:
committed by
Commit Bot
parent
defad847b1
commit
0611065256
@ -211,7 +211,6 @@ public class HardwareVideoEncoderTest {
|
||||
|
||||
public MockI420Buffer(int width, int height, Runnable releaseCallback) {
|
||||
super(width, height, releaseCallback);
|
||||
// We never release this but it is not a problem in practice because the release is a no-op.
|
||||
realBuffer = JavaI420Buffer.allocate(width, height);
|
||||
}
|
||||
|
||||
@ -251,6 +250,18 @@ public class HardwareVideoEncoderTest {
|
||||
return this;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void retain() {
|
||||
super.retain();
|
||||
realBuffer.retain();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void release() {
|
||||
super.release();
|
||||
realBuffer.release();
|
||||
}
|
||||
|
||||
@Override
|
||||
public VideoFrame.Buffer cropAndScale(
|
||||
int cropX, int cropY, int cropWidth, int cropHeight, int scaleWidth, int scaleHeight) {
|
||||
|
||||
Reference in New Issue
Block a user