| 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 4b41611032dd0f17e1be379932b1f6eea7f4d4b0..c20ea2a6ffa85511515941a6f5a4ce7892d3329a 100644
|
| --- a/webrtc/api/androidtests/src/org/webrtc/VideoCapturerAndroidTestFixtures.java
|
| +++ b/webrtc/api/androidtests/src/org/webrtc/VideoCapturerAndroidTestFixtures.java
|
| @@ -223,7 +223,7 @@ public class VideoCapturerAndroidTestFixtures {
|
|
|
| static public void release(VideoCapturerAndroid capturer) {
|
| assertNotNull(capturer);
|
| - capturer.dispose();
|
| + capturer.release();
|
| assertTrue(capturer.isReleased());
|
| }
|
|
|
| @@ -297,9 +297,8 @@ public class VideoCapturerAndroidTestFixtures {
|
| if (capturer.isCapturingToTexture()) {
|
| capturer.surfaceHelper.returnTextureFrame();
|
| }
|
| - capturer.dispose();
|
| + release(capturer);
|
|
|
| - assertTrue(capturer.isReleased());
|
| assertTrue(events.onCameraOpeningCalled);
|
| assertTrue(events.onFirstFrameAvailableCalled);
|
| }
|
| @@ -324,8 +323,7 @@ public class VideoCapturerAndroidTestFixtures {
|
| capturer.onOutputFormatRequest(640, 480, 15);
|
| capturer.changeCaptureFormat(640, 480, 15);
|
|
|
| - capturer.dispose();
|
| - assertTrue(capturer.isReleased());
|
| + release(capturer);
|
| }
|
|
|
| static public void stopRestartVideoSource(VideoCapturerAndroid capturer)
|
| @@ -384,8 +382,7 @@ public class VideoCapturerAndroidTestFixtures {
|
| capturer.surfaceHelper.returnTextureFrame();
|
| }
|
| }
|
| - capturer.dispose();
|
| - assertTrue(capturer.isReleased());
|
| + release(capturer);
|
| }
|
|
|
| static void waitUntilIdle(VideoCapturerAndroid capturer) throws InterruptedException {
|
| @@ -400,10 +397,9 @@ public class VideoCapturerAndroidTestFixtures {
|
|
|
| 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,
|
| @@ -417,16 +413,15 @@ public class VideoCapturerAndroidTestFixtures {
|
| assertFalse(observer.WaitForCapturerToStart());
|
| }
|
|
|
| - capturer.dispose();
|
| + release(capturer);
|
| 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,
|
| @@ -442,22 +437,20 @@ public class VideoCapturerAndroidTestFixtures {
|
| if (capturer.isCapturingToTexture()) {
|
| capturer.surfaceHelper.returnTextureFrame();
|
| }
|
| - capturer.dispose();
|
| - assertTrue(capturer.isReleased());
|
| + release(capturer);
|
| }
|
|
|
| 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();
|
| - capturer.dispose();
|
| - assertTrue(capturer.isReleased());
|
| + release(capturer);
|
| camera.release();
|
| }
|
|
|
| @@ -493,8 +486,7 @@ public class VideoCapturerAndroidTestFixtures {
|
| capturer.surfaceHelper.returnTextureFrame();
|
| }
|
|
|
| - capturer.dispose();
|
| - assertTrue(capturer.isReleased());
|
| + release(capturer);
|
| }
|
|
|
| static public void returnBufferLateEndToEnd(VideoCapturerAndroid capturer)
|
| @@ -553,8 +545,7 @@ public class VideoCapturerAndroidTestFixtures {
|
| capturer.surfaceHelper.returnTextureFrame();
|
| }
|
|
|
| - capturer.dispose();
|
| - assertTrue(capturer.isReleased());
|
| + release(capturer);
|
| }
|
|
|
| static public void scaleCameraOutput(VideoCapturerAndroid capturer) throws InterruptedException {
|
|
|