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 #include "webrtc/video/video_quality_test.h" | 10 #include "webrtc/video/video_quality_test.h" |
(...skipping 61 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
72 base(nullptr), | 72 base(nullptr), |
73 send_channel_id(-1), | 73 send_channel_id(-1), |
74 receive_channel_id(-1) {} | 74 receive_channel_id(-1) {} |
75 | 75 |
76 webrtc::VoiceEngine* voice_engine; | 76 webrtc::VoiceEngine* voice_engine; |
77 webrtc::VoEBase* base; | 77 webrtc::VoEBase* base; |
78 int send_channel_id; | 78 int send_channel_id; |
79 int receive_channel_id; | 79 int receive_channel_id; |
80 }; | 80 }; |
81 | 81 |
82 void CreateVoiceEngine(VoiceEngineState* voe, | 82 void CreateVoiceEngine( |
83 rtc::scoped_refptr<webrtc::AudioDecoderFactory> | 83 VoiceEngineState* voe, |
84 decoder_factory) { | 84 webrtc::AudioProcessing* apm, |
| 85 rtc::scoped_refptr<webrtc::AudioDecoderFactory> decoder_factory) { |
85 voe->voice_engine = webrtc::VoiceEngine::Create(); | 86 voe->voice_engine = webrtc::VoiceEngine::Create(); |
86 voe->base = webrtc::VoEBase::GetInterface(voe->voice_engine); | 87 voe->base = webrtc::VoEBase::GetInterface(voe->voice_engine); |
87 EXPECT_EQ(0, voe->base->Init(nullptr, nullptr, decoder_factory)); | 88 EXPECT_EQ(0, voe->base->Init(nullptr, apm, decoder_factory)); |
88 webrtc::VoEBase::ChannelConfig config; | 89 webrtc::VoEBase::ChannelConfig config; |
89 config.enable_voice_pacing = true; | 90 config.enable_voice_pacing = true; |
90 voe->send_channel_id = voe->base->CreateChannel(config); | 91 voe->send_channel_id = voe->base->CreateChannel(config); |
91 EXPECT_GE(voe->send_channel_id, 0); | 92 EXPECT_GE(voe->send_channel_id, 0); |
92 voe->receive_channel_id = voe->base->CreateChannel(); | 93 voe->receive_channel_id = voe->base->CreateChannel(); |
93 EXPECT_GE(voe->receive_channel_id, 0); | 94 EXPECT_GE(voe->receive_channel_id, 0); |
94 } | 95 } |
95 | 96 |
96 void DestroyVoiceEngine(VoiceEngineState* voe) { | 97 void DestroyVoiceEngine(VoiceEngineState* voe) { |
97 voe->base->DeleteChannel(voe->send_channel_id); | 98 voe->base->DeleteChannel(voe->send_channel_id); |
(...skipping 1742 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1840 void VideoQualityTest::RunWithRenderers(const Params& params) { | 1841 void VideoQualityTest::RunWithRenderers(const Params& params) { |
1841 params_ = params; | 1842 params_ = params; |
1842 CheckParams(); | 1843 CheckParams(); |
1843 | 1844 |
1844 // TODO(ivica): Remove bitrate_config and use the default Call::Config(), to | 1845 // TODO(ivica): Remove bitrate_config and use the default Call::Config(), to |
1845 // match the full stack tests. | 1846 // match the full stack tests. |
1846 Call::Config call_config(event_log_.get()); | 1847 Call::Config call_config(event_log_.get()); |
1847 call_config.bitrate_config = params_.call.call_bitrate_config; | 1848 call_config.bitrate_config = params_.call.call_bitrate_config; |
1848 | 1849 |
1849 ::VoiceEngineState voe; | 1850 ::VoiceEngineState voe; |
| 1851 rtc::scoped_refptr<webrtc::AudioProcessing> audio_processing( |
| 1852 webrtc::AudioProcessing::Create()); |
| 1853 |
1850 if (params_.audio.enabled) { | 1854 if (params_.audio.enabled) { |
1851 CreateVoiceEngine(&voe, decoder_factory_); | 1855 CreateVoiceEngine(&voe, audio_processing.get(), decoder_factory_); |
1852 AudioState::Config audio_state_config; | 1856 AudioState::Config audio_state_config; |
1853 audio_state_config.voice_engine = voe.voice_engine; | 1857 audio_state_config.voice_engine = voe.voice_engine; |
1854 audio_state_config.audio_mixer = AudioMixerImpl::Create(); | 1858 audio_state_config.audio_mixer = AudioMixerImpl::Create(); |
| 1859 audio_state_config.audio_processing = audio_processing; |
1855 call_config.audio_state = AudioState::Create(audio_state_config); | 1860 call_config.audio_state = AudioState::Create(audio_state_config); |
1856 } | 1861 } |
1857 | 1862 |
1858 CreateCalls(call_config, call_config); | 1863 CreateCalls(call_config, call_config); |
1859 | 1864 |
1860 // TODO(minyue): consider if this is a good transport even for audio only | 1865 // TODO(minyue): consider if this is a good transport even for audio only |
1861 // calls. | 1866 // calls. |
1862 test::LayerFilteringTransport send_transport( | 1867 test::LayerFilteringTransport send_transport( |
1863 params.pipe, sender_call_.get(), kPayloadTypeVP8, kPayloadTypeVP9, | 1868 params.pipe, sender_call_.get(), kPayloadTypeVP8, kPayloadTypeVP9, |
1864 params.video.selected_tl, params_.ss.selected_sl, payload_type_map_); | 1869 params.video.selected_tl, params_.ss.selected_sl, payload_type_map_); |
(...skipping 145 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2010 if (!params_.video.encoded_frame_base_path.empty()) { | 2015 if (!params_.video.encoded_frame_base_path.empty()) { |
2011 std::ostringstream str; | 2016 std::ostringstream str; |
2012 str << receive_logs_++; | 2017 str << receive_logs_++; |
2013 std::string path = | 2018 std::string path = |
2014 params_.video.encoded_frame_base_path + "." + str.str() + ".recv.ivf"; | 2019 params_.video.encoded_frame_base_path + "." + str.str() + ".recv.ivf"; |
2015 stream->EnableEncodedFrameRecording(rtc::CreatePlatformFile(path), | 2020 stream->EnableEncodedFrameRecording(rtc::CreatePlatformFile(path), |
2016 10000000); | 2021 10000000); |
2017 } | 2022 } |
2018 } | 2023 } |
2019 } // namespace webrtc | 2024 } // namespace webrtc |
OLD | NEW |