Android: Clean up JNI generated code

It's now possible to generate JNI code for constructors and enums
correctly. This CL cleans that up.

Bug: webrtc:8278,webrtc:8551,webrtc:8556
Change-Id: I2284a30139cbb186c80713eb6113eda5659c16ad
Reviewed-on: https://webrtc-review.googlesource.com/25622
Reviewed-by: Sami Kalliomäki <sakal@webrtc.org>
Commit-Queue: Magnus Jedvert <magjed@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#20860}
This commit is contained in:
Magnus Jedvert
2017-11-23 16:56:44 +01:00
committed by Commit Bot
parent aea1d1ad3f
commit 1f2a3e7058
14 changed files with 23 additions and 68 deletions

View File

@ -12,8 +12,6 @@ package org.webrtc;
import java.nio.ByteBuffer;
import java.util.concurrent.TimeUnit;
// TODO(bugs.webrtc.org/8556): Remove unnecessary import.
import org.webrtc.EncodedImage;
/**
* An encoded frame from a video stream. Used as an input for decoders and as an output for
@ -36,9 +34,8 @@ public class EncodedImage {
return nativeIndex;
}
// TODO(bugs.webrtc.org/8556): Remove unnecessary 'EncodedImage.'.
@CalledByNative("FrameType")
static EncodedImage.FrameType fromNativeIndex(int nativeIndex) {
static FrameType fromNativeIndex(int nativeIndex) {
for (FrameType type : FrameType.values()) {
if (type.getNative() == nativeIndex) {
return type;
@ -58,6 +55,7 @@ public class EncodedImage {
public final boolean completeFrame;
public final Integer qp;
@CalledByNative
private EncodedImage(ByteBuffer buffer, int encodedWidth, int encodedHeight, long captureTimeNs,
FrameType frameType, int rotation, boolean completeFrame, Integer qp) {
this.buffer = buffer;
@ -138,13 +136,4 @@ public class EncodedImage {
rotation, completeFrame, qp);
}
}
// TODO(bugs.webrtc.org/8551) Remove.
@CalledByNative
static EncodedImage create(ByteBuffer buffer, int encodedWidth, int encodedHeight,
long captureTimeNs, EncodedImage.FrameType frameType, int rotation, boolean completeFrame,
Integer qp) {
return new EncodedImage(
buffer, encodedWidth, encodedHeight, captureTimeNs, frameType, rotation, completeFrame, qp);
}
}