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, ParametersShouldPreservePlayout) { | |
the sun
2016/10/03 12:01:49
nit: Name is confusing - I don't see how the param
aleloi
2016/10/03 12:07:58
I agree. I went with your proposal.
| |
3345 SetupRecvStream(); | |
3346 channel_->SetPlayout(true); | |
the sun
2016/10/03 12:01:49
Add
EXPECT_TRUE(GetRecvStream(kSsrc1).started());
aleloi
2016/10/03 12:07:57
Done.
| |
3347 | |
3348 // Changing RTP header extensions will recreate the AudioReceiveStream. | |
3349 cricket::AudioRecvParameters parameters; | |
3350 parameters.extensions.push_back( | |
3351 webrtc::RtpExtension(webrtc::RtpExtension::kAudioLevelUri, 12)); | |
3352 channel_->SetRecvParameters(parameters); | |
3353 | |
3354 EXPECT_TRUE(GetRecvStream(kSsrc1).started()); | |
3355 } | |
3356 | |
3343 // Tests that the library initializes and shuts down properly. | 3357 // Tests that the library initializes and shuts down properly. |
3344 TEST(WebRtcVoiceEngineTest, StartupShutdown) { | 3358 TEST(WebRtcVoiceEngineTest, StartupShutdown) { |
3345 // If the VoiceEngine wants to gather available codecs early, that's fine but | 3359 // 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. | 3360 // we never want it to create a decoder at this stage. |
3347 cricket::WebRtcVoiceEngine engine( | 3361 cricket::WebRtcVoiceEngine engine( |
3348 nullptr, webrtc::MockAudioDecoderFactory::CreateUnusedFactory()); | 3362 nullptr, webrtc::MockAudioDecoderFactory::CreateUnusedFactory()); |
3349 std::unique_ptr<webrtc::Call> call( | 3363 std::unique_ptr<webrtc::Call> call( |
3350 webrtc::Call::Create(webrtc::Call::Config())); | 3364 webrtc::Call::Create(webrtc::Call::Config())); |
3351 cricket::VoiceMediaChannel* channel = engine.CreateChannel( | 3365 cricket::VoiceMediaChannel* channel = engine.CreateChannel( |
3352 call.get(), cricket::MediaConfig(), cricket::AudioOptions()); | 3366 call.get(), cricket::MediaConfig(), cricket::AudioOptions()); |
(...skipping 140 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
3493 cricket::WebRtcVoiceEngine engine( | 3507 cricket::WebRtcVoiceEngine engine( |
3494 nullptr, webrtc::CreateBuiltinAudioDecoderFactory()); | 3508 nullptr, webrtc::CreateBuiltinAudioDecoderFactory()); |
3495 std::unique_ptr<webrtc::Call> call( | 3509 std::unique_ptr<webrtc::Call> call( |
3496 webrtc::Call::Create(webrtc::Call::Config())); | 3510 webrtc::Call::Create(webrtc::Call::Config())); |
3497 cricket::WebRtcVoiceMediaChannel channel(&engine, cricket::MediaConfig(), | 3511 cricket::WebRtcVoiceMediaChannel channel(&engine, cricket::MediaConfig(), |
3498 cricket::AudioOptions(), call.get()); | 3512 cricket::AudioOptions(), call.get()); |
3499 cricket::AudioRecvParameters parameters; | 3513 cricket::AudioRecvParameters parameters; |
3500 parameters.codecs = engine.recv_codecs(); | 3514 parameters.codecs = engine.recv_codecs(); |
3501 EXPECT_TRUE(channel.SetRecvParameters(parameters)); | 3515 EXPECT_TRUE(channel.SetRecvParameters(parameters)); |
3502 } | 3516 } |
OLD | NEW |