Android JNI generation: Set JNI namespace in build files

This CL removes the use of the @JNINamespace annotation and instead
sets the correct JNI namespace in the build file.

Bug: webrtc:8278
Change-Id: Ia4490399e45a97d56b02c260fd80df4edfa092bf
Reviewed-on: https://webrtc-review.googlesource.com/76440
Commit-Queue: Magnus Jedvert <magjed@webrtc.org>
Reviewed-by: Sami Kalliomäki <sakal@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#23299}
This commit is contained in:
Magnus Jedvert
2018-05-18 12:13:56 +02:00
committed by Commit Bot
parent 7e6fcea7de
commit c7da266cb8
72 changed files with 131 additions and 240 deletions

View File

@ -11,7 +11,6 @@
package org.webrtc;
/** Java wrapper for a C++ AudioTrackInterface */
@JNINamespace("webrtc::jni")
public class AudioTrack extends MediaStreamTrack {
public AudioTrack(long nativeTrack) {
super(nativeTrack);

View File

@ -10,7 +10,6 @@
package org.webrtc;
@JNINamespace("webrtc::jni")
public class CallSessionFileRotatingLogSink {
private long nativeSink;

View File

@ -13,7 +13,6 @@ package org.webrtc;
import java.nio.ByteBuffer;
/** Java wrapper for a C++ DataChannelInterface. */
@JNINamespace("webrtc::jni")
public class DataChannel {
/** Java wrapper for WebIDL RTCDataChannel. */
public static class Init {

View File

@ -11,7 +11,6 @@
package org.webrtc;
/** Java wrapper for a C++ DtmfSenderInterface. */
@JNINamespace("webrtc::jni")
public class DtmfSender {
final long nativeDtmfSender;

View File

@ -26,7 +26,6 @@ import javax.annotation.Nullable;
/** Factory for android hardware video encoders. */
@SuppressWarnings("deprecation") // API 16 requires the use of deprecated methods.
@JNINamespace("webrtc::jni")
public class HardwareVideoEncoderFactory implements VideoEncoderFactory {
private static final String TAG = "HardwareVideoEncoderFactory";

View File

@ -37,7 +37,6 @@ import org.webrtc.VideoFrame;
// This class is an implementation detail of the Java PeerConnection API.
@TargetApi(19)
@SuppressWarnings("deprecation")
@JNINamespace("webrtc::jni")
public class MediaCodecVideoEncoder {
// This class is constructed, operated, and destroyed by its C++ incarnation,
// so the class and its methods have non-public visibility. The API this

View File

@ -11,7 +11,6 @@
package org.webrtc;
/** Java wrapper for a C++ MediaSourceInterface. */
@JNINamespace("webrtc::jni")
public class MediaSource {
/** Tracks MediaSourceInterface.SourceState */
public enum State {

View File

@ -15,7 +15,6 @@ import java.util.List;
import java.util.Iterator;
/** Java wrapper for a C++ MediaStreamInterface. */
@JNINamespace("webrtc::jni")
public class MediaStream {
private static final String TAG = "MediaStream";

View File

@ -13,7 +13,6 @@ package org.webrtc;
import javax.annotation.Nullable;
/** Java wrapper for a C++ MediaStreamTrackInterface. */
@JNINamespace("webrtc::jni")
public class MediaStreamTrack {
public static final String AUDIO_TRACK_KIND = "audio";
public static final String VIDEO_TRACK_KIND = "video";

View File

@ -28,7 +28,6 @@ import java.util.Map;
// Most histograms are not updated frequently (e.g. most video metrics are an
// average over the call and recorded when a stream is removed).
// The metrics can for example be retrieved when a peer connection is closed.
@JNINamespace("webrtc::jni")
public class Metrics {
private static final String TAG = "Metrics";

View File

@ -278,18 +278,13 @@ public class NetworkMonitor {
return connectionType != ConnectionType.CONNECTION_NONE;
}
@NativeClassQualifiedName("webrtc::jni::AndroidNetworkMonitor")
private native void nativeNotifyConnectionTypeChanged(long nativePtr);
@NativeClassQualifiedName("webrtc::jni::AndroidNetworkMonitor")
private native void nativeNotifyOfNetworkConnect(long nativePtr, NetworkInformation networkInfo);
@NativeClassQualifiedName("webrtc::jni::AndroidNetworkMonitor")
private native void nativeNotifyOfNetworkDisconnect(long nativePtr, long networkHandle);
@NativeClassQualifiedName("webrtc::jni::AndroidNetworkMonitor")
private native void nativeNotifyConnectionTypeChanged(long nativeAndroidNetworkMonitor);
private native void nativeNotifyOfNetworkConnect(
long nativeAndroidNetworkMonitor, NetworkInformation networkInfo);
private native void nativeNotifyOfNetworkDisconnect(
long nativeAndroidNetworkMonitor, long networkHandle);
private native void nativeNotifyOfActiveNetworkList(
long nativePtr, NetworkInformation[] networkInfos);
long nativeAndroidNetworkMonitor, NetworkInformation[] networkInfos);
// For testing only.
@Nullable

View File

@ -21,7 +21,6 @@ import javax.annotation.Nullable;
* JS APIs: http://dev.w3.org/2011/webrtc/editor/webrtc.html and
* http://www.w3.org/TR/mediacapture-streams/
*/
@JNINamespace("webrtc::jni")
public class PeerConnection {
/** Tracks PeerConnectionInterface::IceGatheringState */
public enum IceGatheringState {

View File

@ -20,7 +20,6 @@ import org.webrtc.audio.LegacyAudioDeviceModule;
* Java wrapper for a C++ PeerConnectionFactoryInterface. Main entry point to
* the PeerConnection API for clients.
*/
@JNINamespace("webrtc::jni")
public class PeerConnectionFactory {
public static final String TRIAL_ENABLED = "Enabled";
@Deprecated public static final String VIDEO_FRAME_EMIT_TRIAL = "VideoFrameEmit";

View File

@ -14,7 +14,6 @@ import javax.annotation.Nullable;
import org.webrtc.MediaStreamTrack;
/** Java wrapper for a C++ RtpReceiverInterface. */
@JNINamespace("webrtc::jni")
public class RtpReceiver {
/** Java wrapper for a C++ RtpReceiverObserverInterface*/
public static interface Observer {

View File

@ -13,7 +13,6 @@ package org.webrtc;
import javax.annotation.Nullable;
/** Java wrapper for a C++ RtpSenderInterface. */
@JNINamespace("webrtc::jni")
public class RtpSender {
final long nativeRtpSender;

View File

@ -31,7 +31,6 @@ import org.webrtc.RtpParameters.Encoding;
* <p>WebRTC specification for RTCRtpTransceiver, the JavaScript analog:
* https://w3c.github.io/webrtc-pc/#dom-rtcrtptransceiver
*/
@JNINamespace("webrtc::jni")
public class RtpTransceiver {
/** Java version of webrtc::RtpTransceiverDirection - the ordering must be kept in sync. */
public enum RtpTransceiverDirection {

View File

@ -11,7 +11,6 @@
package org.webrtc;
/** Java wrapper for a C++ TurnCustomizer. */
@JNINamespace("webrtc::jni")
public class TurnCustomizer {
final long nativeTurnCustomizer;

View File

@ -13,7 +13,6 @@ package org.webrtc;
/**
* A combined video decoder that falls back on a secondary decoder if the primary decoder fails.
*/
@JNINamespace("webrtc::jni")
public class VideoDecoderFallback extends WrappedNativeVideoDecoder {
private final VideoDecoder fallback;
private final VideoDecoder primary;

View File

@ -13,7 +13,6 @@ package org.webrtc;
/**
* A combined video encoder that falls back on a secondary encoder if the primary encoder fails.
*/
@JNINamespace("webrtc::jni")
public class VideoEncoderFallback extends WrappedNativeVideoEncoder {
private final VideoEncoder fallback;
private final VideoEncoder primary;

View File

@ -24,7 +24,6 @@ import java.util.concurrent.LinkedBlockingQueue;
/**
* Can be used to save the video frames to file.
*/
@JNINamespace("webrtc::jni")
public class VideoFileRenderer implements VideoSink {
private static final String TAG = "VideoFileRenderer";

View File

@ -26,7 +26,6 @@ import javax.annotation.Nullable;
* format and serves as a fallback for video sinks that can only handle I420, e.g. the internal
* WebRTC software encoders.
*/
@JNINamespace("webrtc::jni")
public class VideoFrame implements RefCounted {
/**
* Implements image storage medium. Might be for example an OpenGL texture or a memory region

View File

@ -21,7 +21,6 @@ import javax.annotation.Nullable;
* drawer.drawYuv depending on the type of the buffer. The frame will be rendered with rotation
* taken into account. You can supply an additional render matrix for custom transformations.
*/
@JNINamespace("webrtc::jni")
public class VideoFrameDrawer {
/**
* Draws a VideoFrame.TextureBuffer. Calls either drawer.drawOes or drawer.drawRgb

View File

@ -20,7 +20,6 @@ import org.webrtc.VideoFrame;
* class also provides a createGui() method for creating a GUI-rendering window
* on various platforms.
*/
@JNINamespace("webrtc::jni")
public class VideoRenderer {
/**
* Java version of webrtc::VideoFrame. Frames are only constructed from native code and test

View File

@ -15,7 +15,6 @@ import javax.annotation.Nullable;
/**
* Java wrapper of native AndroidVideoTrackSource.
*/
@JNINamespace("webrtc::jni")
public class VideoSource extends MediaSource {
private final NativeCapturerObserver capturerObserver;

View File

@ -15,7 +15,6 @@ import java.util.ArrayList;
import java.util.List;
/** Java version of VideoTrackInterface. */
@JNINamespace("webrtc::jni")
public class VideoTrack extends MediaStreamTrack {
private final List<VideoRenderer> renderers = new ArrayList<>();
private final IdentityHashMap<VideoSink, Long> sinks = new IdentityHashMap<VideoSink, Long>();

View File

@ -13,7 +13,6 @@ package org.webrtc;
import java.nio.ByteBuffer;
/** Wraps libyuv methods to Java. All passed byte buffers must be direct byte buffers. */
@JNINamespace("webrtc::jni")
public class YuvHelper {
/** Helper method for copying I420 to tightly packed destination buffer. */
public static void I420Copy(ByteBuffer srcY, int srcStrideY, ByteBuffer srcU, int srcStrideU,

View File

@ -12,7 +12,6 @@ package org.webrtc.audio;
import android.media.AudioManager;
import android.content.Context;
import org.webrtc.JNINamespace;
import org.webrtc.JniCommon;
import org.webrtc.Logging;
@ -20,7 +19,6 @@ import org.webrtc.Logging;
* AudioDeviceModule implemented using android.media.AudioRecord as input and
* android.media.AudioTrack as output.
*/
@JNINamespace("webrtc::jni")
public class JavaAudioDeviceModule implements AudioDeviceModule {
private static final String TAG = "JavaAudioDeviceModule";