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

Unified Diff: webrtc/examples/androidtests/src/org/appspot/apprtc/test/PeerConnectionClientTest.java

Issue 2077663003: Camera2 in AppRTC Android Demo. (Closed) Base URL: https://chromium.googlesource.com/external/webrtc.git@camera2_only
Patch Set: Create peer connection factory with the target context in the test Created 4 years, 5 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
« no previous file with comments | « webrtc/examples/androidapp/src/org/appspot/apprtc/SettingsActivity.java ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: webrtc/examples/androidtests/src/org/appspot/apprtc/test/PeerConnectionClientTest.java
diff --git a/webrtc/examples/androidtests/src/org/appspot/apprtc/test/PeerConnectionClientTest.java b/webrtc/examples/androidtests/src/org/appspot/apprtc/test/PeerConnectionClientTest.java
index 9c5be14dd855c285eb1eaab04f3be1af16a7c835..c8f0f55dc762a4c0400c1e4c21853de2edd0c00c 100644
--- a/webrtc/examples/androidtests/src/org/appspot/apprtc/test/PeerConnectionClientTest.java
+++ b/webrtc/examples/androidtests/src/org/appspot/apprtc/test/PeerConnectionClientTest.java
@@ -10,18 +10,17 @@
package org.appspot.apprtc.test;
-import java.util.LinkedList;
-import java.util.List;
-import java.util.concurrent.CountDownLatch;
-import java.util.concurrent.Executor;
-import java.util.concurrent.ExecutorService;
-import java.util.concurrent.Executors;
-import java.util.concurrent.TimeUnit;
-
import org.appspot.apprtc.AppRTCClient.SignalingParameters;
import org.appspot.apprtc.PeerConnectionClient;
import org.appspot.apprtc.PeerConnectionClient.PeerConnectionEvents;
import org.appspot.apprtc.PeerConnectionClient.PeerConnectionParameters;
+
+import android.os.Build;
+import android.test.InstrumentationTestCase;
+import android.test.suitebuilder.annotation.SmallTest;
+import android.util.Log;
+
+import org.webrtc.Camera2Enumerator;
import org.webrtc.EglBase;
import org.webrtc.IceCandidate;
import org.webrtc.MediaCodecVideoEncoder;
@@ -31,10 +30,13 @@ import org.webrtc.SessionDescription;
import org.webrtc.StatsReport;
import org.webrtc.VideoRenderer;
-import android.os.Build;
-import android.test.InstrumentationTestCase;
-import android.test.suitebuilder.annotation.SmallTest;
-import android.util.Log;
+import java.util.LinkedList;
+import java.util.List;
+import java.util.concurrent.CountDownLatch;
+import java.util.concurrent.Executor;
+import java.util.concurrent.ExecutorService;
+import java.util.concurrent.Executors;
+import java.util.concurrent.TimeUnit;
public class PeerConnectionClientTest extends InstrumentationTestCase
implements PeerConnectionEvents {
@@ -254,7 +256,7 @@ public class PeerConnectionClientTest extends InstrumentationTestCase
options.disableNetworkMonitor = true;
client.setPeerConnectionFactoryOptions(options);
client.createPeerConnectionFactory(
- getInstrumentation().getContext(), peerConnectionParameters, this);
+ getInstrumentation().getTargetContext(), peerConnectionParameters, this);
client.createPeerConnection(eglContext, localRenderer, remoteRenderer, signalingParameters);
client.createOffer();
return client;
@@ -267,6 +269,7 @@ public class PeerConnectionClientTest extends InstrumentationTestCase
true, /* loopback */
false, /* tracing */
// Video codec parameters.
+ true, /* useCamera2 */
0, /* videoWidth */
0, /* videoHeight */
0, /* videoFps */
@@ -286,12 +289,15 @@ public class PeerConnectionClientTest extends InstrumentationTestCase
private PeerConnectionParameters createParametersForVideoCall(
String videoCodec, boolean captureToTexture) {
+ final boolean useCamera2 = captureToTexture && Camera2Enumerator.isSupported();
+
PeerConnectionParameters peerConnectionParameters =
new PeerConnectionParameters(
true, /* videoCallEnabled */
true, /* loopback */
false, /* tracing */
// Video codec parameters.
+ useCamera2, /* useCamera2 */
0, /* videoWidth */
0, /* videoHeight */
0, /* videoFps */
« no previous file with comments | « webrtc/examples/androidapp/src/org/appspot/apprtc/SettingsActivity.java ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698