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

Side by Side Diff: webrtc/call/call_perf_tests.cc

Issue 2469743002: Passed AudioMixer to AudioState::Config. (Closed)
Patch Set: Rebase. GYP removed! Created 4 years, 1 month 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/call/DEPS ('k') | webrtc/call/call_unittest.cc » ('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) 2013 The WebRTC project authors. All Rights Reserved. 2 * Copyright (c) 2013 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 <algorithm> 11 #include <algorithm>
12 #include <limits> 12 #include <limits>
13 #include <memory> 13 #include <memory>
14 #include <string> 14 #include <string>
15 15
16 #include "webrtc/base/checks.h" 16 #include "webrtc/base/checks.h"
17 #include "webrtc/base/constructormagic.h" 17 #include "webrtc/base/constructormagic.h"
18 #include "webrtc/base/thread_annotations.h" 18 #include "webrtc/base/thread_annotations.h"
19 #include "webrtc/call.h" 19 #include "webrtc/call.h"
20 #include "webrtc/config.h" 20 #include "webrtc/config.h"
21 #include "webrtc/logging/rtc_event_log/rtc_event_log.h" 21 #include "webrtc/logging/rtc_event_log/rtc_event_log.h"
22 #include "webrtc/modules/audio_coding/include/audio_coding_module.h" 22 #include "webrtc/modules/audio_coding/include/audio_coding_module.h"
23 #include "webrtc/modules/audio_mixer/audio_mixer_impl.h"
23 #include "webrtc/modules/rtp_rtcp/include/rtp_header_parser.h" 24 #include "webrtc/modules/rtp_rtcp/include/rtp_header_parser.h"
24 #include "webrtc/system_wrappers/include/critical_section_wrapper.h" 25 #include "webrtc/system_wrappers/include/critical_section_wrapper.h"
25 #include "webrtc/system_wrappers/include/metrics_default.h" 26 #include "webrtc/system_wrappers/include/metrics_default.h"
26 #include "webrtc/system_wrappers/include/rtp_to_ntp.h" 27 #include "webrtc/system_wrappers/include/rtp_to_ntp.h"
27 #include "webrtc/test/call_test.h" 28 #include "webrtc/test/call_test.h"
28 #include "webrtc/test/direct_transport.h" 29 #include "webrtc/test/direct_transport.h"
29 #include "webrtc/test/drifting_clock.h" 30 #include "webrtc/test/drifting_clock.h"
30 #include "webrtc/test/encoder_settings.h" 31 #include "webrtc/test/encoder_settings.h"
31 #include "webrtc/test/fake_audio_device.h" 32 #include "webrtc/test/fake_audio_device.h"
32 #include "webrtc/test/fake_decoder.h" 33 #include "webrtc/test/fake_decoder.h"
(...skipping 119 matching lines...) Expand 10 before | Expand all | Expand 10 after
152 FakeAudioDevice fake_audio_device(Clock::GetRealTimeClock(), audio_filename, 153 FakeAudioDevice fake_audio_device(Clock::GetRealTimeClock(), audio_filename,
153 audio_rtp_speed); 154 audio_rtp_speed);
154 EXPECT_EQ(0, voe_base->Init(&fake_audio_device, nullptr, decoder_factory_)); 155 EXPECT_EQ(0, voe_base->Init(&fake_audio_device, nullptr, decoder_factory_));
155 VoEBase::ChannelConfig config; 156 VoEBase::ChannelConfig config;
156 config.enable_voice_pacing = true; 157 config.enable_voice_pacing = true;
157 int send_channel_id = voe_base->CreateChannel(config); 158 int send_channel_id = voe_base->CreateChannel(config);
158 int recv_channel_id = voe_base->CreateChannel(); 159 int recv_channel_id = voe_base->CreateChannel();
159 160
160 AudioState::Config send_audio_state_config; 161 AudioState::Config send_audio_state_config;
161 send_audio_state_config.voice_engine = voice_engine; 162 send_audio_state_config.voice_engine = voice_engine;
163 send_audio_state_config.audio_mixer = AudioMixerImpl::Create();
162 Call::Config sender_config(&event_log_); 164 Call::Config sender_config(&event_log_);
163 sender_config.audio_state = AudioState::Create(send_audio_state_config); 165 sender_config.audio_state = AudioState::Create(send_audio_state_config);
164 Call::Config receiver_config(&event_log_); 166 Call::Config receiver_config(&event_log_);
165 receiver_config.audio_state = sender_config.audio_state; 167 receiver_config.audio_state = sender_config.audio_state;
166 CreateCalls(sender_config, receiver_config); 168 CreateCalls(sender_config, receiver_config);
167 169
168 170
169 VideoRtcpAndSyncObserver observer(Clock::GetRealTimeClock()); 171 VideoRtcpAndSyncObserver observer(Clock::GetRealTimeClock());
170 172
171 // Helper class to ensure we deliver correct media_type to the receiving call. 173 // Helper class to ensure we deliver correct media_type to the receiving call.
(...skipping 85 matching lines...) Expand 10 before | Expand all | Expand 10 after
257 EXPECT_EQ(1u, video_receive_streams_.size()); 259 EXPECT_EQ(1u, video_receive_streams_.size());
258 observer.set_receive_stream(video_receive_streams_[0]); 260 observer.set_receive_stream(video_receive_streams_[0]);
259 DriftingClock drifting_clock(clock_, video_ntp_speed); 261 DriftingClock drifting_clock(clock_, video_ntp_speed);
260 CreateFrameGeneratorCapturerWithDrift(&drifting_clock, video_rtp_speed, 262 CreateFrameGeneratorCapturerWithDrift(&drifting_clock, video_rtp_speed,
261 kDefaultFramerate, kDefaultWidth, 263 kDefaultFramerate, kDefaultWidth,
262 kDefaultHeight); 264 kDefaultHeight);
263 265
264 Start(); 266 Start();
265 267
266 fake_audio_device.Start(); 268 fake_audio_device.Start();
267 EXPECT_EQ(0, voe_base->StartPlayout(recv_channel_id)); 269 audio_receive_stream->Start();
268 EXPECT_EQ(0, voe_base->StartSend(send_channel_id)); 270 EXPECT_EQ(0, voe_base->StartSend(send_channel_id));
269 271
270 EXPECT_TRUE(observer.Wait()) 272 EXPECT_TRUE(observer.Wait())
271 << "Timed out while waiting for audio and video to be synchronized."; 273 << "Timed out while waiting for audio and video to be synchronized.";
272 274
273 EXPECT_EQ(0, voe_base->StopSend(send_channel_id)); 275 EXPECT_EQ(0, voe_base->StopSend(send_channel_id));
274 EXPECT_EQ(0, voe_base->StopPlayout(recv_channel_id)); 276 EXPECT_EQ(0, voe_base->StopPlayout(recv_channel_id));
275 fake_audio_device.Stop(); 277 fake_audio_device.Stop();
276 278
277 Stop(); 279 Stop();
(...skipping 449 matching lines...) Expand 10 before | Expand all | Expand 10 after
727 uint32_t last_set_bitrate_kbps_; 729 uint32_t last_set_bitrate_kbps_;
728 VideoSendStream* send_stream_; 730 VideoSendStream* send_stream_;
729 test::FrameGeneratorCapturer* frame_generator_; 731 test::FrameGeneratorCapturer* frame_generator_;
730 VideoEncoderConfig encoder_config_; 732 VideoEncoderConfig encoder_config_;
731 } test; 733 } test;
732 734
733 RunBaseTest(&test); 735 RunBaseTest(&test);
734 } 736 }
735 737
736 } // namespace webrtc 738 } // namespace webrtc
OLDNEW
« no previous file with comments | « webrtc/call/DEPS ('k') | webrtc/call/call_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698