OLD | NEW |
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 |
11 #include <string> | 11 #include <string> |
12 #include <utility> | 12 #include <utility> |
13 #include <vector> | 13 #include <vector> |
14 | 14 |
15 #include "webrtc/audio/audio_send_stream.h" | 15 #include "webrtc/audio/audio_send_stream.h" |
16 #include "webrtc/audio/audio_state.h" | 16 #include "webrtc/audio/audio_state.h" |
17 #include "webrtc/audio/conversion.h" | 17 #include "webrtc/audio/conversion.h" |
18 #include "webrtc/call/fake_rtp_transport_controller_send.h" | 18 #include "webrtc/call/fake_rtp_transport_controller_send.h" |
19 #include "webrtc/call/rtp_transport_controller_send_interface.h" | 19 #include "webrtc/call/rtp_transport_controller_send_interface.h" |
20 #include "webrtc/logging/rtc_event_log/mock/mock_rtc_event_log.h" | 20 #include "webrtc/logging/rtc_event_log/mock/mock_rtc_event_log.h" |
21 #include "webrtc/modules/audio_mixer/audio_mixer_impl.h" | 21 #include "webrtc/modules/audio_mixer/audio_mixer_impl.h" |
22 #include "webrtc/modules/audio_processing/include/mock_audio_processing.h" | 22 #include "webrtc/modules/audio_processing/include/mock_audio_processing.h" |
23 #include "webrtc/modules/congestion_controller/include/mock/mock_congestion_obse
rver.h" | 23 #include "webrtc/modules/congestion_controller/include/mock/mock_congestion_obse
rver.h" |
24 #include "webrtc/modules/congestion_controller/include/send_side_congestion_cont
roller.h" | 24 #include "webrtc/modules/congestion_controller/include/send_side_congestion_cont
roller.h" |
25 #include "webrtc/modules/pacing/paced_sender.h" | 25 #include "webrtc/modules/pacing/mock/mock_paced_sender.h" |
26 #include "webrtc/modules/rtp_rtcp/mocks/mock_rtcp_rtt_stats.h" | 26 #include "webrtc/modules/rtp_rtcp/mocks/mock_rtcp_rtt_stats.h" |
27 #include "webrtc/modules/rtp_rtcp/mocks/mock_rtp_rtcp.h" | 27 #include "webrtc/modules/rtp_rtcp/mocks/mock_rtp_rtcp.h" |
28 #include "webrtc/rtc_base/ptr_util.h" | 28 #include "webrtc/rtc_base/ptr_util.h" |
29 #include "webrtc/rtc_base/task_queue.h" | 29 #include "webrtc/rtc_base/task_queue.h" |
30 #include "webrtc/test/gtest.h" | 30 #include "webrtc/test/gtest.h" |
31 #include "webrtc/test/mock_audio_encoder.h" | 31 #include "webrtc/test/mock_audio_encoder.h" |
32 #include "webrtc/test/mock_audio_encoder_factory.h" | 32 #include "webrtc/test/mock_audio_encoder_factory.h" |
33 #include "webrtc/test/mock_voe_channel_proxy.h" | 33 #include "webrtc/test/mock_voe_channel_proxy.h" |
34 #include "webrtc/test/mock_voice_engine.h" | 34 #include "webrtc/test/mock_voice_engine.h" |
35 #include "webrtc/voice_engine/transmit_mixer.h" | 35 #include "webrtc/voice_engine/transmit_mixer.h" |
(...skipping 96 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
132 | 132 |
133 struct ConfigHelper { | 133 struct ConfigHelper { |
134 ConfigHelper(bool audio_bwe_enabled, bool expect_set_encoder_call) | 134 ConfigHelper(bool audio_bwe_enabled, bool expect_set_encoder_call) |
135 : stream_config_(nullptr), | 135 : stream_config_(nullptr), |
136 audio_processing_(new rtc::RefCountedObject<MockAudioProcessing>()), | 136 audio_processing_(new rtc::RefCountedObject<MockAudioProcessing>()), |
137 simulated_clock_(123456), | 137 simulated_clock_(123456), |
138 send_side_cc_(rtc::MakeUnique<SendSideCongestionController>( | 138 send_side_cc_(rtc::MakeUnique<SendSideCongestionController>( |
139 &simulated_clock_, | 139 &simulated_clock_, |
140 nullptr /* observer */, | 140 nullptr /* observer */, |
141 &event_log_, | 141 &event_log_, |
142 &packet_router_)), | 142 &pacer_)), |
143 fake_transport_(&packet_router_, send_side_cc_.get()), | 143 fake_transport_(&packet_router_, &pacer_, send_side_cc_.get()), |
144 bitrate_allocator_(&limit_observer_), | 144 bitrate_allocator_(&limit_observer_), |
145 worker_queue_("ConfigHelper_worker_queue"), | 145 worker_queue_("ConfigHelper_worker_queue"), |
146 audio_encoder_(nullptr) { | 146 audio_encoder_(nullptr) { |
147 using testing::Invoke; | 147 using testing::Invoke; |
148 | 148 |
149 EXPECT_CALL(voice_engine_, | 149 EXPECT_CALL(voice_engine_, |
150 RegisterVoiceEngineObserver(_)).WillOnce(Return(0)); | 150 RegisterVoiceEngineObserver(_)).WillOnce(Return(0)); |
151 EXPECT_CALL(voice_engine_, | 151 EXPECT_CALL(voice_engine_, |
152 DeRegisterVoiceEngineObserver()).WillOnce(Return(0)); | 152 DeRegisterVoiceEngineObserver()).WillOnce(Return(0)); |
153 EXPECT_CALL(voice_engine_, audio_device_module()); | 153 EXPECT_CALL(voice_engine_, audio_device_module()); |
(...skipping 174 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
328 private: | 328 private: |
329 testing::StrictMock<MockVoiceEngine> voice_engine_; | 329 testing::StrictMock<MockVoiceEngine> voice_engine_; |
330 rtc::scoped_refptr<AudioState> audio_state_; | 330 rtc::scoped_refptr<AudioState> audio_state_; |
331 AudioSendStream::Config stream_config_; | 331 AudioSendStream::Config stream_config_; |
332 testing::StrictMock<MockVoEChannelProxy>* channel_proxy_ = nullptr; | 332 testing::StrictMock<MockVoEChannelProxy>* channel_proxy_ = nullptr; |
333 rtc::scoped_refptr<MockAudioProcessing> audio_processing_; | 333 rtc::scoped_refptr<MockAudioProcessing> audio_processing_; |
334 MockTransmitMixer transmit_mixer_; | 334 MockTransmitMixer transmit_mixer_; |
335 AudioProcessing::AudioProcessingStatistics audio_processing_stats_; | 335 AudioProcessing::AudioProcessingStatistics audio_processing_stats_; |
336 SimulatedClock simulated_clock_; | 336 SimulatedClock simulated_clock_; |
337 PacketRouter packet_router_; | 337 PacketRouter packet_router_; |
| 338 testing::NiceMock<MockPacedSender> pacer_; |
338 std::unique_ptr<SendSideCongestionController> send_side_cc_; | 339 std::unique_ptr<SendSideCongestionController> send_side_cc_; |
339 FakeRtpTransportControllerSend fake_transport_; | 340 FakeRtpTransportControllerSend fake_transport_; |
340 MockRtcEventLog event_log_; | 341 MockRtcEventLog event_log_; |
341 MockRtpRtcp rtp_rtcp_; | 342 MockRtpRtcp rtp_rtcp_; |
342 MockRtcpRttStats rtcp_rtt_stats_; | 343 MockRtcpRttStats rtcp_rtt_stats_; |
343 testing::NiceMock<MockLimitObserver> limit_observer_; | 344 testing::NiceMock<MockLimitObserver> limit_observer_; |
344 BitrateAllocator bitrate_allocator_; | 345 BitrateAllocator bitrate_allocator_; |
345 // |worker_queue| is defined last to ensure all pending tasks are cancelled | 346 // |worker_queue| is defined last to ensure all pending tasks are cancelled |
346 // and deleted before any other members. | 347 // and deleted before any other members. |
347 rtc::TaskQueue worker_queue_; | 348 rtc::TaskQueue worker_queue_; |
(...skipping 256 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
604 EXPECT_CALL(*helper.channel_proxy(), RegisterSenderCongestionControlObjects( | 605 EXPECT_CALL(*helper.channel_proxy(), RegisterSenderCongestionControlObjects( |
605 helper.transport(), Ne(nullptr))) | 606 helper.transport(), Ne(nullptr))) |
606 .Times(1); | 607 .Times(1); |
607 } | 608 } |
608 send_stream.Reconfigure(new_config); | 609 send_stream.Reconfigure(new_config); |
609 } | 610 } |
610 | 611 |
611 | 612 |
612 } // namespace test | 613 } // namespace test |
613 } // namespace webrtc | 614 } // namespace webrtc |
OLD | NEW |