Add a method for getting the native factory from PeerConnectionFactory.

Bug: webrtc:8662
Change-Id: Icfe09e82737e1b700e469afde00c4f0923bbeb42
Reviewed-on: https://webrtc-review.googlesource.com/39516
Reviewed-by: Anders Carlsson <andersc@webrtc.org>
Commit-Queue: Sami Kalliomäki <sakal@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#21628}
This commit is contained in:
Sami Kalliomäki
2018-01-15 14:22:53 +01:00
committed by Commit Bot
parent c4f18fed26
commit 6f247e944c
2 changed files with 13 additions and 0 deletions

View File

@ -342,6 +342,11 @@ public class PeerConnectionFactory {
nativeInvokeThreadsCallbacks(nativeFactory); nativeInvokeThreadsCallbacks(nativeFactory);
} }
/** Returns a pointer to the native webrtc::PeerConnectionFactoryInterface. */
public long getNativePeerConnectionFactory() {
return nativeGetNativePeerConnectionFactory(nativeFactory);
}
private static void printStackTrace(Thread thread, String threadName) { private static void printStackTrace(Thread thread, String threadName) {
if (thread != null) { if (thread != null) {
StackTraceElement[] stackTraces = thread.getStackTrace(); StackTraceElement[] stackTraces = thread.getStackTrace();
@ -415,4 +420,5 @@ public class PeerConnectionFactory {
long factory, Object localEGLContext, Object remoteEGLContext); long factory, Object localEGLContext, Object remoteEGLContext);
private static native void nativeInvokeThreadsCallbacks(long factory); private static native void nativeInvokeThreadsCallbacks(long factory);
private static native void nativeFreeFactory(long factory); private static native void nativeFreeFactory(long factory);
private static native long nativeGetNativePeerConnectionFactory(long factory);
} }

View File

@ -490,5 +490,12 @@ static void JNI_PeerConnectionFactory_SetVideoHwAccelerationOptions(
remote_egl_context); remote_egl_context);
} }
static jlong JNI_PeerConnectionFactory_GetNativePeerConnectionFactory(
JNIEnv* jni,
const JavaParamRef<jclass>&,
jlong native_factory) {
return jlongFromPointer(factoryFromJava(native_factory));
}
} // namespace jni } // namespace jni
} // namespace webrtc } // namespace webrtc