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

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

Issue 2060813002: Configure VoE NACK through AudioReceiveStream::Config. (Closed) Base URL: https://chromium.googlesource.com/external/webrtc.git@wvoe_config_nack
Patch Set: 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 64 matching lines...) Expand 10 before | Expand all | Expand 10 after
75 DeRegisterVoiceEngineObserver()).WillOnce(Return(0)); 75 DeRegisterVoiceEngineObserver()).WillOnce(Return(0));
76 AudioState::Config config; 76 AudioState::Config config;
77 config.voice_engine = &voice_engine_; 77 config.voice_engine = &voice_engine_;
78 audio_state_ = AudioState::Create(config); 78 audio_state_ = AudioState::Create(config);
79 79
80 EXPECT_CALL(voice_engine_, ChannelProxyFactory(kChannelId)) 80 EXPECT_CALL(voice_engine_, ChannelProxyFactory(kChannelId))
81 .WillOnce(Invoke([this](int channel_id) { 81 .WillOnce(Invoke([this](int channel_id) {
82 EXPECT_FALSE(channel_proxy_); 82 EXPECT_FALSE(channel_proxy_);
83 channel_proxy_ = new testing::StrictMock<MockVoEChannelProxy>(); 83 channel_proxy_ = new testing::StrictMock<MockVoEChannelProxy>();
84 EXPECT_CALL(*channel_proxy_, SetLocalSSRC(kLocalSsrc)).Times(1); 84 EXPECT_CALL(*channel_proxy_, SetLocalSSRC(kLocalSsrc)).Times(1);
85 EXPECT_CALL(*channel_proxy_, SetNACKStatus(true, 15)).Times(1);
85 EXPECT_CALL(*channel_proxy_, 86 EXPECT_CALL(*channel_proxy_,
86 SetReceiveAbsoluteSenderTimeStatus(true, kAbsSendTimeId)) 87 SetReceiveAbsoluteSenderTimeStatus(true, kAbsSendTimeId))
87 .Times(1); 88 .Times(1);
88 EXPECT_CALL(*channel_proxy_, 89 EXPECT_CALL(*channel_proxy_,
89 SetReceiveAudioLevelIndicationStatus(true, kAudioLevelId)) 90 SetReceiveAudioLevelIndicationStatus(true, kAudioLevelId))
90 .Times(1); 91 .Times(1);
91 EXPECT_CALL(*channel_proxy_, EnableReceiveTransportSequenceNumber( 92 EXPECT_CALL(*channel_proxy_, EnableReceiveTransportSequenceNumber(
92 kTransportSequenceNumberId)) 93 kTransportSequenceNumberId))
93 .Times(1); 94 .Times(1);
94 EXPECT_CALL(*channel_proxy_, 95 EXPECT_CALL(*channel_proxy_,
95 RegisterReceiverCongestionControlObjects(&packet_router_)) 96 RegisterReceiverCongestionControlObjects(&packet_router_))
96 .Times(1); 97 .Times(1);
97 EXPECT_CALL(congestion_controller_, packet_router()) 98 EXPECT_CALL(congestion_controller_, packet_router())
98 .WillOnce(Return(&packet_router_)); 99 .WillOnce(Return(&packet_router_));
99 EXPECT_CALL(*channel_proxy_, ResetCongestionControlObjects()) 100 EXPECT_CALL(*channel_proxy_, ResetCongestionControlObjects())
100 .Times(1); 101 .Times(1);
101 EXPECT_CALL(*channel_proxy_, RegisterExternalTransport(nullptr)) 102 EXPECT_CALL(*channel_proxy_, RegisterExternalTransport(nullptr))
102 .Times(1); 103 .Times(1);
103 EXPECT_CALL(*channel_proxy_, DeRegisterExternalTransport()) 104 EXPECT_CALL(*channel_proxy_, DeRegisterExternalTransport())
104 .Times(1); 105 .Times(1);
105 return channel_proxy_; 106 return channel_proxy_;
106 })); 107 }));
107 stream_config_.voe_channel_id = kChannelId; 108 stream_config_.voe_channel_id = kChannelId;
108 stream_config_.rtp.local_ssrc = kLocalSsrc; 109 stream_config_.rtp.local_ssrc = kLocalSsrc;
109 stream_config_.rtp.remote_ssrc = kRemoteSsrc; 110 stream_config_.rtp.remote_ssrc = kRemoteSsrc;
111 stream_config_.rtp.nack.rtp_history_ms = 300;
110 stream_config_.rtp.extensions.push_back( 112 stream_config_.rtp.extensions.push_back(
111 RtpExtension(RtpExtension::kAbsSendTimeUri, kAbsSendTimeId)); 113 RtpExtension(RtpExtension::kAbsSendTimeUri, kAbsSendTimeId));
112 stream_config_.rtp.extensions.push_back( 114 stream_config_.rtp.extensions.push_back(
113 RtpExtension(RtpExtension::kAudioLevelUri, kAudioLevelId)); 115 RtpExtension(RtpExtension::kAudioLevelUri, kAudioLevelId));
114 stream_config_.rtp.extensions.push_back(RtpExtension( 116 stream_config_.rtp.extensions.push_back(RtpExtension(
115 RtpExtension::kTransportSequenceNumberUri, kTransportSequenceNumberId)); 117 RtpExtension::kTransportSequenceNumberUri, kTransportSequenceNumberId));
116 } 118 }
117 119
118 MockCongestionController* congestion_controller() { 120 MockCongestionController* congestion_controller() {
119 return &congestion_controller_; 121 return &congestion_controller_;
(...skipping 100 matching lines...) Expand 10 before | Expand all | Expand 10 after
220 } // namespace 222 } // namespace
221 223
222 TEST(AudioReceiveStreamTest, ConfigToString) { 224 TEST(AudioReceiveStreamTest, ConfigToString) {
223 AudioReceiveStream::Config config; 225 AudioReceiveStream::Config config;
224 config.rtp.remote_ssrc = kRemoteSsrc; 226 config.rtp.remote_ssrc = kRemoteSsrc;
225 config.rtp.local_ssrc = kLocalSsrc; 227 config.rtp.local_ssrc = kLocalSsrc;
226 config.rtp.extensions.push_back( 228 config.rtp.extensions.push_back(
227 RtpExtension(RtpExtension::kAbsSendTimeUri, kAbsSendTimeId)); 229 RtpExtension(RtpExtension::kAbsSendTimeUri, kAbsSendTimeId));
228 config.voe_channel_id = kChannelId; 230 config.voe_channel_id = kChannelId;
229 EXPECT_EQ( 231 EXPECT_EQ(
230 "{rtp: {remote_ssrc: 1234, local_ssrc: 5678, extensions: [{uri: " 232 "{rtp: {remote_ssrc: 1234, local_ssrc: 5678, transport_cc: off, "
231 "http://www.webrtc.org/experiments/rtp-hdrext/abs-send-time, id: 2}], " 233 "nack: {rtp_history_ms: 0}, extensions: [{uri: "
232 "transport_cc: off}, " 234 "http://www.webrtc.org/experiments/rtp-hdrext/abs-send-time, id: 2}]}, "
233 "rtcp_send_transport: nullptr, " 235 "rtcp_send_transport: nullptr, "
234 "voe_channel_id: 2}", 236 "voe_channel_id: 2}",
235 config.ToString()); 237 config.ToString());
236 } 238 }
237 239
238 TEST(AudioReceiveStreamTest, ConstructDestruct) { 240 TEST(AudioReceiveStreamTest, ConstructDestruct) {
239 ConfigHelper helper; 241 ConfigHelper helper;
240 internal::AudioReceiveStream recv_stream( 242 internal::AudioReceiveStream recv_stream(
241 helper.congestion_controller(), helper.config(), helper.audio_state()); 243 helper.congestion_controller(), helper.config(), helper.audio_state());
242 } 244 }
(...skipping 88 matching lines...) Expand 10 before | Expand all | Expand 10 after
331 EXPECT_EQ(kAudioDecodeStats.calls_to_neteq, stats.decoding_calls_to_neteq); 333 EXPECT_EQ(kAudioDecodeStats.calls_to_neteq, stats.decoding_calls_to_neteq);
332 EXPECT_EQ(kAudioDecodeStats.decoded_normal, stats.decoding_normal); 334 EXPECT_EQ(kAudioDecodeStats.decoded_normal, stats.decoding_normal);
333 EXPECT_EQ(kAudioDecodeStats.decoded_plc, stats.decoding_plc); 335 EXPECT_EQ(kAudioDecodeStats.decoded_plc, stats.decoding_plc);
334 EXPECT_EQ(kAudioDecodeStats.decoded_cng, stats.decoding_cng); 336 EXPECT_EQ(kAudioDecodeStats.decoded_cng, stats.decoding_cng);
335 EXPECT_EQ(kAudioDecodeStats.decoded_plc_cng, stats.decoding_plc_cng); 337 EXPECT_EQ(kAudioDecodeStats.decoded_plc_cng, stats.decoding_plc_cng);
336 EXPECT_EQ(kCallStats.capture_start_ntp_time_ms_, 338 EXPECT_EQ(kCallStats.capture_start_ntp_time_ms_,
337 stats.capture_start_ntp_time_ms); 339 stats.capture_start_ntp_time_ms);
338 } 340 }
339 } // namespace test 341 } // namespace test
340 } // namespace webrtc 342 } // namespace webrtc
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698