From 0c6f0f6d96e8989e70f5cbbef3743c7f4538ea9f Mon Sep 17 00:00:00 2001 From: ivoc Date: Wed, 6 Jul 2016 04:34:23 -0700 Subject: [PATCH] Fix for the JNI interface of RtcEventLog functions. BUG=webrtc:4741 Review-Url: https://codereview.webrtc.org/2128483002 Cr-Commit-Position: refs/heads/master@{#13393} --- .../java/src/org/webrtc/PeerConnection.java | 14 ++++------ webrtc/api/android/jni/peerconnection_jni.cc | 28 +++++++------------ 2 files changed, 16 insertions(+), 26 deletions(-) diff --git a/webrtc/api/android/java/src/org/webrtc/PeerConnection.java b/webrtc/api/android/java/src/org/webrtc/PeerConnection.java index 965cea4fd2..3f7952e472 100644 --- a/webrtc/api/android/java/src/org/webrtc/PeerConnection.java +++ b/webrtc/api/android/java/src/org/webrtc/PeerConnection.java @@ -262,16 +262,14 @@ public class PeerConnection { // stopped and a new one will start using the provided file. Logging will // continue until the stopRtcEventLog function is called. The max_size_bytes // argument is ignored, it is added for future use. - public boolean startRtcEventLog( - int file_descriptor, long max_size_bytes) { - return nativeStartRtcEventLog( - nativePeerConnection, file_descriptor, max_size_bytes); + public boolean startRtcEventLog(int file_descriptor, int max_size_bytes) { + return nativeStartRtcEventLog(file_descriptor, max_size_bytes); } // Stops recording an RTC event log. If no RTC event log is currently being // recorded, this call will have no effect. public void stopRtcEventLog() { - nativeStopRtcEventLog(nativePeerConnection); + nativeStopRtcEventLog(); } // TODO(fischman): add support for DTMF-related methods once that API @@ -325,9 +323,9 @@ public class PeerConnection { private native List nativeGetReceivers(); - private static native boolean nativeStartRtcEventLog( - long nativePeerConnection, int file_descriptor, long max_size_bytes); + private native boolean nativeStartRtcEventLog( + int file_descriptor, int max_size_bytes); - private static native void nativeStopRtcEventLog(long nativePeerConnection); + private native void nativeStopRtcEventLog(); } diff --git a/webrtc/api/android/jni/peerconnection_jni.cc b/webrtc/api/android/jni/peerconnection_jni.cc index 0e9a5a035b..b5a191dddb 100644 --- a/webrtc/api/android/jni/peerconnection_jni.cc +++ b/webrtc/api/android/jni/peerconnection_jni.cc @@ -1319,24 +1319,6 @@ JOW(void, PeerConnectionFactory_nativeStopAecDump)( factory->StopAecDump(); } -JOW(jboolean, PeerConnectionFactory_nativeStartRtcEventLog) -(JNIEnv* jni, - jclass, - jlong native_factory, - jint file, - jint filesize_limit_bytes) { - rtc::scoped_refptr factory( - factoryFromJava(native_factory)); - return factory->StartRtcEventLog(file, filesize_limit_bytes); -} - -JOW(void, PeerConnectionFactory_nativeStopRtcEventLog)( - JNIEnv* jni, jclass, jlong native_factory) { - rtc::scoped_refptr factory( - factoryFromJava(native_factory)); - factory->StopRtcEventLog(); -} - JOW(void, PeerConnectionFactory_nativeSetOptions)( JNIEnv* jni, jclass, jlong native_factory, jobject options) { rtc::scoped_refptr factory( @@ -1914,6 +1896,16 @@ JOW(bool, PeerConnection_nativeGetStats)( PeerConnectionInterface::kStatsOutputLevelStandard); } +JOW(bool, PeerConnection_nativeStartRtcEventLog)( + JNIEnv* jni, jobject j_pc, int file_descriptor, int max_size_bytes) { + return ExtractNativePC(jni, j_pc)->StartRtcEventLog(file_descriptor, + max_size_bytes); +} + +JOW(void, PeerConnection_nativeStopRtcEventLog)(JNIEnv* jni, jobject j_pc) { + ExtractNativePC(jni, j_pc)->StopRtcEventLog(); +} + JOW(jobject, PeerConnection_signalingState)(JNIEnv* jni, jobject j_pc) { PeerConnectionInterface::SignalingState state = ExtractNativePC(jni, j_pc)->signaling_state();