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

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: format 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_receive_stream.cc ('k') | webrtc/audio_receive_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 67 matching lines...) Expand 10 before | Expand all | Expand 10 after
78 DeRegisterVoiceEngineObserver()).WillOnce(Return(0)); 78 DeRegisterVoiceEngineObserver()).WillOnce(Return(0));
79 AudioState::Config config; 79 AudioState::Config config;
80 config.voice_engine = &voice_engine_; 80 config.voice_engine = &voice_engine_;
81 audio_state_ = AudioState::Create(config); 81 audio_state_ = AudioState::Create(config);
82 82
83 EXPECT_CALL(voice_engine_, ChannelProxyFactory(kChannelId)) 83 EXPECT_CALL(voice_engine_, ChannelProxyFactory(kChannelId))
84 .WillOnce(Invoke([this](int channel_id) { 84 .WillOnce(Invoke([this](int channel_id) {
85 EXPECT_FALSE(channel_proxy_); 85 EXPECT_FALSE(channel_proxy_);
86 channel_proxy_ = new testing::StrictMock<MockVoEChannelProxy>(); 86 channel_proxy_ = new testing::StrictMock<MockVoEChannelProxy>();
87 EXPECT_CALL(*channel_proxy_, SetLocalSSRC(kLocalSsrc)).Times(1); 87 EXPECT_CALL(*channel_proxy_, SetLocalSSRC(kLocalSsrc)).Times(1);
88 EXPECT_CALL(*channel_proxy_, SetNACKStatus(true, 15)).Times(1);
88 EXPECT_CALL(*channel_proxy_, 89 EXPECT_CALL(*channel_proxy_,
89 SetReceiveAbsoluteSenderTimeStatus(true, kAbsSendTimeId)) 90 SetReceiveAbsoluteSenderTimeStatus(true, kAbsSendTimeId))
90 .Times(1); 91 .Times(1);
91 EXPECT_CALL(*channel_proxy_, 92 EXPECT_CALL(*channel_proxy_,
92 SetReceiveAudioLevelIndicationStatus(true, kAudioLevelId)) 93 SetReceiveAudioLevelIndicationStatus(true, kAudioLevelId))
93 .Times(1); 94 .Times(1);
94 EXPECT_CALL(*channel_proxy_, EnableReceiveTransportSequenceNumber( 95 EXPECT_CALL(*channel_proxy_, EnableReceiveTransportSequenceNumber(
95 kTransportSequenceNumberId)) 96 kTransportSequenceNumberId))
96 .Times(1); 97 .Times(1);
97 EXPECT_CALL(*channel_proxy_, 98 EXPECT_CALL(*channel_proxy_,
98 RegisterReceiverCongestionControlObjects(&packet_router_)) 99 RegisterReceiverCongestionControlObjects(&packet_router_))
99 .Times(1); 100 .Times(1);
100 EXPECT_CALL(congestion_controller_, packet_router()) 101 EXPECT_CALL(congestion_controller_, packet_router())
101 .WillOnce(Return(&packet_router_)); 102 .WillOnce(Return(&packet_router_));
102 EXPECT_CALL(*channel_proxy_, ResetCongestionControlObjects()) 103 EXPECT_CALL(*channel_proxy_, ResetCongestionControlObjects())
103 .Times(1); 104 .Times(1);
104 EXPECT_CALL(*channel_proxy_, RegisterExternalTransport(nullptr)) 105 EXPECT_CALL(*channel_proxy_, RegisterExternalTransport(nullptr))
105 .Times(1); 106 .Times(1);
106 EXPECT_CALL(*channel_proxy_, DeRegisterExternalTransport()) 107 EXPECT_CALL(*channel_proxy_, DeRegisterExternalTransport())
107 .Times(1); 108 .Times(1);
108 EXPECT_CALL(*channel_proxy_, GetAudioDecoderFactory()) 109 EXPECT_CALL(*channel_proxy_, GetAudioDecoderFactory())
109 .WillOnce(ReturnRef(decoder_factory_)); 110 .WillOnce(ReturnRef(decoder_factory_));
110 return channel_proxy_; 111 return channel_proxy_;
111 })); 112 }));
112 stream_config_.voe_channel_id = kChannelId; 113 stream_config_.voe_channel_id = kChannelId;
113 stream_config_.rtp.local_ssrc = kLocalSsrc; 114 stream_config_.rtp.local_ssrc = kLocalSsrc;
114 stream_config_.rtp.remote_ssrc = kRemoteSsrc; 115 stream_config_.rtp.remote_ssrc = kRemoteSsrc;
116 stream_config_.rtp.nack.rtp_history_ms = 300;
115 stream_config_.rtp.extensions.push_back( 117 stream_config_.rtp.extensions.push_back(
116 RtpExtension(RtpExtension::kAbsSendTimeUri, kAbsSendTimeId)); 118 RtpExtension(RtpExtension::kAbsSendTimeUri, kAbsSendTimeId));
117 stream_config_.rtp.extensions.push_back( 119 stream_config_.rtp.extensions.push_back(
118 RtpExtension(RtpExtension::kAudioLevelUri, kAudioLevelId)); 120 RtpExtension(RtpExtension::kAudioLevelUri, kAudioLevelId));
119 stream_config_.rtp.extensions.push_back(RtpExtension( 121 stream_config_.rtp.extensions.push_back(RtpExtension(
120 RtpExtension::kTransportSequenceNumberUri, kTransportSequenceNumberId)); 122 RtpExtension::kTransportSequenceNumberUri, kTransportSequenceNumberId));
121 stream_config_.decoder_factory = decoder_factory_; 123 stream_config_.decoder_factory = decoder_factory_;
122 } 124 }
123 125
124 MockCongestionController* congestion_controller() { 126 MockCongestionController* congestion_controller() {
(...skipping 102 matching lines...) Expand 10 before | Expand all | Expand 10 after
227 } // namespace 229 } // namespace
228 230
229 TEST(AudioReceiveStreamTest, ConfigToString) { 231 TEST(AudioReceiveStreamTest, ConfigToString) {
230 AudioReceiveStream::Config config; 232 AudioReceiveStream::Config config;
231 config.rtp.remote_ssrc = kRemoteSsrc; 233 config.rtp.remote_ssrc = kRemoteSsrc;
232 config.rtp.local_ssrc = kLocalSsrc; 234 config.rtp.local_ssrc = kLocalSsrc;
233 config.rtp.extensions.push_back( 235 config.rtp.extensions.push_back(
234 RtpExtension(RtpExtension::kAbsSendTimeUri, kAbsSendTimeId)); 236 RtpExtension(RtpExtension::kAbsSendTimeUri, kAbsSendTimeId));
235 config.voe_channel_id = kChannelId; 237 config.voe_channel_id = kChannelId;
236 EXPECT_EQ( 238 EXPECT_EQ(
237 "{rtp: {remote_ssrc: 1234, local_ssrc: 5678, extensions: [{uri: " 239 "{rtp: {remote_ssrc: 1234, local_ssrc: 5678, transport_cc: off, "
238 "http://www.webrtc.org/experiments/rtp-hdrext/abs-send-time, id: 2}], " 240 "nack: {rtp_history_ms: 0}, extensions: [{uri: "
239 "transport_cc: off}, " 241 "http://www.webrtc.org/experiments/rtp-hdrext/abs-send-time, id: 2}]}, "
240 "rtcp_send_transport: nullptr, " 242 "rtcp_send_transport: nullptr, "
241 "voe_channel_id: 2}", 243 "voe_channel_id: 2}",
242 config.ToString()); 244 config.ToString());
243 } 245 }
244 246
245 TEST(AudioReceiveStreamTest, ConstructDestruct) { 247 TEST(AudioReceiveStreamTest, ConstructDestruct) {
246 ConfigHelper helper; 248 ConfigHelper helper;
247 internal::AudioReceiveStream recv_stream( 249 internal::AudioReceiveStream recv_stream(
248 helper.congestion_controller(), helper.config(), helper.audio_state()); 250 helper.congestion_controller(), helper.config(), helper.audio_state());
249 } 251 }
(...skipping 88 matching lines...) Expand 10 before | Expand all | Expand 10 after
338 EXPECT_EQ(kAudioDecodeStats.calls_to_neteq, stats.decoding_calls_to_neteq); 340 EXPECT_EQ(kAudioDecodeStats.calls_to_neteq, stats.decoding_calls_to_neteq);
339 EXPECT_EQ(kAudioDecodeStats.decoded_normal, stats.decoding_normal); 341 EXPECT_EQ(kAudioDecodeStats.decoded_normal, stats.decoding_normal);
340 EXPECT_EQ(kAudioDecodeStats.decoded_plc, stats.decoding_plc); 342 EXPECT_EQ(kAudioDecodeStats.decoded_plc, stats.decoding_plc);
341 EXPECT_EQ(kAudioDecodeStats.decoded_cng, stats.decoding_cng); 343 EXPECT_EQ(kAudioDecodeStats.decoded_cng, stats.decoding_cng);
342 EXPECT_EQ(kAudioDecodeStats.decoded_plc_cng, stats.decoding_plc_cng); 344 EXPECT_EQ(kAudioDecodeStats.decoded_plc_cng, stats.decoding_plc_cng);
343 EXPECT_EQ(kCallStats.capture_start_ntp_time_ms_, 345 EXPECT_EQ(kCallStats.capture_start_ntp_time_ms_,
344 stats.capture_start_ntp_time_ms); 346 stats.capture_start_ntp_time_ms);
345 } 347 }
346 } // namespace test 348 } // namespace test
347 } // namespace webrtc 349 } // namespace webrtc
OLDNEW
« no previous file with comments | « webrtc/audio/audio_receive_stream.cc ('k') | webrtc/audio_receive_stream.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698