OLD | NEW |
1 /* | 1 /* |
2 * libjingle | 2 * libjingle |
3 * Copyright 2015 Google Inc. | 3 * Copyright 2015 Google Inc. |
4 * | 4 * |
5 * Redistribution and use in source and binary forms, with or without | 5 * Redistribution and use in source and binary forms, with or without |
6 * modification, are permitted provided that the following conditions are met: | 6 * modification, are permitted provided that the following conditions are met: |
7 * | 7 * |
8 * 1. Redistributions of source code must retain the above copyright notice, | 8 * 1. Redistributions of source code must retain the above copyright notice, |
9 * this list of conditions and the following disclaimer. | 9 * this list of conditions and the following disclaimer. |
10 * 2. Redistributions in binary form must reproduce the above copyright notice, | 10 * 2. Redistributions in binary form must reproduce the above copyright notice, |
(...skipping 89 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
100 @SmallTest | 100 @SmallTest |
101 // This test that the camera can be started and that the frames are forwarded | 101 // This test that the camera can be started and that the frames are forwarded |
102 // to a Java video renderer using a "default" capturer. | 102 // to a Java video renderer using a "default" capturer. |
103 // It tests both the Java and the C++ layer. | 103 // It tests both the Java and the C++ layer. |
104 public void testStartVideoCapturer() throws InterruptedException { | 104 public void testStartVideoCapturer() throws InterruptedException { |
105 VideoCapturerAndroid capturer = | 105 VideoCapturerAndroid capturer = |
106 VideoCapturerAndroid.create("", null); | 106 VideoCapturerAndroid.create("", null); |
107 VideoCapturerAndroidTestFixtures.startCapturerAndRender(capturer); | 107 VideoCapturerAndroidTestFixtures.startCapturerAndRender(capturer); |
108 } | 108 } |
109 | 109 |
110 // TODO(perkj): Enable once VideoCapture to texture support has landed in C++. | |
111 @SmallTest | 110 @SmallTest |
112 public void DISABLED_testStartVideoCapturerUsingTextures() throws InterruptedE
xception { | 111 public void testStartVideoCapturerUsingTextures() throws InterruptedException
{ |
113 VideoCapturerAndroid capturer = | 112 VideoCapturerAndroid capturer = |
114 VideoCapturerAndroid.create("", null, EGL10.EGL_NO_CONTEXT); | 113 VideoCapturerAndroid.create("", null, EGL10.EGL_NO_CONTEXT); |
115 VideoCapturerAndroidTestFixtures.startCapturerAndRender(capturer); | 114 VideoCapturerAndroidTestFixtures.startCapturerAndRender(capturer); |
116 } | 115 } |
117 | 116 |
118 @SmallTest | 117 @SmallTest |
119 // This test that the camera can be started and that the frames are forwarded | 118 // This test that the camera can be started and that the frames are forwarded |
120 // to a Java video renderer using the front facing video capturer. | 119 // to a Java video renderer using the front facing video capturer. |
121 // It tests both the Java and the C++ layer. | 120 // It tests both the Java and the C++ layer. |
122 public void testStartFrontFacingVideoCapturer() throws InterruptedException { | 121 public void testStartFrontFacingVideoCapturer() throws InterruptedException { |
(...skipping 20 matching lines...) Expand all Loading... |
143 | 142 |
144 @SmallTest | 143 @SmallTest |
145 // This test that the default camera can be started and that the camera can | 144 // This test that the default camera can be started and that the camera can |
146 // later be switched to another camera. | 145 // later be switched to another camera. |
147 // It tests both the Java and the C++ layer. | 146 // It tests both the Java and the C++ layer. |
148 public void testSwitchVideoCapturer() throws InterruptedException { | 147 public void testSwitchVideoCapturer() throws InterruptedException { |
149 VideoCapturerAndroid capturer = VideoCapturerAndroid.create("", null); | 148 VideoCapturerAndroid capturer = VideoCapturerAndroid.create("", null); |
150 VideoCapturerAndroidTestFixtures.switchCamera(capturer); | 149 VideoCapturerAndroidTestFixtures.switchCamera(capturer); |
151 } | 150 } |
152 | 151 |
153 // TODO(perkj): Enable once VideoCapture to texture support has landed in C++. | |
154 @SmallTest | 152 @SmallTest |
155 public void DISABLED_testSwitchVideoCapturerUsingTextures() throws Interrupted
Exception { | 153 public void testSwitchVideoCapturerUsingTextures() throws InterruptedException
{ |
156 VideoCapturerAndroid capturer = VideoCapturerAndroid.create("", null, EGL10.
EGL_NO_CONTEXT); | 154 VideoCapturerAndroid capturer = VideoCapturerAndroid.create("", null, EGL10.
EGL_NO_CONTEXT); |
157 VideoCapturerAndroidTestFixtures.switchCamera(capturer); | 155 VideoCapturerAndroidTestFixtures.switchCamera(capturer); |
158 } | 156 } |
159 | 157 |
160 @MediumTest | 158 @MediumTest |
161 public void testCameraEvents() throws InterruptedException { | 159 public void testCameraEvents() throws InterruptedException { |
162 VideoCapturerAndroidTestFixtures.CameraEvents cameraEvents = | 160 VideoCapturerAndroidTestFixtures.CameraEvents cameraEvents = |
163 VideoCapturerAndroidTestFixtures.createCameraEvents(); | 161 VideoCapturerAndroidTestFixtures.createCameraEvents(); |
164 VideoCapturerAndroid capturer = VideoCapturerAndroid.create("", cameraEvents
); | 162 VideoCapturerAndroid capturer = VideoCapturerAndroid.create("", cameraEvents
); |
165 VideoCapturerAndroidTestFixtures.cameraEventsInvoked( | 163 VideoCapturerAndroidTestFixtures.cameraEventsInvoked( |
(...skipping 21 matching lines...) Expand all Loading... |
187 } | 185 } |
188 | 186 |
189 @SmallTest | 187 @SmallTest |
190 // This test that the VideoSource that the VideoCapturer is connected to can | 188 // This test that the VideoSource that the VideoCapturer is connected to can |
191 // be stopped and restarted. It tests both the Java and the C++ layer. | 189 // be stopped and restarted. It tests both the Java and the C++ layer. |
192 public void testStopRestartVideoSource() throws InterruptedException { | 190 public void testStopRestartVideoSource() throws InterruptedException { |
193 VideoCapturerAndroid capturer = VideoCapturerAndroid.create("", null); | 191 VideoCapturerAndroid capturer = VideoCapturerAndroid.create("", null); |
194 VideoCapturerAndroidTestFixtures.stopRestartVideoSource(capturer); | 192 VideoCapturerAndroidTestFixtures.stopRestartVideoSource(capturer); |
195 } | 193 } |
196 | 194 |
197 // TODO(perkj): Enable once VideoCapture to texture support has landed in C++. | |
198 @SmallTest | 195 @SmallTest |
199 public void DISABLED_testStopRestartVideoSourceUsingTextures() throws Interrup
tedException { | 196 public void testStopRestartVideoSourceUsingTextures() throws InterruptedExcept
ion { |
200 VideoCapturerAndroid capturer = VideoCapturerAndroid.create("", null, EGL10.
EGL_NO_CONTEXT); | 197 VideoCapturerAndroid capturer = VideoCapturerAndroid.create("", null, EGL10.
EGL_NO_CONTEXT); |
201 VideoCapturerAndroidTestFixtures.stopRestartVideoSource(capturer); | 198 VideoCapturerAndroidTestFixtures.stopRestartVideoSource(capturer); |
202 } | 199 } |
203 | 200 |
204 @SmallTest | 201 @SmallTest |
205 // This test that the camera can be started at different resolutions. | 202 // This test that the camera can be started at different resolutions. |
206 // It does not test or use the C++ layer. | 203 // It does not test or use the C++ layer. |
207 public void testStartStopWithDifferentResolutions() throws InterruptedExceptio
n { | 204 public void testStartStopWithDifferentResolutions() throws InterruptedExceptio
n { |
208 String deviceName = CameraEnumerationAndroid.getDeviceName(0); | 205 String deviceName = CameraEnumerationAndroid.getDeviceName(0); |
209 VideoCapturerAndroid capturer = | 206 VideoCapturerAndroid capturer = |
(...skipping 68 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
278 | 275 |
279 @MediumTest | 276 @MediumTest |
280 // This test that we can capture frames, keep the frames in a local renderer,
stop capturing, | 277 // This test that we can capture frames, keep the frames in a local renderer,
stop capturing, |
281 // and then return the frames. The difference between the test testReturnBuffe
rLate() is that we | 278 // and then return the frames. The difference between the test testReturnBuffe
rLate() is that we |
282 // also test the JNI and C++ AndroidVideoCapturer parts. | 279 // also test the JNI and C++ AndroidVideoCapturer parts. |
283 public void testReturnBufferLateEndToEnd() throws InterruptedException { | 280 public void testReturnBufferLateEndToEnd() throws InterruptedException { |
284 final VideoCapturerAndroid capturer = VideoCapturerAndroid.create("", null); | 281 final VideoCapturerAndroid capturer = VideoCapturerAndroid.create("", null); |
285 VideoCapturerAndroidTestFixtures.returnBufferLateEndToEnd(capturer); | 282 VideoCapturerAndroidTestFixtures.returnBufferLateEndToEnd(capturer); |
286 } | 283 } |
287 | 284 |
288 // TODO(perkj): Enable once VideoCapture to texture support has landed in C++. | |
289 @MediumTest | 285 @MediumTest |
290 public void DISABLED_testReturnBufferLateEndToEndUsingTextures() throws Interr
uptedException { | 286 public void testReturnBufferLateEndToEndUsingTextures() throws InterruptedExce
ption { |
291 final VideoCapturerAndroid capturer = | 287 final VideoCapturerAndroid capturer = |
292 VideoCapturerAndroid.create("", null, EGL10.EGL_NO_CONTEXT); | 288 VideoCapturerAndroid.create("", null, EGL10.EGL_NO_CONTEXT); |
293 VideoCapturerAndroidTestFixtures.returnBufferLateEndToEnd(capturer); | 289 VideoCapturerAndroidTestFixtures.returnBufferLateEndToEnd(capturer); |
294 } | 290 } |
295 | 291 |
296 @MediumTest | 292 @MediumTest |
297 // This test that CameraEventsHandler.onError is triggered if video buffers ar
e not returned to | 293 // This test that CameraEventsHandler.onError is triggered if video buffers ar
e not returned to |
298 // the capturer. | 294 // the capturer. |
299 public void testCameraErrorEventOnBufferStarvation() throws InterruptedExcepti
on { | 295 public void testCameraErrorEventOnBufferStarvation() throws InterruptedExcepti
on { |
300 VideoCapturerAndroidTestFixtures.CameraEvents cameraEvents = | 296 VideoCapturerAndroidTestFixtures.CameraEvents cameraEvents = |
301 VideoCapturerAndroidTestFixtures.createCameraEvents(); | 297 VideoCapturerAndroidTestFixtures.createCameraEvents(); |
302 VideoCapturerAndroid capturer = VideoCapturerAndroid.create("", cameraEvents
); | 298 VideoCapturerAndroid capturer = VideoCapturerAndroid.create("", cameraEvents
); |
303 VideoCapturerAndroidTestFixtures.cameraErrorEventOnBufferStarvation(capturer
, | 299 VideoCapturerAndroidTestFixtures.cameraErrorEventOnBufferStarvation(capturer
, |
304 cameraEvents, getInstrumentation().getContext()); | 300 cameraEvents, getInstrumentation().getContext()); |
305 } | 301 } |
306 } | 302 } |
OLD | NEW |