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

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: rebase again 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
« no previous file with comments | « webrtc/audio/audio_send_stream.cc ('k') | webrtc/audio_send_stream.h » ('j') | 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) 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 61 matching lines...) Expand 10 before | Expand all | Expand 10 after
171 AudioSendStream::Config config(nullptr); 173 AudioSendStream::Config config(nullptr);
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 EXPECT_EQ( 180 EXPECT_EQ(
179 "{rtp: {ssrc: 1234, extensions: [{uri: " 181 "{rtp: {ssrc: 1234, extensions: [{uri: "
180 "http://www.webrtc.org/experiments/rtp-hdrext/abs-send-time, id: 3}], " 182 "http://www.webrtc.org/experiments/rtp-hdrext/abs-send-time, id: 3}], "
181 "c_name: foo_name}, voe_channel_id: 1, cng_payload_type: 42}", 183 "nack: {rtp_history_ms: 0}, c_name: foo_name}, voe_channel_id: 1, "
184 "cng_payload_type: 42}",
182 config.ToString()); 185 config.ToString());
183 } 186 }
184 187
185 TEST(AudioSendStreamTest, ConstructDestruct) { 188 TEST(AudioSendStreamTest, ConstructDestruct) {
186 ConfigHelper helper; 189 ConfigHelper helper;
187 internal::AudioSendStream send_stream(helper.config(), helper.audio_state(), 190 internal::AudioSendStream send_stream(helper.config(), helper.audio_state(),
188 helper.congestion_controller()); 191 helper.congestion_controller());
189 } 192 }
190 193
191 TEST(AudioSendStreamTest, SendTelephoneEvent) { 194 TEST(AudioSendStreamTest, SendTelephoneEvent) {
(...skipping 44 matching lines...) Expand 10 before | Expand all | Expand 10 after
236 static_cast<internal::AudioState*>(helper.audio_state().get()); 239 static_cast<internal::AudioState*>(helper.audio_state().get());
237 VoiceEngineObserver* voe_observer = 240 VoiceEngineObserver* voe_observer =
238 static_cast<VoiceEngineObserver*>(internal_audio_state); 241 static_cast<VoiceEngineObserver*>(internal_audio_state);
239 voe_observer->CallbackOnError(-1, VE_TYPING_NOISE_WARNING); 242 voe_observer->CallbackOnError(-1, VE_TYPING_NOISE_WARNING);
240 EXPECT_TRUE(send_stream.GetStats().typing_noise_detected); 243 EXPECT_TRUE(send_stream.GetStats().typing_noise_detected);
241 voe_observer->CallbackOnError(-1, VE_TYPING_NOISE_OFF_WARNING); 244 voe_observer->CallbackOnError(-1, VE_TYPING_NOISE_OFF_WARNING);
242 EXPECT_FALSE(send_stream.GetStats().typing_noise_detected); 245 EXPECT_FALSE(send_stream.GetStats().typing_noise_detected);
243 } 246 }
244 } // namespace test 247 } // namespace test
245 } // namespace webrtc 248 } // namespace webrtc
OLDNEW
« no previous file with comments | « webrtc/audio/audio_send_stream.cc ('k') | webrtc/audio_send_stream.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698