Pass java EncodedImage over jni to VideoEncoderWrapper::OnEncodedFrame

Preparation for adding a release() method on java's EncodedImage, and
call that from C++.

Bug: webrtc:9378
Change-Id: I301f64b16684c535f45a3fc9cd9ae1543df59d92
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/141861
Reviewed-by: Sami Kalliomäki <sakal@webrtc.org>
Commit-Queue: Niels Moller <nisse@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#28268}
This commit is contained in:
Niels Möller
2019-06-13 14:37:24 +02:00
committed by Commit Bot
parent f3f57700a8
commit 6fd67f086c
6 changed files with 103 additions and 48 deletions

View File

@ -38,13 +38,10 @@ class VideoEncoderWrapper {
@CalledByNative
static VideoEncoder.Callback createEncoderCallback(final long nativeEncoder) {
return (EncodedImage frame, VideoEncoder.CodecSpecificInfo info)
-> nativeOnEncodedFrame(nativeEncoder, frame.buffer, frame.encodedWidth,
frame.encodedHeight, frame.captureTimeNs, frame.frameType.getNative(),
frame.rotation, frame.completeFrame, frame.qp);
return (EncodedImage frame,
VideoEncoder.CodecSpecificInfo info) -> nativeOnEncodedFrame(nativeEncoder, frame);
}
private static native void nativeOnEncodedFrame(long nativeVideoEncoderWrapper, ByteBuffer buffer,
int encodedWidth, int encodedHeight, long captureTimeNs, int frameType, int rotation,
boolean completeFrame, Integer qp);
private static native void nativeOnEncodedFrame(
long nativeVideoEncoderWrapper, EncodedImage frame);
}