| 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 94 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 105 @SmallTest | 105 @SmallTest |
| 106 // This test that the camera can be started and that the frames are forwarded | 106 // This test that the camera can be started and that the frames are forwarded |
| 107 // to a Java video renderer using a "default" capturer. | 107 // to a Java video renderer using a "default" capturer. |
| 108 // It tests both the Java and the C++ layer. | 108 // It tests both the Java and the C++ layer. |
| 109 public void testStartVideoCapturer() throws InterruptedException { | 109 public void testStartVideoCapturer() throws InterruptedException { |
| 110 VideoCapturerAndroid capturer = | 110 VideoCapturerAndroid capturer = |
| 111 VideoCapturerAndroid.create("", null); | 111 VideoCapturerAndroid.create("", null); |
| 112 VideoCapturerAndroidTestFixtures.startCapturerAndRender(capturer); | 112 VideoCapturerAndroidTestFixtures.startCapturerAndRender(capturer); |
| 113 } | 113 } |
| 114 | 114 |
| 115 // TODO(perkj): Enable once VideoCapture to texture support has landed in C++. |
| 115 @SmallTest | 116 @SmallTest |
| 116 public void testStartVideoCapturerUsingTextures() throws InterruptedException
{ | 117 public void DISABLED_testStartVideoCapturerUsingTextures() throws InterruptedE
xception { |
| 117 if (Build.VERSION.SDK_INT < Build.VERSION_CODES.JELLY_BEAN_MR1) { | 118 if (Build.VERSION.SDK_INT < Build.VERSION_CODES.JELLY_BEAN_MR1) { |
| 118 Log.i(TAG, "Capturing to textures is not supported, requires EGL14."); | 119 Log.i(TAG, "Capturing to textures is not supported, requires EGL14."); |
| 119 return; | 120 return; |
| 120 } | 121 } |
| 121 VideoCapturerAndroid capturer = | 122 VideoCapturerAndroid capturer = |
| 122 VideoCapturerAndroid.create("", null, EGL14.EGL_NO_CONTEXT); | 123 VideoCapturerAndroid.create("", null, EGL14.EGL_NO_CONTEXT); |
| 123 VideoCapturerAndroidTestFixtures.startCapturerAndRender(capturer); | 124 VideoCapturerAndroidTestFixtures.startCapturerAndRender(capturer); |
| 124 } | 125 } |
| 125 | 126 |
| 126 @SmallTest | 127 @SmallTest |
| (...skipping 24 matching lines...) Expand all Loading... |
| 151 | 152 |
| 152 @SmallTest | 153 @SmallTest |
| 153 // This test that the default camera can be started and that the camera can | 154 // This test that the default camera can be started and that the camera can |
| 154 // later be switched to another camera. | 155 // later be switched to another camera. |
| 155 // It tests both the Java and the C++ layer. | 156 // It tests both the Java and the C++ layer. |
| 156 public void testSwitchVideoCapturer() throws InterruptedException { | 157 public void testSwitchVideoCapturer() throws InterruptedException { |
| 157 VideoCapturerAndroid capturer = VideoCapturerAndroid.create("", null); | 158 VideoCapturerAndroid capturer = VideoCapturerAndroid.create("", null); |
| 158 VideoCapturerAndroidTestFixtures.switchCamera(capturer); | 159 VideoCapturerAndroidTestFixtures.switchCamera(capturer); |
| 159 } | 160 } |
| 160 | 161 |
| 162 // TODO(perkj): Enable once VideoCapture to texture support has landed in C++. |
| 161 @SmallTest | 163 @SmallTest |
| 162 public void testSwitchVideoCapturerUsingTextures() throws InterruptedException
{ | 164 public void DISABLED_testSwitchVideoCapturerUsingTextures() throws Interrupted
Exception { |
| 163 if (Build.VERSION.SDK_INT < Build.VERSION_CODES.JELLY_BEAN_MR1) { | 165 if (Build.VERSION.SDK_INT < Build.VERSION_CODES.JELLY_BEAN_MR1) { |
| 164 Log.i(TAG, "Capturing to textures is not supported, requires EGL14."); | 166 Log.i(TAG, "Capturing to textures is not supported, requires EGL14."); |
| 165 return; | 167 return; |
| 166 } | 168 } |
| 167 VideoCapturerAndroid capturer = VideoCapturerAndroid.create("", null, EGL14.
EGL_NO_CONTEXT); | 169 VideoCapturerAndroid capturer = VideoCapturerAndroid.create("", null, EGL14.
EGL_NO_CONTEXT); |
| 168 VideoCapturerAndroidTestFixtures.switchCamera(capturer); | 170 VideoCapturerAndroidTestFixtures.switchCamera(capturer); |
| 169 } | 171 } |
| 170 | 172 |
| 171 @MediumTest | 173 @MediumTest |
| 172 // Test what happens when attempting to call e.g. switchCamera() after camera
has been stopped. | 174 // Test what happens when attempting to call e.g. switchCamera() after camera
has been stopped. |
| (...skipping 20 matching lines...) Expand all Loading... |
| 193 } | 195 } |
| 194 | 196 |
| 195 @SmallTest | 197 @SmallTest |
| 196 // This test that the VideoSource that the VideoCapturer is connected to can | 198 // This test that the VideoSource that the VideoCapturer is connected to can |
| 197 // be stopped and restarted. It tests both the Java and the C++ layer. | 199 // be stopped and restarted. It tests both the Java and the C++ layer. |
| 198 public void testStopRestartVideoSource() throws InterruptedException { | 200 public void testStopRestartVideoSource() throws InterruptedException { |
| 199 VideoCapturerAndroid capturer = VideoCapturerAndroid.create("", null); | 201 VideoCapturerAndroid capturer = VideoCapturerAndroid.create("", null); |
| 200 VideoCapturerAndroidTestFixtures.stopRestartVideoSource(capturer); | 202 VideoCapturerAndroidTestFixtures.stopRestartVideoSource(capturer); |
| 201 } | 203 } |
| 202 | 204 |
| 205 // TODO(perkj): Enable once VideoCapture to texture support has landed in C++. |
| 203 @SmallTest | 206 @SmallTest |
| 204 public void testStopRestartVideoSourceUsingTextures() throws InterruptedExcept
ion { | 207 public void DISABLED_testStopRestartVideoSourceUsingTextures() throws Interrup
tedException { |
| 205 if (Build.VERSION.SDK_INT < Build.VERSION_CODES.JELLY_BEAN_MR1) { | 208 if (Build.VERSION.SDK_INT < Build.VERSION_CODES.JELLY_BEAN_MR1) { |
| 206 Log.i(TAG, "Capturing to textures is not supported, requires EGL14."); | 209 Log.i(TAG, "Capturing to textures is not supported, requires EGL14."); |
| 207 return; | 210 return; |
| 208 } | 211 } |
| 209 VideoCapturerAndroid capturer = VideoCapturerAndroid.create("", null, EGL14.
EGL_NO_CONTEXT); | 212 VideoCapturerAndroid capturer = VideoCapturerAndroid.create("", null, EGL14.
EGL_NO_CONTEXT); |
| 210 VideoCapturerAndroidTestFixtures.stopRestartVideoSource(capturer); | 213 VideoCapturerAndroidTestFixtures.stopRestartVideoSource(capturer); |
| 211 } | 214 } |
| 212 | 215 |
| 213 @SmallTest | 216 @SmallTest |
| 214 // This test that the camera can be started at different resolutions. | 217 // This test that the camera can be started at different resolutions. |
| (...skipping 45 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 260 | 263 |
| 261 @MediumTest | 264 @MediumTest |
| 262 // This test that we can capture frames, keep the frames in a local renderer,
stop capturing, | 265 // This test that we can capture frames, keep the frames in a local renderer,
stop capturing, |
| 263 // and then return the frames. The difference between the test testReturnBuffe
rLate() is that we | 266 // and then return the frames. The difference between the test testReturnBuffe
rLate() is that we |
| 264 // also test the JNI and C++ AndroidVideoCapturer parts. | 267 // also test the JNI and C++ AndroidVideoCapturer parts. |
| 265 public void testReturnBufferLateEndToEnd() throws InterruptedException { | 268 public void testReturnBufferLateEndToEnd() throws InterruptedException { |
| 266 final VideoCapturerAndroid capturer = VideoCapturerAndroid.create("", null); | 269 final VideoCapturerAndroid capturer = VideoCapturerAndroid.create("", null); |
| 267 VideoCapturerAndroidTestFixtures.returnBufferLateEndToEnd(capturer); | 270 VideoCapturerAndroidTestFixtures.returnBufferLateEndToEnd(capturer); |
| 268 } | 271 } |
| 269 | 272 |
| 273 // TODO(perkj): Enable once VideoCapture to texture support has landed in C++. |
| 270 @MediumTest | 274 @MediumTest |
| 271 public void testReturnBufferLateEndToEndUsingTextures() throws InterruptedExce
ption { | 275 public void DISABLED_testReturnBufferLateEndToEndUsingTextures() throws Interr
uptedException { |
| 272 if (Build.VERSION.SDK_INT < Build.VERSION_CODES.JELLY_BEAN_MR1) { | 276 if (Build.VERSION.SDK_INT < Build.VERSION_CODES.JELLY_BEAN_MR1) { |
| 273 Log.i(TAG, "Capturing to textures is not supported, requires EGL14."); | 277 Log.i(TAG, "Capturing to textures is not supported, requires EGL14."); |
| 274 return; | 278 return; |
| 275 } | 279 } |
| 276 final VideoCapturerAndroid capturer = | 280 final VideoCapturerAndroid capturer = |
| 277 VideoCapturerAndroid.create("", null, EGL14.EGL_NO_CONTEXT); | 281 VideoCapturerAndroid.create("", null, EGL14.EGL_NO_CONTEXT); |
| 278 VideoCapturerAndroidTestFixtures.returnBufferLateEndToEnd(capturer); | 282 VideoCapturerAndroidTestFixtures.returnBufferLateEndToEnd(capturer); |
| 279 } | 283 } |
| 280 } | 284 } |
| OLD | NEW |