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

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

Issue 1690073002: Revert of Android: Remove VideoCapturer (Closed) Base URL: https://chromium.googlesource.com/external/webrtc.git@master
Patch Set: Created 4 years, 10 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 | webrtc/api/java/android/org/webrtc/VideoCapturerAndroid.java » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: webrtc/api/androidtests/src/org/webrtc/VideoCapturerAndroidTestFixtures.java
diff --git a/webrtc/api/androidtests/src/org/webrtc/VideoCapturerAndroidTestFixtures.java b/webrtc/api/androidtests/src/org/webrtc/VideoCapturerAndroidTestFixtures.java
index c20ea2a6ffa85511515941a6f5a4ce7892d3329a..4b41611032dd0f17e1be379932b1f6eea7f4d4b0 100644
--- a/webrtc/api/androidtests/src/org/webrtc/VideoCapturerAndroidTestFixtures.java
+++ b/webrtc/api/androidtests/src/org/webrtc/VideoCapturerAndroidTestFixtures.java
@@ -223,7 +223,7 @@
static public void release(VideoCapturerAndroid capturer) {
assertNotNull(capturer);
- capturer.release();
+ capturer.dispose();
assertTrue(capturer.isReleased());
}
@@ -297,8 +297,9 @@
if (capturer.isCapturingToTexture()) {
capturer.surfaceHelper.returnTextureFrame();
}
- release(capturer);
-
+ capturer.dispose();
+
+ assertTrue(capturer.isReleased());
assertTrue(events.onCameraOpeningCalled);
assertTrue(events.onFirstFrameAvailableCalled);
}
@@ -323,7 +324,8 @@
capturer.onOutputFormatRequest(640, 480, 15);
capturer.changeCaptureFormat(640, 480, 15);
- release(capturer);
+ capturer.dispose();
+ assertTrue(capturer.isReleased());
}
static public void stopRestartVideoSource(VideoCapturerAndroid capturer)
@@ -382,7 +384,8 @@
capturer.surfaceHelper.returnTextureFrame();
}
}
- release(capturer);
+ capturer.dispose();
+ assertTrue(capturer.isReleased());
}
static void waitUntilIdle(VideoCapturerAndroid capturer) throws InterruptedException {
@@ -397,9 +400,10 @@
static public void startWhileCameraIsAlreadyOpen(
VideoCapturerAndroid capturer, Context appContext) throws InterruptedException {
+ Camera camera = Camera.open(capturer.getCurrentCameraId());
+
final List<CaptureFormat> formats = capturer.getSupportedFormats();
final CameraEnumerationAndroid.CaptureFormat format = formats.get(0);
- Camera camera = Camera.open(capturer.getCurrentCameraId());
final FakeCapturerObserver observer = new FakeCapturerObserver();
capturer.startCapture(format.width, format.height, format.maxFramerate,
@@ -413,15 +417,16 @@
assertFalse(observer.WaitForCapturerToStart());
}
- release(capturer);
+ capturer.dispose();
camera.release();
}
static public void startWhileCameraIsAlreadyOpenAndCloseCamera(
VideoCapturerAndroid capturer, Context appContext) throws InterruptedException {
+ Camera camera = Camera.open(capturer.getCurrentCameraId());
+
final List<CaptureFormat> formats = capturer.getSupportedFormats();
final CameraEnumerationAndroid.CaptureFormat format = formats.get(0);
- Camera camera = Camera.open(capturer.getCurrentCameraId());
final FakeCapturerObserver observer = new FakeCapturerObserver();
capturer.startCapture(format.width, format.height, format.maxFramerate,
@@ -437,20 +442,22 @@
if (capturer.isCapturingToTexture()) {
capturer.surfaceHelper.returnTextureFrame();
}
- release(capturer);
+ capturer.dispose();
+ assertTrue(capturer.isReleased());
}
static public void startWhileCameraIsAlreadyOpenAndStop(
VideoCapturerAndroid capturer, Context appContext) throws InterruptedException {
+ Camera camera = Camera.open(capturer.getCurrentCameraId());
final List<CaptureFormat> formats = capturer.getSupportedFormats();
final CameraEnumerationAndroid.CaptureFormat format = formats.get(0);
- Camera camera = Camera.open(capturer.getCurrentCameraId());
final FakeCapturerObserver observer = new FakeCapturerObserver();
capturer.startCapture(format.width, format.height, format.maxFramerate,
appContext, observer);
capturer.stopCapture();
- release(capturer);
+ capturer.dispose();
+ assertTrue(capturer.isReleased());
camera.release();
}
@@ -486,7 +493,8 @@
capturer.surfaceHelper.returnTextureFrame();
}
- release(capturer);
+ capturer.dispose();
+ assertTrue(capturer.isReleased());
}
static public void returnBufferLateEndToEnd(VideoCapturerAndroid capturer)
@@ -545,7 +553,8 @@
capturer.surfaceHelper.returnTextureFrame();
}
- release(capturer);
+ capturer.dispose();
+ assertTrue(capturer.isReleased());
}
static public void scaleCameraOutput(VideoCapturerAndroid capturer) throws InterruptedException {
« no previous file with comments | « no previous file | webrtc/api/java/android/org/webrtc/VideoCapturerAndroid.java » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698