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

Unified Diff: webrtc/examples/androidapp/src/org/appspot/apprtc/CallActivity.java

Issue 2077663003: Camera2 in AppRTC Android Demo. (Closed) Base URL: https://chromium.googlesource.com/external/webrtc.git@camera2_only
Patch Set: Rebase. Created 4 years, 6 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/examples/androidapp/src/org/appspot/apprtc/CallActivity.java
diff --git a/webrtc/examples/androidapp/src/org/appspot/apprtc/CallActivity.java b/webrtc/examples/androidapp/src/org/appspot/apprtc/CallActivity.java
index b2537806825fe2d0fff6babb10636e6543e61c48..69500207fe403aa2342fd483d094e0653144ef50 100644
--- a/webrtc/examples/androidapp/src/org/appspot/apprtc/CallActivity.java
+++ b/webrtc/examples/androidapp/src/org/appspot/apprtc/CallActivity.java
@@ -29,6 +29,7 @@ import org.appspot.apprtc.AppRTCClient.RoomConnectionParameters;
import org.appspot.apprtc.AppRTCClient.SignalingParameters;
import org.appspot.apprtc.PeerConnectionClient.PeerConnectionParameters;
import org.appspot.apprtc.util.LooperExecutor;
+import org.webrtc.Camera2Enumerator;
import org.webrtc.EglBase;
import org.webrtc.IceCandidate;
import org.webrtc.PeerConnectionFactory;
@@ -52,6 +53,8 @@ public class CallActivity extends Activity
"org.appspot.apprtc.LOOPBACK";
public static final String EXTRA_VIDEO_CALL =
"org.appspot.apprtc.VIDEO_CALL";
+ public static final String EXTRA_CAMERA2 =
+ "org.appspot.apprtc.CAMERA2";
public static final String EXTRA_VIDEO_WIDTH =
"org.appspot.apprtc.VIDEO_WIDTH";
public static final String EXTRA_VIDEO_HEIGHT =
@@ -219,12 +222,18 @@ public class CallActivity extends Activity
finish();
return;
}
+ String camera2Option = intent.getStringExtra(EXTRA_CAMERA2);
+ boolean camera2Enabled = camera2Option.equals("true") || camera2Option.equals("force");
+ boolean camera1Enabled = !Camera2Enumerator.isSupported() || !camera2Option.equals("force");
magjed_webrtc 2016/06/29 13:36:45 Shouldn't this be just: boolean camera1Enabled = !
sakal 2016/06/30 09:14:52 The option in the settings is disabled if Camera2E
magjed_webrtc 2016/06/30 11:21:47 I think it's an overkill for this demo app to have
+
boolean loopback = intent.getBooleanExtra(EXTRA_LOOPBACK, false);
boolean tracing = intent.getBooleanExtra(EXTRA_TRACING, false);
peerConnectionParameters = new PeerConnectionParameters(
intent.getBooleanExtra(EXTRA_VIDEO_CALL, true),
loopback,
tracing,
+ camera2Enabled,
+ camera1Enabled,
intent.getIntExtra(EXTRA_VIDEO_WIDTH, 0),
intent.getIntExtra(EXTRA_VIDEO_HEIGHT, 0),
intent.getIntExtra(EXTRA_VIDEO_FPS, 0),

Powered by Google App Engine
This is Rietveld 408576698