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

Side by Side Diff: talk/app/webrtc/androidtests/src/org/webrtc/VideoCapturerAndroidTest.java

Issue 1395673003: Native changes for VideoCapturerAndroid surface texture support (Closed) Base URL: https://chromium.googlesource.com/external/webrtc.git@master
Patch Set: Style fixes Created 5 years, 2 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 unified diff | Download patch
OLDNEW
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 85 matching lines...) Expand 10 before | Expand all | Expand 10 after
96 @SmallTest 96 @SmallTest
97 // This test that the camera can be started and that the frames are forwarded 97 // This test that the camera can be started and that the frames are forwarded
98 // to a Java video renderer using a "default" capturer. 98 // to a Java video renderer using a "default" capturer.
99 // It tests both the Java and the C++ layer. 99 // It tests both the Java and the C++ layer.
100 public void testStartVideoCapturer() throws InterruptedException { 100 public void testStartVideoCapturer() throws InterruptedException {
101 VideoCapturerAndroid capturer = 101 VideoCapturerAndroid capturer =
102 VideoCapturerAndroid.create("", null); 102 VideoCapturerAndroid.create("", null);
103 VideoCapturerAndroidTestFixtures.startCapturerAndRender(capturer); 103 VideoCapturerAndroidTestFixtures.startCapturerAndRender(capturer);
104 } 104 }
105 105
106 /* TODO(perkj): Enable once VideoCapture to texture support has landed in C++.
107 @SmallTest 106 @SmallTest
108 public void testStartVideoCapturerUsingTextures() throws InterruptedException { 107 public void testStartVideoCapturerUsingTextures() throws InterruptedException {
109 VideoCapturerAndroid capturer = 108 VideoCapturerAndroid capturer =
110 VideoCapturerAndroid.create("", null, EGL14.EGL_NO_CONTEXT); 109 VideoCapturerAndroid.create("", null, EGL14.EGL_NO_CONTEXT);
111 VideoCapturerAndroidTestFixtures.startCapturerAndRender(capturer); 110 VideoCapturerAndroidTestFixtures.startCapturerAndRender(capturer);
112 }*/ 111 }
113 112
114 @SmallTest 113 @SmallTest
115 // This test that the camera can be started and that the frames are forwarded 114 // This test that the camera can be started and that the frames are forwarded
116 // to a Java video renderer using the front facing video capturer. 115 // to a Java video renderer using the front facing video capturer.
117 // It tests both the Java and the C++ layer. 116 // It tests both the Java and the C++ layer.
118 public void testStartFrontFacingVideoCapturer() throws InterruptedException { 117 public void testStartFrontFacingVideoCapturer() throws InterruptedException {
119 String deviceName = CameraEnumerationAndroid.getNameOfFrontFacingDevice(); 118 String deviceName = CameraEnumerationAndroid.getNameOfFrontFacingDevice();
120 VideoCapturerAndroid capturer = 119 VideoCapturerAndroid capturer =
121 VideoCapturerAndroid.create(deviceName, null); 120 VideoCapturerAndroid.create(deviceName, null);
122 VideoCapturerAndroidTestFixtures.startCapturerAndRender(capturer); 121 VideoCapturerAndroidTestFixtures.startCapturerAndRender(capturer);
(...skipping 16 matching lines...) Expand all
139 138
140 @SmallTest 139 @SmallTest
141 // This test that the default camera can be started and that the camera can 140 // This test that the default camera can be started and that the camera can
142 // later be switched to another camera. 141 // later be switched to another camera.
143 // It tests both the Java and the C++ layer. 142 // It tests both the Java and the C++ layer.
144 public void testSwitchVideoCapturer() throws InterruptedException { 143 public void testSwitchVideoCapturer() throws InterruptedException {
145 VideoCapturerAndroid capturer = VideoCapturerAndroid.create("", null); 144 VideoCapturerAndroid capturer = VideoCapturerAndroid.create("", null);
146 VideoCapturerAndroidTestFixtures.switchCamera(capturer); 145 VideoCapturerAndroidTestFixtures.switchCamera(capturer);
147 } 146 }
148 147
149 /* TODO(perkj): Enable once VideoCapture to texture support has landed in C++.
150 @SmallTest 148 @SmallTest
151 public void testSwitchVideoCapturerUsingTextures() throws InterruptedException { 149 public void testSwitchVideoCapturerUsingTextures() throws InterruptedException {
152 VideoCapturerAndroid capturer = VideoCapturerAndroid.create("", null, EGL14. EGL_NO_CONTEXT); 150 VideoCapturerAndroid capturer = VideoCapturerAndroid.create("", null, EGL14. EGL_NO_CONTEXT);
153 VideoCapturerAndroidTestFixtures.switchCamera(capturer); 151 VideoCapturerAndroidTestFixtures.switchCamera(capturer);
154 }*/ 152 }
155 153
156 @MediumTest 154 @MediumTest
157 // Test what happens when attempting to call e.g. switchCamera() after camera has been stopped. 155 // Test what happens when attempting to call e.g. switchCamera() after camera has been stopped.
158 public void testCameraCallsAfterStop() throws InterruptedException { 156 public void testCameraCallsAfterStop() throws InterruptedException {
159 final String deviceName = CameraEnumerationAndroid.getDeviceName(0); 157 final String deviceName = CameraEnumerationAndroid.getDeviceName(0);
160 final VideoCapturerAndroid capturer = VideoCapturerAndroid.create(deviceName , null); 158 final VideoCapturerAndroid capturer = VideoCapturerAndroid.create(deviceName , null);
161 159
162 VideoCapturerAndroidTestFixtures.cameraCallsAfterStop(capturer, 160 VideoCapturerAndroidTestFixtures.cameraCallsAfterStop(capturer,
163 getInstrumentation().getContext()); 161 getInstrumentation().getContext());
164 } 162 }
165 163
166 @MediumTest 164 @MediumTest
167 public void testCameraCallsAfterStopUsingTextures() throws InterruptedExceptio n { 165 public void testCameraCallsAfterStopUsingTextures() throws InterruptedExceptio n {
168 final String deviceName = CameraEnumerationAndroid.getDeviceName(0); 166 final String deviceName = CameraEnumerationAndroid.getDeviceName(0);
169 final VideoCapturerAndroid capturer = VideoCapturerAndroid.create(deviceName , null, 167 final VideoCapturerAndroid capturer = VideoCapturerAndroid.create(deviceName , null,
170 EGL14.EGL_NO_CONTEXT); 168 EGL14.EGL_NO_CONTEXT);
171 169
172 VideoCapturerAndroidTestFixtures.cameraCallsAfterStop(capturer, 170 VideoCapturerAndroidTestFixtures.cameraCallsAfterStop(capturer,
173 getInstrumentation().getContext()); 171 getInstrumentation().getContext());
174 } 172 }
175 173
176 @SmallTest 174 @SmallTest
177 // This test that the VideoSource that the VideoCapturer is connected to can 175 // This test that the VideoSource that the VideoCapturer is connected to can
178 // be stopped and restarted. It tests both the Java and the C++ layer. 176 // be stopped and restarted. It tests both the Java and the C++ layer.
179 public void testStopRestartVideoSource() throws InterruptedException { 177 public void testStopRestartVideoSource() throws InterruptedException {
180 VideoCapturerAndroid capturer = VideoCapturerAndroid.create("", null); 178 VideoCapturerAndroid capturer = VideoCapturerAndroid.create("", null);
181 VideoCapturerAndroidTestFixtures.stopRestartVideoSource(capturer); 179 VideoCapturerAndroidTestFixtures.stopRestartVideoSource(capturer);
182 } 180 }
183 181
184 /* TODO(perkj): Enable once VideoCapture to texture support has landed in C++.
185 @SmallTest 182 @SmallTest
186 public void testStopRestartVideoSourceUsingTextures() throws InterruptedExcept ion { 183 public void testStopRestartVideoSourceUsingTextures() throws InterruptedExcept ion {
187 VideoCapturerAndroid capturer = VideoCapturerAndroid.create("", null, EGL14. EGL_NO_CONTEXT); 184 VideoCapturerAndroid capturer = VideoCapturerAndroid.create("", null, EGL14. EGL_NO_CONTEXT);
188 VideoCapturerAndroidTestFixtures.stopRestartVideoSource(capturer); 185 VideoCapturerAndroidTestFixtures.stopRestartVideoSource(capturer);
189 }*/ 186 }
190 187
191 @SmallTest 188 @SmallTest
192 // This test that the camera can be started at different resolutions. 189 // This test that the camera can be started at different resolutions.
193 // It does not test or use the C++ layer. 190 // It does not test or use the C++ layer.
194 public void testStartStopWithDifferentResolutions() throws InterruptedExceptio n { 191 public void testStartStopWithDifferentResolutions() throws InterruptedExceptio n {
195 String deviceName = CameraEnumerationAndroid.getDeviceName(0); 192 String deviceName = CameraEnumerationAndroid.getDeviceName(0);
196 VideoCapturerAndroid capturer = 193 VideoCapturerAndroid capturer =
197 VideoCapturerAndroid.create(deviceName, null); 194 VideoCapturerAndroid.create(deviceName, null);
198 VideoCapturerAndroidTestFixtures.startStopWithDifferentResolutions(capturer, 195 VideoCapturerAndroidTestFixtures.startStopWithDifferentResolutions(capturer,
199 getInstrumentation().getContext()); 196 getInstrumentation().getContext());
(...skipping 30 matching lines...) Expand all
230 227
231 @MediumTest 228 @MediumTest
232 // This test that we can capture frames, keep the frames in a local renderer, stop capturing, 229 // This test that we can capture frames, keep the frames in a local renderer, stop capturing,
233 // and then return the frames. The difference between the test testReturnBuffe rLate() is that we 230 // and then return the frames. The difference between the test testReturnBuffe rLate() is that we
234 // also test the JNI and C++ AndroidVideoCapturer parts. 231 // also test the JNI and C++ AndroidVideoCapturer parts.
235 public void testReturnBufferLateEndToEnd() throws InterruptedException { 232 public void testReturnBufferLateEndToEnd() throws InterruptedException {
236 final VideoCapturerAndroid capturer = VideoCapturerAndroid.create("", null); 233 final VideoCapturerAndroid capturer = VideoCapturerAndroid.create("", null);
237 VideoCapturerAndroidTestFixtures.returnBufferLateEndToEnd(capturer); 234 VideoCapturerAndroidTestFixtures.returnBufferLateEndToEnd(capturer);
238 } 235 }
239 236
240 /* TODO(perkj): Enable once VideoCapture to texture support has landed in C++.
241 @MediumTest 237 @MediumTest
242 public void testReturnBufferLateEndToEndUsingTextures() throws InterruptedExce ption { 238 public void testReturnBufferLateEndToEndUsingTextures() throws InterruptedExce ption {
243 final VideoCapturerAndroid capturer = 239 final VideoCapturerAndroid capturer =
244 VideoCapturerAndroid.create("", null, EGL14.EGL_NO_CONTEXT); 240 VideoCapturerAndroid.create("", null, EGL14.EGL_NO_CONTEXT);
245 VideoCapturerAndroidTestFixtures.returnBufferLateEndToEnd(capturer); 241 VideoCapturerAndroidTestFixtures.returnBufferLateEndToEnd(capturer);
246 }*/ 242 }
247 } 243 }
OLDNEW
« no previous file with comments | « no previous file | talk/app/webrtc/androidvideocapturer.cc » ('j') | talk/app/webrtc/java/jni/androidvideocapturer_jni.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698