Android: One JNI file per Java file
This CL does the following:
* Split out MediaStream JNI code from peerconnection.cc to mediastream.h/mediastream.cc.
* Split out RtpSender JNI code from peerconnection.cc to rtpsender.h/rtpsender.cc.
* Split out TurnCustomizer JNI code from peerconnection.cc to turncustomizer.h/turncustomizer.cc.
* Add missing instanceof function to WrappedNativeVideoDecoder.java.
* Move some PeerConnectionFactory JNI declarations from pc/video.cc to peerconnectionfactory.cc.
* Add declaration to video.h for the JNI functions that depend on EglBase14_jni.h.
* Use a scoped object to store the global Java MediaStream objects that also call dispose.
Bug: webrtc:8278
Change-Id: I3c56a599b8bcbc8f34e5c5a7b9c9fe1d192ff3f3
Reviewed-on: https://webrtc-review.googlesource.com/34645
Commit-Queue: Magnus Jedvert <magjed@webrtc.org>
Reviewed-by: Sami Kalliomäki <sakal@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#21380}
diff --git a/sdk/android/api/org/webrtc/MediaStream.java b/sdk/android/api/org/webrtc/MediaStream.java
index 59caf38..73a7816 100644
--- a/sdk/android/api/org/webrtc/MediaStream.java
+++ b/sdk/android/api/org/webrtc/MediaStream.java
@@ -84,7 +84,7 @@
while (!preservedVideoTracks.isEmpty()) {
removeTrack(preservedVideoTracks.get(0 /* index */));
}
- free(nativeStream);
+ JniCommon.nativeReleaseRef(nativeStream);
}
public String label() {
@@ -141,6 +141,4 @@
private static native boolean removeNativeVideoTrack(long nativeStream, long nativeVideoTrack);
private static native String getNativeLabel(long nativeStream);
-
- private static native void free(long nativeStream);
}