| OLD | NEW |
| 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 222 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 233 null, null, null, // clientId, wssUrl, wssPostUrl. | 233 null, null, null, // clientId, wssUrl, wssPostUrl. |
| 234 null, null); // offerSdp, iceCandidates. | 234 null, null); // offerSdp, iceCandidates. |
| 235 | 235 |
| 236 PeerConnectionClient client = PeerConnectionClient.getInstance(); | 236 PeerConnectionClient client = PeerConnectionClient.getInstance(); |
| 237 PeerConnectionFactory.Options options = new PeerConnectionFactory.Options(); | 237 PeerConnectionFactory.Options options = new PeerConnectionFactory.Options(); |
| 238 options.networkIgnoreMask = 0; | 238 options.networkIgnoreMask = 0; |
| 239 options.disableNetworkMonitor = true; | 239 options.disableNetworkMonitor = true; |
| 240 client.setPeerConnectionFactoryOptions(options); | 240 client.setPeerConnectionFactoryOptions(options); |
| 241 client.createPeerConnectionFactory( | 241 client.createPeerConnectionFactory( |
| 242 getInstrumentation().getContext(), peerConnectionParameters, this); | 242 getInstrumentation().getContext(), peerConnectionParameters, this); |
| 243 client.createPeerConnection(useTexures ? eglBase.getContext() : null, | 243 client.createPeerConnection(useTexures ? eglBase.getEglBaseContext() : null, |
| 244 localRenderer, remoteRenderer, signalingParameters); | 244 localRenderer, remoteRenderer, signalingParameters); |
| 245 client.createOffer(); | 245 client.createOffer(); |
| 246 return client; | 246 return client; |
| 247 } | 247 } |
| 248 | 248 |
| 249 private PeerConnectionParameters createParametersForAudioCall() { | 249 private PeerConnectionParameters createParametersForAudioCall() { |
| 250 PeerConnectionParameters peerConnectionParameters = | 250 PeerConnectionParameters peerConnectionParameters = |
| 251 new PeerConnectionParameters( | 251 new PeerConnectionParameters( |
| 252 false, true, false, // videoCallEnabled, loopback, tracing. | 252 false, true, false, // videoCallEnabled, loopback, tracing. |
| 253 0, 0, 0, 0, "", true, false, // video codec parameters. | 253 0, 0, 0, 0, "", true, false, // video codec parameters. |
| 254 0, "OPUS", false, false, false); // audio codec parameters. | 254 0, "OPUS", false, false, false); // audio codec parameters. |
| 255 return peerConnectionParameters; | 255 return peerConnectionParameters; |
| 256 } | 256 } |
| 257 | 257 |
| 258 private PeerConnectionParameters createParametersForVideoCall( | 258 private PeerConnectionParameters createParametersForVideoCall( |
| 259 String videoCodec, boolean captureToTexture) { | 259 String videoCodec, boolean captureToTexture) { |
| 260 PeerConnectionParameters peerConnectionParameters = | 260 PeerConnectionParameters peerConnectionParameters = |
| 261 new PeerConnectionParameters( | 261 new PeerConnectionParameters( |
| 262 true, true, false, // videoCallEnabled, loopback, tracing. | 262 true, true, false, // videoCallEnabled, loopback, tracing. |
| 263 0, 0, 0, 0, videoCodec, true, captureToTexture, // video codec param
eters. | 263 0, 0, 0, 0, videoCodec, true, captureToTexture, // video codec param
eters. |
| 264 0, "OPUS", false, false, false); // audio codec parameters. | 264 0, "OPUS", false, false, false); // audio codec parameters. |
| 265 return peerConnectionParameters; | 265 return peerConnectionParameters; |
| 266 } | 266 } |
| 267 | 267 |
| 268 @Override | 268 @Override |
| 269 public void setUp() { | 269 public void setUp() { |
| 270 signalingExecutor = new LooperExecutor(); | 270 signalingExecutor = new LooperExecutor(); |
| 271 signalingExecutor.requestStart(); | 271 signalingExecutor.requestStart(); |
| 272 if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.JELLY_BEAN_MR1) { | 272 if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.JELLY_BEAN_MR1) { |
| 273 eglBase = new EglBase(); | 273 eglBase = EglBase.create(); |
| 274 } | 274 } |
| 275 } | 275 } |
| 276 | 276 |
| 277 @Override | 277 @Override |
| 278 public void tearDown() { | 278 public void tearDown() { |
| 279 signalingExecutor.requestStop(); | 279 signalingExecutor.requestStop(); |
| 280 if (eglBase != null) { | 280 if (eglBase != null) { |
| 281 eglBase.release(); | 281 eglBase.release(); |
| 282 } | 282 } |
| 283 } | 283 } |
| (...skipping 220 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 504 localRenderer.waitForFramesRendered(WAIT_TIMEOUT)); | 504 localRenderer.waitForFramesRendered(WAIT_TIMEOUT)); |
| 505 assertTrue("Remote video frames were not rendered after video restart.", | 505 assertTrue("Remote video frames were not rendered after video restart.", |
| 506 remoteRenderer.waitForFramesRendered(WAIT_TIMEOUT)); | 506 remoteRenderer.waitForFramesRendered(WAIT_TIMEOUT)); |
| 507 } | 507 } |
| 508 pcClient.close(); | 508 pcClient.close(); |
| 509 assertTrue(waitForPeerConnectionClosed(WAIT_TIMEOUT)); | 509 assertTrue(waitForPeerConnectionClosed(WAIT_TIMEOUT)); |
| 510 Log.d(TAG, "testVideoSourceRestart done."); | 510 Log.d(TAG, "testVideoSourceRestart done."); |
| 511 } | 511 } |
| 512 | 512 |
| 513 } | 513 } |
| OLD | NEW |