| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (c) 2008 The WebRTC project authors. All Rights Reserved. | 2 * Copyright (c) 2008 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 3322 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3333 EXPECT_EQ(webrtc::kNetworkUp, | 3333 EXPECT_EQ(webrtc::kNetworkUp, |
| 3334 call_.GetNetworkState(webrtc::MediaType::VIDEO)); | 3334 call_.GetNetworkState(webrtc::MediaType::VIDEO)); |
| 3335 | 3335 |
| 3336 channel_->OnReadyToSend(true); | 3336 channel_->OnReadyToSend(true); |
| 3337 EXPECT_EQ(webrtc::kNetworkUp, | 3337 EXPECT_EQ(webrtc::kNetworkUp, |
| 3338 call_.GetNetworkState(webrtc::MediaType::AUDIO)); | 3338 call_.GetNetworkState(webrtc::MediaType::AUDIO)); |
| 3339 EXPECT_EQ(webrtc::kNetworkUp, | 3339 EXPECT_EQ(webrtc::kNetworkUp, |
| 3340 call_.GetNetworkState(webrtc::MediaType::VIDEO)); | 3340 call_.GetNetworkState(webrtc::MediaType::VIDEO)); |
| 3341 } | 3341 } |
| 3342 | 3342 |
| 3343 // Test that playout is still started after changing parameters |
| 3344 TEST_F(WebRtcVoiceEngineTestFake, PreservePlayoutWhenRecreateRecvStream) { |
| 3345 SetupRecvStream(); |
| 3346 channel_->SetPlayout(true); |
| 3347 EXPECT_TRUE(GetRecvStream(kSsrc1).started()); |
| 3348 |
| 3349 // Changing RTP header extensions will recreate the AudioReceiveStream. |
| 3350 cricket::AudioRecvParameters parameters; |
| 3351 parameters.extensions.push_back( |
| 3352 webrtc::RtpExtension(webrtc::RtpExtension::kAudioLevelUri, 12)); |
| 3353 channel_->SetRecvParameters(parameters); |
| 3354 |
| 3355 EXPECT_TRUE(GetRecvStream(kSsrc1).started()); |
| 3356 } |
| 3357 |
| 3343 // Tests that the library initializes and shuts down properly. | 3358 // Tests that the library initializes and shuts down properly. |
| 3344 TEST(WebRtcVoiceEngineTest, StartupShutdown) { | 3359 TEST(WebRtcVoiceEngineTest, StartupShutdown) { |
| 3345 // If the VoiceEngine wants to gather available codecs early, that's fine but | 3360 // If the VoiceEngine wants to gather available codecs early, that's fine but |
| 3346 // we never want it to create a decoder at this stage. | 3361 // we never want it to create a decoder at this stage. |
| 3347 cricket::WebRtcVoiceEngine engine( | 3362 cricket::WebRtcVoiceEngine engine( |
| 3348 nullptr, webrtc::MockAudioDecoderFactory::CreateUnusedFactory()); | 3363 nullptr, webrtc::MockAudioDecoderFactory::CreateUnusedFactory()); |
| 3349 std::unique_ptr<webrtc::Call> call( | 3364 std::unique_ptr<webrtc::Call> call( |
| 3350 webrtc::Call::Create(webrtc::Call::Config())); | 3365 webrtc::Call::Create(webrtc::Call::Config())); |
| 3351 cricket::VoiceMediaChannel* channel = engine.CreateChannel( | 3366 cricket::VoiceMediaChannel* channel = engine.CreateChannel( |
| 3352 call.get(), cricket::MediaConfig(), cricket::AudioOptions()); | 3367 call.get(), cricket::MediaConfig(), cricket::AudioOptions()); |
| (...skipping 140 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3493 cricket::WebRtcVoiceEngine engine( | 3508 cricket::WebRtcVoiceEngine engine( |
| 3494 nullptr, webrtc::CreateBuiltinAudioDecoderFactory()); | 3509 nullptr, webrtc::CreateBuiltinAudioDecoderFactory()); |
| 3495 std::unique_ptr<webrtc::Call> call( | 3510 std::unique_ptr<webrtc::Call> call( |
| 3496 webrtc::Call::Create(webrtc::Call::Config())); | 3511 webrtc::Call::Create(webrtc::Call::Config())); |
| 3497 cricket::WebRtcVoiceMediaChannel channel(&engine, cricket::MediaConfig(), | 3512 cricket::WebRtcVoiceMediaChannel channel(&engine, cricket::MediaConfig(), |
| 3498 cricket::AudioOptions(), call.get()); | 3513 cricket::AudioOptions(), call.get()); |
| 3499 cricket::AudioRecvParameters parameters; | 3514 cricket::AudioRecvParameters parameters; |
| 3500 parameters.codecs = engine.recv_codecs(); | 3515 parameters.codecs = engine.recv_codecs(); |
| 3501 EXPECT_TRUE(channel.SetRecvParameters(parameters)); | 3516 EXPECT_TRUE(channel.SetRecvParameters(parameters)); |
| 3502 } | 3517 } |
| OLD | NEW |