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

Unified Diff: webrtc/api/androidtests/src/org/webrtc/PeerConnectionTest.java

Issue 2236323002: Convert PeerConnectionTest to use the new capture APIs. (Closed) Base URL: https://chromium.googlesource.com/external/webrtc.git@master
Patch Set: Don't capture to texture to preserve the original behavior. Created 4 years, 4 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 | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: webrtc/api/androidtests/src/org/webrtc/PeerConnectionTest.java
diff --git a/webrtc/api/androidtests/src/org/webrtc/PeerConnectionTest.java b/webrtc/api/androidtests/src/org/webrtc/PeerConnectionTest.java
index 47806432a893d0ba0a3cb4e1d77b0f8b5cca6821..92c03a2cfce473475d08c56c7ff7f37d906cd625 100644
--- a/webrtc/api/androidtests/src/org/webrtc/PeerConnectionTest.java
+++ b/webrtc/api/androidtests/src/org/webrtc/PeerConnectionTest.java
@@ -567,8 +567,11 @@ public class PeerConnectionTest extends ActivityTestCase {
// We want to use the same camera for offerer & answerer, so create it here
// instead of in addTracksToPC.
- VideoSource videoSource = factory.createVideoSource(
- VideoCapturerAndroid.create("", null), new MediaConstraints());
+ final CameraEnumerator enumerator = new Camera1Enumerator(false /* captureToTexture */);
+ final VideoCapturer videoCapturer =
+ enumerator.createCapturer(enumerator.getDeviceNames()[0], null);
+ final VideoSource videoSource = factory.createVideoSource(videoCapturer);
+ videoCapturer.startCapture(640, 480, 30);
offeringExpectations.expectRenegotiationNeeded();
WeakReference<MediaStream> oLMS = addTracksToPC(
@@ -749,6 +752,8 @@ public class PeerConnectionTest extends ActivityTestCase {
shutdownPC(answeringPC, answeringExpectations);
answeringPC = null;
getMetrics();
+ videoCapturer.stopCapture();
+ videoCapturer.dispose();
videoSource.dispose();
factory.dispose();
System.gc();
@@ -785,8 +790,11 @@ public class PeerConnectionTest extends ActivityTestCase {
// We want to use the same camera for offerer & answerer, so create it here
// instead of in addTracksToPC.
- VideoSource videoSource = factory.createVideoSource(
- VideoCapturerAndroid.create("", null), new MediaConstraints());
+ final CameraEnumerator enumerator = new Camera1Enumerator(false /* captureToTexture */);
+ final VideoCapturer videoCapturer =
+ enumerator.createCapturer(enumerator.getDeviceNames()[0], null);
+ final VideoSource videoSource = factory.createVideoSource(videoCapturer);
+ videoCapturer.startCapture(640, 480, 30);
// Add offerer media stream.
offeringExpectations.expectRenegotiationNeeded();
@@ -1016,6 +1024,8 @@ public class PeerConnectionTest extends ActivityTestCase {
answeringPC = null;
offererVideoTrack.dispose();
offererAudioTrack.dispose();
+ videoCapturer.stopCapture();
+ videoCapturer.dispose();
videoSource.dispose();
factory.dispose();
System.gc();
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698