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

Side by Side Diff: webrtc/media/engine/webrtcvoiceengine_unittest.cc

Issue 1891163002: Fix bug causing audio to stop being sent when AudioSendStreams are recreated. (Closed) Base URL: https://chromium.googlesource.com/external/webrtc.git@51
Patch Set: Created 4 years, 8 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
« no previous file with comments | « webrtc/media/engine/webrtcvoiceengine.cc ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 2020 matching lines...) Expand 10 before | Expand all | Expand 10 after
2031 EXPECT_TRUE(channel_->SetSendParameters(send_parameters_)); 2031 EXPECT_TRUE(channel_->SetSendParameters(send_parameters_));
2032 EXPECT_TRUE(channel_->SetAudioSend(kSsrc1, true, nullptr, nullptr)); 2032 EXPECT_TRUE(channel_->SetAudioSend(kSsrc1, true, nullptr, nullptr));
2033 channel_->SetSend(true); 2033 channel_->SetSend(true);
2034 EXPECT_FALSE(GetSendStream(kSsrc1).IsSending()); 2034 EXPECT_FALSE(GetSendStream(kSsrc1).IsSending());
2035 EXPECT_TRUE(channel_->SetAudioSend(kSsrc1, true, nullptr, &fake_source_)); 2035 EXPECT_TRUE(channel_->SetAudioSend(kSsrc1, true, nullptr, &fake_source_));
2036 EXPECT_TRUE(GetSendStream(kSsrc1).IsSending()); 2036 EXPECT_TRUE(GetSendStream(kSsrc1).IsSending());
2037 EXPECT_TRUE(channel_->SetAudioSend(kSsrc1, true, nullptr, nullptr)); 2037 EXPECT_TRUE(channel_->SetAudioSend(kSsrc1, true, nullptr, nullptr));
2038 EXPECT_FALSE(GetSendStream(kSsrc1).IsSending()); 2038 EXPECT_FALSE(GetSendStream(kSsrc1).IsSending());
2039 } 2039 }
2040 2040
2041 // Test that SetSendParameters() does not alter a stream's send state.
2042 TEST_F(WebRtcVoiceEngineTestFake, SendStateWhenStreamsAreRecreated) {
2043 EXPECT_TRUE(SetupSendStream());
2044 EXPECT_FALSE(GetSendStream(kSsrc1).IsSending());
2045
2046 // Turn on sending.
2047 channel_->SetSend(true);
2048 EXPECT_TRUE(GetSendStream(kSsrc1).IsSending());
2049
2050 // Changing RTP header extensions will recreate the AudioSendStream.
2051 send_parameters_.extensions.push_back(
2052 cricket::RtpHeaderExtension(kRtpAudioLevelHeaderExtension, 12));
2053 EXPECT_TRUE(channel_->SetSendParameters(send_parameters_));
2054 EXPECT_TRUE(GetSendStream(kSsrc1).IsSending());
2055
2056 // Turn off sending.
2057 channel_->SetSend(false);
2058 EXPECT_FALSE(GetSendStream(kSsrc1).IsSending());
2059
2060 // Changing RTP header extensions will recreate the AudioSendStream.
2061 send_parameters_.extensions.clear();
2062 EXPECT_TRUE(channel_->SetSendParameters(send_parameters_));
2063 EXPECT_FALSE(GetSendStream(kSsrc1).IsSending());
2064 }
2065
2041 // Test that we can create a channel and start playing out on it. 2066 // Test that we can create a channel and start playing out on it.
2042 TEST_F(WebRtcVoiceEngineTestFake, Playout) { 2067 TEST_F(WebRtcVoiceEngineTestFake, Playout) {
2043 EXPECT_TRUE(SetupRecvStream()); 2068 EXPECT_TRUE(SetupRecvStream());
2044 int channel_num = voe_.GetLastChannel(); 2069 int channel_num = voe_.GetLastChannel();
2045 EXPECT_TRUE(channel_->SetRecvParameters(recv_parameters_)); 2070 EXPECT_TRUE(channel_->SetRecvParameters(recv_parameters_));
2046 EXPECT_TRUE(channel_->SetPlayout(true)); 2071 EXPECT_TRUE(channel_->SetPlayout(true));
2047 EXPECT_TRUE(voe_.GetPlayout(channel_num)); 2072 EXPECT_TRUE(voe_.GetPlayout(channel_num));
2048 EXPECT_TRUE(channel_->SetPlayout(false)); 2073 EXPECT_TRUE(channel_->SetPlayout(false));
2049 EXPECT_FALSE(voe_.GetPlayout(channel_num)); 2074 EXPECT_FALSE(voe_.GetPlayout(channel_num));
2050 } 2075 }
(...skipping 1294 matching lines...) Expand 10 before | Expand all | Expand 10 after
3345 TEST(WebRtcVoiceEngineTest, SetRecvCodecs) { 3370 TEST(WebRtcVoiceEngineTest, SetRecvCodecs) {
3346 cricket::WebRtcVoiceEngine engine(nullptr); 3371 cricket::WebRtcVoiceEngine engine(nullptr);
3347 std::unique_ptr<webrtc::Call> call( 3372 std::unique_ptr<webrtc::Call> call(
3348 webrtc::Call::Create(webrtc::Call::Config())); 3373 webrtc::Call::Create(webrtc::Call::Config()));
3349 cricket::WebRtcVoiceMediaChannel channel(&engine, cricket::MediaConfig(), 3374 cricket::WebRtcVoiceMediaChannel channel(&engine, cricket::MediaConfig(),
3350 cricket::AudioOptions(), call.get()); 3375 cricket::AudioOptions(), call.get());
3351 cricket::AudioRecvParameters parameters; 3376 cricket::AudioRecvParameters parameters;
3352 parameters.codecs = engine.codecs(); 3377 parameters.codecs = engine.codecs();
3353 EXPECT_TRUE(channel.SetRecvParameters(parameters)); 3378 EXPECT_TRUE(channel.SetRecvParameters(parameters));
3354 } 3379 }
OLDNEW
« no previous file with comments | « webrtc/media/engine/webrtcvoiceengine.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698