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

Side by Side Diff: webrtc/video/video_quality_test.cc

Issue 2961723004: Allow an external audio processing module to be used in WebRTC (Closed)
Patch Set: Moved creation of APMs from CreateVoiceEngines Created 3 years, 5 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/test/mock_voice_engine.h ('k') | webrtc/voice_engine/include/voe_base.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 #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
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 1744 matching lines...) Expand 10 before | Expand all | Expand 10 after
1842 void VideoQualityTest::RunWithRenderers(const Params& params) { 1843 void VideoQualityTest::RunWithRenderers(const Params& params) {
1843 params_ = params; 1844 params_ = params;
1844 CheckParams(); 1845 CheckParams();
1845 1846
1846 // TODO(ivica): Remove bitrate_config and use the default Call::Config(), to 1847 // TODO(ivica): Remove bitrate_config and use the default Call::Config(), to
1847 // match the full stack tests. 1848 // match the full stack tests.
1848 Call::Config call_config(event_log_.get()); 1849 Call::Config call_config(event_log_.get());
1849 call_config.bitrate_config = params_.call.call_bitrate_config; 1850 call_config.bitrate_config = params_.call.call_bitrate_config;
1850 1851
1851 ::VoiceEngineState voe; 1852 ::VoiceEngineState voe;
1853 rtc::scoped_refptr<webrtc::AudioProcessing> audio_processing(
1854 webrtc::AudioProcessing::Create());
1855
1852 if (params_.audio.enabled) { 1856 if (params_.audio.enabled) {
1853 CreateVoiceEngine(&voe, decoder_factory_); 1857 CreateVoiceEngine(&voe, audio_processing.get(), decoder_factory_);
1854 AudioState::Config audio_state_config; 1858 AudioState::Config audio_state_config;
1855 audio_state_config.voice_engine = voe.voice_engine; 1859 audio_state_config.voice_engine = voe.voice_engine;
1856 audio_state_config.audio_mixer = AudioMixerImpl::Create(); 1860 audio_state_config.audio_mixer = AudioMixerImpl::Create();
1861 audio_state_config.audio_processing = audio_processing;
1857 call_config.audio_state = AudioState::Create(audio_state_config); 1862 call_config.audio_state = AudioState::Create(audio_state_config);
1858 } 1863 }
1859 1864
1860 CreateCalls(call_config, call_config); 1865 CreateCalls(call_config, call_config);
1861 1866
1862 // TODO(minyue): consider if this is a good transport even for audio only 1867 // TODO(minyue): consider if this is a good transport even for audio only
1863 // calls. 1868 // calls.
1864 test::LayerFilteringTransport send_transport( 1869 test::LayerFilteringTransport send_transport(
1865 params.pipe, sender_call_.get(), kPayloadTypeVP8, kPayloadTypeVP9, 1870 params.pipe, sender_call_.get(), kPayloadTypeVP8, kPayloadTypeVP9,
1866 params.video.selected_tl, params_.ss.selected_sl, payload_type_map_); 1871 params.video.selected_tl, params_.ss.selected_sl, payload_type_map_);
(...skipping 145 matching lines...) Expand 10 before | Expand all | Expand 10 after
2012 if (!params_.video.encoded_frame_base_path.empty()) { 2017 if (!params_.video.encoded_frame_base_path.empty()) {
2013 std::ostringstream str; 2018 std::ostringstream str;
2014 str << receive_logs_++; 2019 str << receive_logs_++;
2015 std::string path = 2020 std::string path =
2016 params_.video.encoded_frame_base_path + "." + str.str() + ".recv.ivf"; 2021 params_.video.encoded_frame_base_path + "." + str.str() + ".recv.ivf";
2017 stream->EnableEncodedFrameRecording(rtc::CreatePlatformFile(path), 2022 stream->EnableEncodedFrameRecording(rtc::CreatePlatformFile(path),
2018 10000000); 2023 10000000);
2019 } 2024 }
2020 } 2025 }
2021 } // namespace webrtc 2026 } // namespace webrtc
OLDNEW
« no previous file with comments | « webrtc/test/mock_voice_engine.h ('k') | webrtc/voice_engine/include/voe_base.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698