OLD | NEW |
1 /* | 1 /* |
2 * Copyright 2013 The WebRTC project authors. All Rights Reserved. | 2 * Copyright 2013 The WebRTC project authors. All Rights Reserved. |
3 * | 3 * |
4 * Use of this source code is governed by a BSD-style license | 4 * Use of this source code is governed by a BSD-style license |
5 * that can be found in the LICENSE file in the root of the source | 5 * that can be found in the LICENSE file in the root of the source |
6 * tree. An additional intellectual property rights grant can be found | 6 * tree. An additional intellectual property rights grant can be found |
7 * in the file PATENTS. All contributing project authors may | 7 * in the file PATENTS. All contributing project authors may |
8 * be found in the AUTHORS file in the root of the source tree. | 8 * be found in the AUTHORS file in the root of the source tree. |
9 */ | 9 */ |
10 | 10 |
11 package org.webrtc; | 11 package org.webrtc; |
12 | 12 |
13 import java.util.List; | 13 import java.util.List; |
14 | 14 |
15 /** | 15 /** |
16 * Java wrapper for a C++ PeerConnectionFactoryInterface. Main entry point to | 16 * Java wrapper for a C++ PeerConnectionFactoryInterface. Main entry point to |
17 * the PeerConnection API for clients. | 17 * the PeerConnection API for clients. |
18 */ | 18 */ |
19 public class PeerConnectionFactory { | 19 public class PeerConnectionFactory { |
20 private static volatile boolean nativeLibLoaded; | 20 private static volatile boolean nativeLibLoaded; |
21 | 21 |
22 static { | 22 static { |
| 23 String libraryName = "jingle_peerconnection_so"; |
23 try { | 24 try { |
24 System.loadLibrary("jingle_peerconnection_so"); | 25 Class.forName("org.webrtc.PeerConnectionLibraryDataChannelOnly"); |
| 26 libraryName = "jingle_peerconnection_datachannel_only.so"; |
| 27 } catch (Exception e) { |
| 28 System.out.println("Failed to load jingle_peerconnection_datachannel_only_
so."); |
| 29 } |
| 30 |
| 31 try { |
| 32 System.loadLibrary(libraryName); |
25 nativeLibLoaded = true; | 33 nativeLibLoaded = true; |
26 } catch (UnsatisfiedLinkError t) { | 34 } catch (UnsatisfiedLinkError t) { |
27 nativeLibLoaded = false; | 35 nativeLibLoaded = false; |
28 } | 36 } |
29 } | 37 } |
30 | 38 |
31 private static final String TAG = "PeerConnectionFactory"; | 39 private static final String TAG = "PeerConnectionFactory"; |
32 private final long nativeFactory; | 40 private final long nativeFactory; |
33 private static Thread networkThread; | 41 private static Thread networkThread; |
34 private static Thread workerThread; | 42 private static Thread workerThread; |
(...skipping 234 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
269 | 277 |
270 @Deprecated public native void nativeSetOptions(long nativeFactory, Options op
tions); | 278 @Deprecated public native void nativeSetOptions(long nativeFactory, Options op
tions); |
271 | 279 |
272 private static native void nativeSetVideoHwAccelerationOptions( | 280 private static native void nativeSetVideoHwAccelerationOptions( |
273 long nativeFactory, Object localEGLContext, Object remoteEGLContext); | 281 long nativeFactory, Object localEGLContext, Object remoteEGLContext); |
274 | 282 |
275 private static native void nativeThreadsCallbacks(long nativeFactory); | 283 private static native void nativeThreadsCallbacks(long nativeFactory); |
276 | 284 |
277 private static native void nativeFreeFactory(long nativeFactory); | 285 private static native void nativeFreeFactory(long nativeFactory); |
278 } | 286 } |
OLD | NEW |