| 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 |
| 11 package org.appspot.apprtc.test; | 11 package org.appspot.apprtc.test; |
| 12 | 12 |
| 13 import java.util.LinkedList; | 13 import java.util.LinkedList; |
| 14 import java.util.List; | 14 import java.util.List; |
| 15 import java.util.concurrent.CountDownLatch; | 15 import java.util.concurrent.CountDownLatch; |
| 16 import java.util.concurrent.TimeUnit; | 16 import java.util.concurrent.TimeUnit; |
| 17 | 17 |
| 18 import org.appspot.apprtc.AppRTCClient.SignalingParameters; | 18 import org.appspot.apprtc.AppRTCClient.SignalingParameters; |
| 19 import org.appspot.apprtc.PeerConnectionClient; | 19 import org.appspot.apprtc.PeerConnectionClient; |
| 20 import org.appspot.apprtc.PeerConnectionClient.PeerConnectionEvents; | 20 import org.appspot.apprtc.PeerConnectionClient.PeerConnectionEvents; |
| 21 import org.appspot.apprtc.PeerConnectionClient.PeerConnectionParameters; | 21 import org.appspot.apprtc.PeerConnectionClient.PeerConnectionParameters; |
| 22 import org.appspot.apprtc.util.LooperExecutor; | 22 import org.appspot.apprtc.util.LooperExecutor; |
| 23 import org.webrtc.EglBase; | 23 import org.webrtc.EglBase; |
| 24 import org.webrtc.IceCandidate; | 24 import org.webrtc.IceCandidate; |
| 25 import org.webrtc.MediaConstraints; | |
| 26 import org.webrtc.PeerConnection; | 25 import org.webrtc.PeerConnection; |
| 27 import org.webrtc.PeerConnectionFactory; | 26 import org.webrtc.PeerConnectionFactory; |
| 28 import org.webrtc.SessionDescription; | 27 import org.webrtc.SessionDescription; |
| 29 import org.webrtc.StatsReport; | 28 import org.webrtc.StatsReport; |
| 30 import org.webrtc.VideoRenderer; | 29 import org.webrtc.VideoRenderer; |
| 31 | 30 |
| 32 import android.os.Build; | 31 import android.os.Build; |
| 33 import android.test.InstrumentationTestCase; | 32 import android.test.InstrumentationTestCase; |
| 34 import android.util.Log; | 33 import android.util.Log; |
| 35 | 34 |
| (...skipping 209 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 245 client.createOffer(); | 244 client.createOffer(); |
| 246 return client; | 245 return client; |
| 247 } | 246 } |
| 248 | 247 |
| 249 private PeerConnectionParameters createParameters(boolean enableVideo, | 248 private PeerConnectionParameters createParameters(boolean enableVideo, |
| 250 String videoCodec) { | 249 String videoCodec) { |
| 251 PeerConnectionParameters peerConnectionParameters = | 250 PeerConnectionParameters peerConnectionParameters = |
| 252 new PeerConnectionParameters( | 251 new PeerConnectionParameters( |
| 253 enableVideo, true, // videoCallEnabled, loopback. | 252 enableVideo, true, // videoCallEnabled, loopback. |
| 254 0, 0, 0, 0, videoCodec, true, // video codec parameters. | 253 0, 0, 0, 0, videoCodec, true, // video codec parameters. |
| 255 0, "OPUS", false, true); // audio codec parameters. | 254 0, "OPUS", false, false); // audio codec parameters. |
| 256 return peerConnectionParameters; | 255 return peerConnectionParameters; |
| 257 } | 256 } |
| 258 | 257 |
| 259 @Override | 258 @Override |
| 260 public void setUp() { | 259 public void setUp() { |
| 261 signalingExecutor = new LooperExecutor(); | 260 signalingExecutor = new LooperExecutor(); |
| 262 signalingExecutor.requestStart(); | 261 signalingExecutor.requestStart(); |
| 263 if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.JELLY_BEAN_MR1) { | 262 if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.JELLY_BEAN_MR1) { |
| 264 eglBase = new EglBase(); | 263 eglBase = new EglBase(); |
| 265 } | 264 } |
| (...skipping 200 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 466 localRenderer.waitForFramesRendered(WAIT_TIMEOUT)); | 465 localRenderer.waitForFramesRendered(WAIT_TIMEOUT)); |
| 467 assertTrue("Remote video frames were not rendered after video restart.", | 466 assertTrue("Remote video frames were not rendered after video restart.", |
| 468 remoteRenderer.waitForFramesRendered(WAIT_TIMEOUT)); | 467 remoteRenderer.waitForFramesRendered(WAIT_TIMEOUT)); |
| 469 } | 468 } |
| 470 pcClient.close(); | 469 pcClient.close(); |
| 471 assertTrue(waitForPeerConnectionClosed(WAIT_TIMEOUT)); | 470 assertTrue(waitForPeerConnectionClosed(WAIT_TIMEOUT)); |
| 472 Log.d(TAG, "testVideoSourceRestart done."); | 471 Log.d(TAG, "testVideoSourceRestart done."); |
| 473 } | 472 } |
| 474 | 473 |
| 475 } | 474 } |
| OLD | NEW |