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

Side by Side Diff: webrtc/examples/androidtests/src/org/appspot/apprtc/test/PeerConnectionClientTest.java

Issue 2871393002: AppRTCMobile support to turn off the WebRTC AGC and HPF (Closed)
Patch Set: Created 3 years, 7 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 * Copyright 2014 The WebRTC Project Authors. All rights reserved. 2 * Copyright 2014 The WebRTC Project Authors. All rights reserved.
3 * 3 *
4 * Use of this source code is governed by a BSD-style license 4 * Use of this source code is governed by a BSD-style license
5 * that can be found in the LICENSE file in the root of the source 5 * that can be found in the LICENSE file in the root of the source
6 * tree. An additional intellectual property rights grant can be found 6 * tree. An additional intellectual property rights grant can be found
7 * in the file PATENTS. All contributing project authors may 7 * in the file PATENTS. All contributing project authors may
8 * be found in the AUTHORS file in the root of the source tree. 8 * be found in the AUTHORS file in the root of the source tree.
9 */ 9 */
10 10
(...skipping 245 matching lines...) Expand 10 before | Expand all | Expand 10 after
256 client.setPeerConnectionFactoryOptions(options); 256 client.setPeerConnectionFactoryOptions(options);
257 client.createPeerConnectionFactory( 257 client.createPeerConnectionFactory(
258 InstrumentationRegistry.getTargetContext(), peerConnectionParameters, th is); 258 InstrumentationRegistry.getTargetContext(), peerConnectionParameters, th is);
259 client.createPeerConnection( 259 client.createPeerConnection(
260 eglContext, localRenderer, remoteRenderer, videoCapturer, signalingParam eters); 260 eglContext, localRenderer, remoteRenderer, videoCapturer, signalingParam eters);
261 client.createOffer(); 261 client.createOffer();
262 return client; 262 return client;
263 } 263 }
264 264
265 private PeerConnectionParameters createParametersForAudioCall() { 265 private PeerConnectionParameters createParametersForAudioCall() {
266 PeerConnectionParameters peerConnectionParameters = 266 PeerConnectionParameters peerConnectionParameters = new PeerConnectionParame ters(
267 new PeerConnectionParameters(false, /* videoCallEnabled */ 267 false, /* videoCallEnabled */
268 true, /* loopback */ 268 true, /* loopback */
269 false, /* tracing */ 269 false, /* tracing */
270 // Video codec parameters. 270 // Video codec parameters.
271 0, /* videoWidth */ 271 0, /* videoWidth */
272 0, /* videoHeight */ 272 0, /* videoHeight */
273 0, /* videoFps */ 273 0, /* videoFps */
274 0, /* videoStartBitrate */ 274 0, /* videoStartBitrate */
275 "", /* videoCodec */ 275 "", /* videoCodec */
276 true, /* videoCodecHwAcceleration */ 276 true, /* videoCodecHwAcceleration */
277 false, /* videoFlexfecEnabled */ 277 false, /* videoFlexfecEnabled */
278 // Audio codec parameters. 278 // Audio codec parameters.
279 0, /* audioStartBitrate */ 279 0, /* audioStartBitrate */
280 "OPUS", /* audioCodec */ 280 "OPUS", /* audioCodec */
281 false, /* noAudioProcessing */ 281 false, /* noAudioProcessing */
282 false, /* aecDump */ 282 false, /* aecDump */
283 false /* useOpenSLES */, false /* disableBuiltInAEC */, false /* dis ableBuiltInAGC */, 283 false /* useOpenSLES */, false /* disableBuiltInAEC */, false /* disable BuiltInAGC */,
284 false /* disableBuiltInNS */, false /* enableLevelControl */); 284 false /* disableBuiltInNS */, false /* enableLevelControl */, false /* d isableWebRtcAGC */);
285 285
286 return peerConnectionParameters; 286 return peerConnectionParameters;
287 } 287 }
288 288
289 private VideoCapturer createCameraCapturer(boolean captureToTexture) { 289 private VideoCapturer createCameraCapturer(boolean captureToTexture) {
290 final boolean useCamera2 = captureToTexture 290 final boolean useCamera2 = captureToTexture
291 && Camera2Enumerator.isSupported(InstrumentationRegistry.getTargetContex t()); 291 && Camera2Enumerator.isSupported(InstrumentationRegistry.getTargetContex t());
292 292
293 CameraEnumerator enumerator; 293 CameraEnumerator enumerator;
294 if (useCamera2) { 294 if (useCamera2) {
295 enumerator = new Camera2Enumerator(InstrumentationRegistry.getTargetContex t()); 295 enumerator = new Camera2Enumerator(InstrumentationRegistry.getTargetContex t());
296 } else { 296 } else {
297 enumerator = new Camera1Enumerator(captureToTexture); 297 enumerator = new Camera1Enumerator(captureToTexture);
298 } 298 }
299 String deviceName = enumerator.getDeviceNames()[0]; 299 String deviceName = enumerator.getDeviceNames()[0];
300 return enumerator.createCapturer(deviceName, null); 300 return enumerator.createCapturer(deviceName, null);
301 } 301 }
302 302
303 private PeerConnectionParameters createParametersForVideoCall(String videoCode c) { 303 private PeerConnectionParameters createParametersForVideoCall(String videoCode c) {
304 PeerConnectionParameters peerConnectionParameters = 304 PeerConnectionParameters peerConnectionParameters = new PeerConnectionParame ters(
305 new PeerConnectionParameters(true, /* videoCallEnabled */ 305 true, /* videoCallEnabled */
306 true, /* loopback */ 306 true, /* loopback */
307 false, /* tracing */ 307 false, /* tracing */
308 // Video codec parameters. 308 // Video codec parameters.
309 0, /* videoWidth */ 309 0, /* videoWidth */
310 0, /* videoHeight */ 310 0, /* videoHeight */
311 0, /* videoFps */ 311 0, /* videoFps */
312 0, /* videoStartBitrate */ 312 0, /* videoStartBitrate */
313 videoCodec, /* videoCodec */ 313 videoCodec, /* videoCodec */
314 true, /* videoCodecHwAcceleration */ 314 true, /* videoCodecHwAcceleration */
315 false, /* videoFlexfecEnabled */ 315 false, /* videoFlexfecEnabled */
316 // Audio codec parameters. 316 // Audio codec parameters.
317 0, /* audioStartBitrate */ 317 0, /* audioStartBitrate */
318 "OPUS", /* audioCodec */ 318 "OPUS", /* audioCodec */
319 false, /* noAudioProcessing */ 319 false, /* noAudioProcessing */
320 false, /* aecDump */ 320 false, /* aecDump */
321 false /* useOpenSLES */, false /* disableBuiltInAEC */, false /* dis ableBuiltInAGC */, 321 false /* useOpenSLES */, false /* disableBuiltInAEC */, false /* disable BuiltInAGC */,
322 false /* disableBuiltInNS */, false /* enableLevelControl */); 322 false /* disableBuiltInNS */, false /* enableLevelControl */, false /* d isableWebRtcAGC */);
323 323
324 return peerConnectionParameters; 324 return peerConnectionParameters;
325 } 325 }
326 326
327 @Before 327 @Before
328 public void setUp() { 328 public void setUp() {
329 signalingExecutor = Executors.newSingleThreadExecutor(); 329 signalingExecutor = Executors.newSingleThreadExecutor();
330 if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.JELLY_BEAN_MR1) { 330 if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.JELLY_BEAN_MR1) {
331 eglBase = EglBase.create(); 331 eglBase = EglBase.create();
332 } 332 }
(...skipping 352 matching lines...) Expand 10 before | Expand all | Expand 10 after
685 localRenderer.waitForFramesRendered(WAIT_TIMEOUT)); 685 localRenderer.waitForFramesRendered(WAIT_TIMEOUT));
686 assertTrue("Remote video frames were not rendered after capture format cha nge.", 686 assertTrue("Remote video frames were not rendered after capture format cha nge.",
687 remoteRenderer.waitForFramesRendered(WAIT_TIMEOUT)); 687 remoteRenderer.waitForFramesRendered(WAIT_TIMEOUT));
688 } 688 }
689 689
690 pcClient.close(); 690 pcClient.close();
691 assertTrue(waitForPeerConnectionClosed(WAIT_TIMEOUT)); 691 assertTrue(waitForPeerConnectionClosed(WAIT_TIMEOUT));
692 Log.d(TAG, "testCaptureFormatChange done."); 692 Log.d(TAG, "testCaptureFormatChange done.");
693 } 693 }
694 } 694 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698