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

Side by Side Diff: webrtc/audio/audio_send_stream_unittest.cc

Issue 1955363003: Configure VoE NACK through AudioSendStream::Config. (Closed) Base URL: https://chromium.googlesource.com/external/webrtc.git@master
Patch Set: misc Created 4 years, 6 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
OLDNEW
1 /* 1 /*
2 * Copyright (c) 2015 The WebRTC project authors. All Rights Reserved. 2 * Copyright (c) 2015 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 56 matching lines...) Expand 10 before | Expand all | Expand 10 after
67 config.voice_engine = &voice_engine_; 67 config.voice_engine = &voice_engine_;
68 audio_state_ = AudioState::Create(config); 68 audio_state_ = AudioState::Create(config);
69 69
70 EXPECT_CALL(voice_engine_, ChannelProxyFactory(kChannelId)) 70 EXPECT_CALL(voice_engine_, ChannelProxyFactory(kChannelId))
71 .WillOnce(Invoke([this](int channel_id) { 71 .WillOnce(Invoke([this](int channel_id) {
72 EXPECT_FALSE(channel_proxy_); 72 EXPECT_FALSE(channel_proxy_);
73 channel_proxy_ = new testing::StrictMock<MockVoEChannelProxy>(); 73 channel_proxy_ = new testing::StrictMock<MockVoEChannelProxy>();
74 EXPECT_CALL(*channel_proxy_, SetRTCPStatus(true)).Times(1); 74 EXPECT_CALL(*channel_proxy_, SetRTCPStatus(true)).Times(1);
75 EXPECT_CALL(*channel_proxy_, SetLocalSSRC(kSsrc)).Times(1); 75 EXPECT_CALL(*channel_proxy_, SetLocalSSRC(kSsrc)).Times(1);
76 EXPECT_CALL(*channel_proxy_, SetRTCP_CNAME(StrEq(kCName))).Times(1); 76 EXPECT_CALL(*channel_proxy_, SetRTCP_CNAME(StrEq(kCName))).Times(1);
77 EXPECT_CALL(*channel_proxy_, SetNACKStatus(true, 10)).Times(1);
77 EXPECT_CALL(*channel_proxy_, 78 EXPECT_CALL(*channel_proxy_,
78 SetSendAbsoluteSenderTimeStatus(true, kAbsSendTimeId)).Times(1); 79 SetSendAbsoluteSenderTimeStatus(true, kAbsSendTimeId)).Times(1);
79 EXPECT_CALL(*channel_proxy_, 80 EXPECT_CALL(*channel_proxy_,
80 SetSendAudioLevelIndicationStatus(true, kAudioLevelId)).Times(1); 81 SetSendAudioLevelIndicationStatus(true, kAudioLevelId)).Times(1);
81 EXPECT_CALL(*channel_proxy_, EnableSendTransportSequenceNumber( 82 EXPECT_CALL(*channel_proxy_, EnableSendTransportSequenceNumber(
82 kTransportSequenceNumberId)) 83 kTransportSequenceNumberId))
83 .Times(1); 84 .Times(1);
84 EXPECT_CALL(*channel_proxy_, 85 EXPECT_CALL(*channel_proxy_,
85 RegisterSenderCongestionControlObjects( 86 RegisterSenderCongestionControlObjects(
86 congestion_controller_.pacer(), 87 congestion_controller_.pacer(),
87 congestion_controller_.GetTransportFeedbackObserver(), 88 congestion_controller_.GetTransportFeedbackObserver(),
88 congestion_controller_.packet_router())) 89 congestion_controller_.packet_router()))
89 .Times(1); 90 .Times(1);
90 EXPECT_CALL(*channel_proxy_, ResetCongestionControlObjects()) 91 EXPECT_CALL(*channel_proxy_, ResetCongestionControlObjects())
91 .Times(1); 92 .Times(1);
92 EXPECT_CALL(*channel_proxy_, RegisterExternalTransport(nullptr)) 93 EXPECT_CALL(*channel_proxy_, RegisterExternalTransport(nullptr))
93 .Times(1); 94 .Times(1);
94 EXPECT_CALL(*channel_proxy_, DeRegisterExternalTransport()) 95 EXPECT_CALL(*channel_proxy_, DeRegisterExternalTransport())
95 .Times(1); 96 .Times(1);
96 return channel_proxy_; 97 return channel_proxy_;
97 })); 98 }));
98 stream_config_.voe_channel_id = kChannelId; 99 stream_config_.voe_channel_id = kChannelId;
99 stream_config_.rtp.ssrc = kSsrc; 100 stream_config_.rtp.ssrc = kSsrc;
101 stream_config_.rtp.nack.rtp_history_ms = 200;
100 stream_config_.rtp.c_name = kCName; 102 stream_config_.rtp.c_name = kCName;
101 stream_config_.rtp.extensions.push_back( 103 stream_config_.rtp.extensions.push_back(
102 RtpExtension(RtpExtension::kAudioLevelUri, kAudioLevelId)); 104 RtpExtension(RtpExtension::kAudioLevelUri, kAudioLevelId));
103 stream_config_.rtp.extensions.push_back( 105 stream_config_.rtp.extensions.push_back(
104 RtpExtension(RtpExtension::kAbsSendTimeUri, kAbsSendTimeId)); 106 RtpExtension(RtpExtension::kAbsSendTimeUri, kAbsSendTimeId));
105 stream_config_.rtp.extensions.push_back(RtpExtension( 107 stream_config_.rtp.extensions.push_back(RtpExtension(
106 RtpExtension::kTransportSequenceNumberUri, kTransportSequenceNumberId)); 108 RtpExtension::kTransportSequenceNumberUri, kTransportSequenceNumberId));
107 } 109 }
108 110
109 AudioSendStream::Config& config() { return stream_config_; } 111 AudioSendStream::Config& config() { return stream_config_; }
(...skipping 62 matching lines...) Expand 10 before | Expand all | Expand 10 after
172 config.rtp.ssrc = kSsrc; 174 config.rtp.ssrc = kSsrc;
173 config.rtp.extensions.push_back( 175 config.rtp.extensions.push_back(
174 RtpExtension(RtpExtension::kAbsSendTimeUri, kAbsSendTimeId)); 176 RtpExtension(RtpExtension::kAbsSendTimeUri, kAbsSendTimeId));
175 config.rtp.c_name = kCName; 177 config.rtp.c_name = kCName;
176 config.voe_channel_id = kChannelId; 178 config.voe_channel_id = kChannelId;
177 config.cng_payload_type = 42; 179 config.cng_payload_type = 42;
178 config.red_payload_type = 17; 180 config.red_payload_type = 17;
179 EXPECT_EQ( 181 EXPECT_EQ(
180 "{rtp: {ssrc: 1234, extensions: [{uri: " 182 "{rtp: {ssrc: 1234, extensions: [{uri: "
181 "http://www.webrtc.org/experiments/rtp-hdrext/abs-send-time, id: 3}], " 183 "http://www.webrtc.org/experiments/rtp-hdrext/abs-send-time, id: 3}], "
182 "c_name: foo_name}, voe_channel_id: 1, cng_payload_type: 42, " 184 "nack: {rtp_history_ms: 0}, c_name: foo_name}, voe_channel_id: 1, "
183 "red_payload_type: 17}", 185 "cng_payload_type: 42, red_payload_type: 17}",
184 config.ToString()); 186 config.ToString());
185 } 187 }
186 188
187 TEST(AudioSendStreamTest, ConstructDestruct) { 189 TEST(AudioSendStreamTest, ConstructDestruct) {
188 ConfigHelper helper; 190 ConfigHelper helper;
189 internal::AudioSendStream send_stream(helper.config(), helper.audio_state(), 191 internal::AudioSendStream send_stream(helper.config(), helper.audio_state(),
190 helper.congestion_controller()); 192 helper.congestion_controller());
191 } 193 }
192 194
193 TEST(AudioSendStreamTest, SendTelephoneEvent) { 195 TEST(AudioSendStreamTest, SendTelephoneEvent) {
(...skipping 44 matching lines...) Expand 10 before | Expand all | Expand 10 after
238 static_cast<internal::AudioState*>(helper.audio_state().get()); 240 static_cast<internal::AudioState*>(helper.audio_state().get());
239 VoiceEngineObserver* voe_observer = 241 VoiceEngineObserver* voe_observer =
240 static_cast<VoiceEngineObserver*>(internal_audio_state); 242 static_cast<VoiceEngineObserver*>(internal_audio_state);
241 voe_observer->CallbackOnError(-1, VE_TYPING_NOISE_WARNING); 243 voe_observer->CallbackOnError(-1, VE_TYPING_NOISE_WARNING);
242 EXPECT_TRUE(send_stream.GetStats().typing_noise_detected); 244 EXPECT_TRUE(send_stream.GetStats().typing_noise_detected);
243 voe_observer->CallbackOnError(-1, VE_TYPING_NOISE_OFF_WARNING); 245 voe_observer->CallbackOnError(-1, VE_TYPING_NOISE_OFF_WARNING);
244 EXPECT_FALSE(send_stream.GetStats().typing_noise_detected); 246 EXPECT_FALSE(send_stream.GetStats().typing_noise_detected);
245 } 247 }
246 } // namespace test 248 } // namespace test
247 } // namespace webrtc 249 } // namespace webrtc
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698