Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1285)

Unified Diff: webrtc/sdk/android/api/org/webrtc/PeerConnectionFactoryDatachannelOnly.java

Issue 2767643002: Enable the Java wrapper to load different .so library.
Patch Set: Add static method to the subclass to solve the linking error. Created 3 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: webrtc/sdk/android/api/org/webrtc/PeerConnectionFactoryDatachannelOnly.java
diff --git a/webrtc/sdk/android/api/org/webrtc/PeerConnectionFactoryDatachannelOnly.java b/webrtc/sdk/android/api/org/webrtc/PeerConnectionFactoryDatachannelOnly.java
new file mode 100644
index 0000000000000000000000000000000000000000..f3629d3a350f10bb166319a5e4ee15009b7d9a8e
--- /dev/null
+++ b/webrtc/sdk/android/api/org/webrtc/PeerConnectionFactoryDatachannelOnly.java
@@ -0,0 +1,76 @@
+/*
+ * Copyright 2017 The WebRTC project authors. All Rights Reserved.
+ *
+ * Use of this source code is governed by a BSD-style license
+ * that can be found in the LICENSE file in the root of the source
+ * tree. An additional intellectual property rights grant can be found
+ * in the file PATENTS. All contributing project authors may
+ * be found in the AUTHORS file in the root of the source tree.
+ */
+
+package org.webrtc;
+
+import java.util.List;
+
+/**
+ * The subclass of PeerConnectionFactoryBase loading with the datachannel only shared library
+ * support. Main entry point to the PeerConnection API for clients.
+ */
+public class PeerConnectionFactoryDatachannelOnly extends PeerConnectionFactoryBase {
Taylor Brandstetter 2017/05/11 10:17:11 Could the class still be called "PeerConnectionFac
+ static {
+ try {
+ System.loadLibrary("jingle_peerconnection_datachannel_only_so");
Taylor Brandstetter 2017/05/11 10:17:11 Is the only difference this line of code? If so, w
+ nativeLibLoaded = true;
+ } catch (UnsatisfiedLinkError t) {
+ nativeLibLoaded = false;
+ }
+ }
+
+ // Must be called at least once before creating a PeerConnectionFactory
+ // (for example, at application startup time).
+ public static void initializeAndroidGlobals(
+ android.content.Context context, boolean videoHwAcceleration) {
+ PeerConnectionFactoryBase.initializeAndroidGlobals(context, videoHwAcceleration);
+ }
+ // Field trial initialization. Must be called before PeerConnectionFactory
+ // is created.
+ public static void initializeFieldTrials(String fieldTrialsInitString) {
+ PeerConnectionFactoryBase.initializeFieldTrials(fieldTrialsInitString);
+ }
+ // Wrapper of webrtc::field_trial::FindFullName. Develop the feature with default behaviour off.
+ // Example usage:
+ // if (PeerConnectionFactory.fieldTrialsFindFullName("WebRTCExperiment").equals("Enabled")) {
+ // method1();
+ // } else {
+ // method2();
+ // }
+ public static String fieldTrialsFindFullName(String name) {
+ return PeerConnectionFactoryBase.fieldTrialsFindFullName(name);
+ }
+ // Internal tracing initialization. Must be called before PeerConnectionFactory is created to
+ // prevent racing with tracing code.
+ public static void initializeInternalTracer() {
+ PeerConnectionFactoryBase.initializeInternalTracer();
+ }
+ // Internal tracing shutdown, called to prevent resource leaks. Must be called after
+ // PeerConnectionFactory is gone to prevent races with code performing tracing.
+ public static void shutdownInternalTracer() {
+ PeerConnectionFactoryBase.shutdownInternalTracer();
+ }
+ // Start/stop internal capturing of internal tracing.
+ public static boolean startInternalTracingCapture(String tracing_filename) {
+ return PeerConnectionFactoryBase.startInternalTracingCapture(tracing_filename);
+ }
+ public static void stopInternalTracingCapture() {
+ PeerConnectionFactoryBase.stopInternalTracingCapture();
+ }
+
+ @Deprecated
+ public PeerConnectionFactoryDatachannelOnly() {
+ super();
+ }
+
+ public PeerConnectionFactoryDatachannelOnly(Options options) {
+ super(options);
+ }
+}

Powered by Google App Engine
This is Rietveld 408576698