From 88499ecaca050be2dd21fff17140d6681c3bac95 Mon Sep 17 00:00:00 2001 From: solenberg Date: Wed, 7 Sep 2016 07:34:41 -0700 Subject: [PATCH] Moving/renaming webrtc/common.h. This file defines webrtc::Config which was mostly used by modules/audio_processing. The files webrtc/common.h, webrtc/common.cc and webrtc/test/common_unittests.cc are moved to modules/audio_processing and the few remaining uses of webrtc::Config are replaced with simpler code. - For NetEq and pacing configuration, a VoEBase::ChannelConfig is passed to VoEBase::CreateChannel(). - Removes the need for VoiceEngine::Create(const Config& config). No need to store the webrtc::Config in VoE shared state. BUG=webrtc:5879 Review-Url: https://codereview.webrtc.org/2307533004 Cr-Commit-Position: refs/heads/master@{#14109} --- webrtc/BUILD.gn | 3 -- webrtc/call/call_perf_tests.cc | 6 ++-- webrtc/common.gyp | 2 -- webrtc/common_types.h | 2 -- webrtc/config.h | 30 ---------------- webrtc/media/engine/fakewebrtcvoiceengine.h | 36 ++++++++----------- webrtc/media/engine/webrtcvoiceengine.cc | 16 ++++----- webrtc/media/engine/webrtcvoiceengine.h | 3 +- webrtc/modules/BUILD.gn | 1 + webrtc/modules/audio_coding/test/APITest.cc | 3 +- webrtc/modules/audio_coding/test/APITest.h | 4 +-- .../audio_coding/test/PacketLossTest.cc | 1 - .../modules/audio_coding/test/TestAllCodecs.h | 2 -- .../modules/audio_coding/test/TestRedFec.cc | 1 - webrtc/modules/audio_coding/test/TestRedFec.h | 2 -- .../modules/audio_coding/test/delay_test.cc | 1 - webrtc/modules/audio_coding/test/utility.cc | 1 - webrtc/modules/audio_coding/test/utility.h | 4 --- webrtc/modules/audio_processing/BUILD.gn | 2 ++ .../audio_processing/audio_processing.gypi | 2 ++ .../audio_processing/config_unittest.cc} | 2 +- .../include/audio_processing.h | 2 +- .../audio_processing/include/config.cc} | 2 +- .../audio_processing/include/config.h} | 15 ++++---- .../audio_processing/test/process_test.cc | 2 +- webrtc/modules/modules.gyp | 1 + webrtc/test/BUILD.gn | 1 - webrtc/test/call_test.cc | 7 ++-- webrtc/test/mock_voice_engine.h | 5 ++- webrtc/test/test.gyp | 1 - webrtc/video/video_quality_test.cc | 6 ++-- webrtc/video/video_stream_decoder.h | 1 - webrtc/voice_engine/channel.cc | 25 ++++--------- webrtc/voice_engine/channel.h | 8 ++--- webrtc/voice_engine/channel_manager.cc | 22 +++--------- webrtc/voice_engine/channel_manager.h | 23 +++--------- webrtc/voice_engine/include/voe_base.h | 18 ++++++---- webrtc/voice_engine/shared_data.cc | 4 +-- webrtc/voice_engine/shared_data.h | 5 +-- .../fixtures/before_initialization_fixture.h | 4 --- webrtc/voice_engine/voe_base_impl.cc | 18 ++++------ webrtc/voice_engine/voe_base_impl.h | 2 +- webrtc/voice_engine/voice_engine_impl.cc | 11 ++---- webrtc/voice_engine/voice_engine_impl.h | 10 ++---- 44 files changed, 96 insertions(+), 221 deletions(-) rename webrtc/{test/common_unittest.cc => modules/audio_processing/config_unittest.cc} (97%) rename webrtc/{common.cc => modules/audio_processing/include/config.cc} (91%) rename webrtc/{common.h => modules/audio_processing/include/config.h} (91%) diff --git a/webrtc/BUILD.gn b/webrtc/BUILD.gn index f42cc24646..f9845a3843 100644 --- a/webrtc/BUILD.gn +++ b/webrtc/BUILD.gn @@ -325,9 +325,6 @@ if (!build_with_chromium) { rtc_source_set("webrtc_common") { sources = [ - "audio_sink.h", - "common.cc", - "common.h", "common_types.cc", "common_types.h", "config.cc", diff --git a/webrtc/call/call_perf_tests.cc b/webrtc/call/call_perf_tests.cc index 81fbdb7d49..b980a5e5c7 100644 --- a/webrtc/call/call_perf_tests.cc +++ b/webrtc/call/call_perf_tests.cc @@ -159,9 +159,9 @@ void CallPerfTest::TestAudioVideoSync(FecMode fec, FakeAudioDevice fake_audio_device(Clock::GetRealTimeClock(), audio_filename, audio_rtp_speed); EXPECT_EQ(0, voe_base->Init(&fake_audio_device, nullptr, decoder_factory_)); - Config voe_config; - voe_config.Set(new VoicePacing(true)); - int send_channel_id = voe_base->CreateChannel(voe_config); + VoEBase::ChannelConfig config; + config.enable_voice_pacing = true; + int send_channel_id = voe_base->CreateChannel(config); int recv_channel_id = voe_base->CreateChannel(); AudioState::Config send_audio_state_config; diff --git a/webrtc/common.gyp b/webrtc/common.gyp index e5d41da7c4..3b5fe902dd 100644 --- a/webrtc/common.gyp +++ b/webrtc/common.gyp @@ -12,8 +12,6 @@ 'target_name': 'webrtc_common', 'type': 'static_library', 'sources': [ - 'common.cc', - 'common.h', 'common_types.cc', 'common_types.h', 'config.h', diff --git a/webrtc/common_types.h b/webrtc/common_types.h index 1ef5f91674..ea040fdb5c 100644 --- a/webrtc/common_types.h +++ b/webrtc/common_types.h @@ -52,8 +52,6 @@ namespace webrtc { -class Config; - class RewindableStream { public: virtual ~RewindableStream() {} diff --git a/webrtc/config.h b/webrtc/config.h index d932eda1df..9303f548e7 100644 --- a/webrtc/config.h +++ b/webrtc/config.h @@ -17,7 +17,6 @@ #include #include "webrtc/base/optional.h" -#include "webrtc/common.h" #include "webrtc/common_types.h" #include "webrtc/typedefs.h" @@ -170,35 +169,6 @@ class DecoderSpecificSettings { rtc::Optional h264_extra_settings; }; -// Controls the capacity of the packet buffer in NetEq. The capacity is the -// maximum number of packets that the buffer can contain. If the limit is -// exceeded, the buffer will be flushed. The capacity does not affect the actual -// audio delay in the general case, since this is governed by the target buffer -// level (calculated from the jitter profile). It is only in the rare case of -// severe network freezes that a higher capacity will lead to a (transient) -// increase in audio delay. -struct NetEqCapacityConfig { - NetEqCapacityConfig() : enabled(false), capacity(0) {} - explicit NetEqCapacityConfig(int value) : enabled(true), capacity(value) {} - static const ConfigOptionID identifier = ConfigOptionID::kNetEqCapacityConfig; - bool enabled; - int capacity; -}; - -struct NetEqFastAccelerate { - NetEqFastAccelerate() : enabled(false) {} - explicit NetEqFastAccelerate(bool value) : enabled(value) {} - static const ConfigOptionID identifier = ConfigOptionID::kNetEqFastAccelerate; - bool enabled; -}; - -struct VoicePacing { - VoicePacing() : enabled(false) {} - explicit VoicePacing(bool value) : enabled(value) {} - static const ConfigOptionID identifier = ConfigOptionID::kVoicePacing; - bool enabled; -}; - } // namespace webrtc #endif // WEBRTC_CONFIG_H_ diff --git a/webrtc/media/engine/fakewebrtcvoiceengine.h b/webrtc/media/engine/fakewebrtcvoiceengine.h index 9b5440c17b..33ea7cafc5 100644 --- a/webrtc/media/engine/fakewebrtcvoiceengine.h +++ b/webrtc/media/engine/fakewebrtcvoiceengine.h @@ -154,7 +154,7 @@ class FakeWebRtcVoiceEngine int associate_send_channel = -1; std::vector recv_codecs; webrtc::CodecInst send_codec; - int neteq_capacity = -1; + size_t neteq_capacity = 0; bool neteq_fast_accelerate = false; }; @@ -190,21 +190,6 @@ class FakeWebRtcVoiceEngine void set_fail_create_channel(bool fail_create_channel) { fail_create_channel_ = fail_create_channel; } - int AddChannel(const webrtc::Config& config) { - if (fail_create_channel_) { - return -1; - } - Channel* ch = new Channel(); - auto db = webrtc::acm2::RentACodec::Database(); - ch->recv_codecs.assign(db.begin(), db.end()); - if (config.Get().enabled) { - ch->neteq_capacity = config.Get().capacity; - } - ch->neteq_fast_accelerate = - config.Get().enabled; - channels_[++last_channel_] = ch; - return last_channel_; - } int GetNumSetSendCodecs() const { return num_set_send_codecs_; } @@ -237,11 +222,20 @@ class FakeWebRtcVoiceEngine return nullptr; } WEBRTC_FUNC(CreateChannel, ()) { - webrtc::Config empty_config; - return AddChannel(empty_config); + return CreateChannel(webrtc::VoEBase::ChannelConfig()); } - WEBRTC_FUNC(CreateChannel, (const webrtc::Config& config)) { - return AddChannel(config); + WEBRTC_FUNC(CreateChannel, (const webrtc::VoEBase::ChannelConfig& config)) { + if (fail_create_channel_) { + return -1; + } + Channel* ch = new Channel(); + auto db = webrtc::acm2::RentACodec::Database(); + ch->recv_codecs.assign(db.begin(), db.end()); + ch->neteq_capacity = config.acm_config.neteq_config.max_packets_in_buffer; + ch->neteq_fast_accelerate = + config.acm_config.neteq_config.enable_fast_accelerate; + channels_[++last_channel_] = ch; + return last_channel_; } WEBRTC_FUNC(DeleteChannel, (int channel)) { WEBRTC_CHECK_CHANNEL(channel); @@ -547,7 +541,7 @@ class FakeWebRtcVoiceEngine void EnableStereoChannelSwapping(bool enable) override { stereo_swapping_enabled_ = enable; } - int GetNetEqCapacity() const { + size_t GetNetEqCapacity() const { auto ch = channels_.find(last_channel_); ASSERT(ch != channels_.end()); return ch->second->neteq_capacity; diff --git a/webrtc/media/engine/webrtcvoiceengine.cc b/webrtc/media/engine/webrtcvoiceengine.cc index 0169d5a23a..29924114b4 100644 --- a/webrtc/media/engine/webrtcvoiceengine.cc +++ b/webrtc/media/engine/webrtcvoiceengine.cc @@ -29,7 +29,6 @@ #include "webrtc/base/stringencode.h" #include "webrtc/base/stringutils.h" #include "webrtc/base/trace_event.h" -#include "webrtc/common.h" #include "webrtc/media/base/audiosource.h" #include "webrtc/media/base/mediaconstants.h" #include "webrtc/media/base/streamparams.h" @@ -538,7 +537,7 @@ WebRtcVoiceEngine::WebRtcVoiceEngine( LOG(LS_INFO) << ToString(codec); } - voe_config_.Set(new webrtc::VoicePacing(true)); + channel_config_.enable_voice_pacing = true; // Temporarily turn logging level up for the Init() call. webrtc::Trace::SetTraceCallback(this); @@ -802,17 +801,14 @@ bool WebRtcVoiceEngine::ApplyOptions(const AudioOptions& options_in) { if (options.audio_jitter_buffer_max_packets) { LOG(LS_INFO) << "NetEq capacity is " << *options.audio_jitter_buffer_max_packets; - voe_config_.Set( - new webrtc::NetEqCapacityConfig( - *options.audio_jitter_buffer_max_packets)); + channel_config_.acm_config.neteq_config.max_packets_in_buffer = + std::max(20, *options.audio_jitter_buffer_max_packets); } - if (options.audio_jitter_buffer_fast_accelerate) { LOG(LS_INFO) << "NetEq fast mode? " << *options.audio_jitter_buffer_fast_accelerate; - voe_config_.Set( - new webrtc::NetEqFastAccelerate( - *options.audio_jitter_buffer_fast_accelerate)); + channel_config_.acm_config.neteq_config.enable_fast_accelerate = + *options.audio_jitter_buffer_fast_accelerate; } if (options.typing_detection) { @@ -1076,7 +1072,7 @@ void WebRtcVoiceEngine::StopAecDump() { int WebRtcVoiceEngine::CreateVoEChannel() { RTC_DCHECK(worker_thread_checker_.CalledOnValidThread()); - return voe_wrapper_->base()->CreateChannel(voe_config_); + return voe_wrapper_->base()->CreateChannel(channel_config_); } webrtc::AudioDeviceModule* WebRtcVoiceEngine::adm() { diff --git a/webrtc/media/engine/webrtcvoiceengine.h b/webrtc/media/engine/webrtcvoiceengine.h index 6508e23896..27ae593cf1 100644 --- a/webrtc/media/engine/webrtcvoiceengine.h +++ b/webrtc/media/engine/webrtcvoiceengine.h @@ -24,7 +24,6 @@ #include "webrtc/base/stream.h" #include "webrtc/base/thread_checker.h" #include "webrtc/call.h" -#include "webrtc/common.h" #include "webrtc/config.h" #include "webrtc/media/base/rtputils.h" #include "webrtc/media/engine/webrtccommon.h" @@ -137,7 +136,7 @@ class WebRtcVoiceEngine final : public webrtc::TraceCallback { std::vector send_codecs_; std::vector recv_codecs_; std::vector channels_; - webrtc::Config voe_config_; + webrtc::VoEBase::ChannelConfig channel_config_; bool is_dumping_aec_ = false; webrtc::AgcConfig default_agc_config_; diff --git a/webrtc/modules/BUILD.gn b/webrtc/modules/BUILD.gn index 81241dc2f5..2cf764fc3d 100644 --- a/webrtc/modules/BUILD.gn +++ b/webrtc/modules/BUILD.gn @@ -322,6 +322,7 @@ if (rtc_include_tests) { "audio_processing/beamformer/matrix_unittest.cc", "audio_processing/beamformer/mock_nonlinear_beamformer.h", "audio_processing/beamformer/nonlinear_beamformer_unittest.cc", + "audio_processing/config_unittest.cc", "audio_processing/echo_cancellation_impl_unittest.cc", "audio_processing/splitting_filter_unittest.cc", "audio_processing/transient/dyadic_decimator_unittest.cc", diff --git a/webrtc/modules/audio_coding/test/APITest.cc b/webrtc/modules/audio_coding/test/APITest.cc index 833398acdd..c30830849b 100644 --- a/webrtc/modules/audio_coding/test/APITest.cc +++ b/webrtc/modules/audio_coding/test/APITest.cc @@ -22,7 +22,6 @@ #include "testing/gtest/include/gtest/gtest.h" #include "webrtc/base/platform_thread.h" #include "webrtc/base/timeutils.h" -#include "webrtc/common.h" #include "webrtc/common_types.h" #include "webrtc/engine_configurations.h" #include "webrtc/modules/audio_coding/acm2/acm_common_defs.h" @@ -48,7 +47,7 @@ void APITest::Wait(uint32_t waitLengthMs) { } } -APITest::APITest(const Config& config) +APITest::APITest() : _acmA(AudioCodingModule::Create(1)), _acmB(AudioCodingModule::Create(2)), _channel_A2B(NULL), diff --git a/webrtc/modules/audio_coding/test/APITest.h b/webrtc/modules/audio_coding/test/APITest.h index af2a3a15d4..99a7201847 100644 --- a/webrtc/modules/audio_coding/test/APITest.h +++ b/webrtc/modules/audio_coding/test/APITest.h @@ -23,8 +23,6 @@ namespace webrtc { -class Config; - enum APITESTAction { TEST_CHANGE_CODEC_ONLY = 0, DTX_TEST = 1 @@ -32,7 +30,7 @@ enum APITESTAction { class APITest : public ACMTest { public: - explicit APITest(const Config& config); + APITest(); ~APITest(); void Perform(); diff --git a/webrtc/modules/audio_coding/test/PacketLossTest.cc b/webrtc/modules/audio_coding/test/PacketLossTest.cc index 891471dce5..f6764ac977 100644 --- a/webrtc/modules/audio_coding/test/PacketLossTest.cc +++ b/webrtc/modules/audio_coding/test/PacketLossTest.cc @@ -13,7 +13,6 @@ #include #include "testing/gtest/include/gtest/gtest.h" -#include "webrtc/common.h" #include "webrtc/test/testsupport/fileutils.h" namespace webrtc { diff --git a/webrtc/modules/audio_coding/test/TestAllCodecs.h b/webrtc/modules/audio_coding/test/TestAllCodecs.h index 6d6f380d29..7df139b1ef 100644 --- a/webrtc/modules/audio_coding/test/TestAllCodecs.h +++ b/webrtc/modules/audio_coding/test/TestAllCodecs.h @@ -20,8 +20,6 @@ namespace webrtc { -class Config; - class TestPack : public AudioPacketizationCallback { public: TestPack(); diff --git a/webrtc/modules/audio_coding/test/TestRedFec.cc b/webrtc/modules/audio_coding/test/TestRedFec.cc index 24cda1122b..dbb238f499 100644 --- a/webrtc/modules/audio_coding/test/TestRedFec.cc +++ b/webrtc/modules/audio_coding/test/TestRedFec.cc @@ -12,7 +12,6 @@ #include -#include "webrtc/common.h" #include "webrtc/common_types.h" #include "webrtc/engine_configurations.h" #include "webrtc/modules/audio_coding/include/audio_coding_module_typedefs.h" diff --git a/webrtc/modules/audio_coding/test/TestRedFec.h b/webrtc/modules/audio_coding/test/TestRedFec.h index e936f75fe2..09d9259b16 100644 --- a/webrtc/modules/audio_coding/test/TestRedFec.h +++ b/webrtc/modules/audio_coding/test/TestRedFec.h @@ -20,8 +20,6 @@ namespace webrtc { -class Config; - class TestRedFec : public ACMTest { public: explicit TestRedFec(); diff --git a/webrtc/modules/audio_coding/test/delay_test.cc b/webrtc/modules/audio_coding/test/delay_test.cc index 50702f96b4..04428d50b4 100644 --- a/webrtc/modules/audio_coding/test/delay_test.cc +++ b/webrtc/modules/audio_coding/test/delay_test.cc @@ -16,7 +16,6 @@ #include "gflags/gflags.h" #include "testing/gtest/include/gtest/gtest.h" -#include "webrtc/common.h" #include "webrtc/common_types.h" #include "webrtc/engine_configurations.h" #include "webrtc/modules/audio_coding/include/audio_coding_module.h" diff --git a/webrtc/modules/audio_coding/test/utility.cc b/webrtc/modules/audio_coding/test/utility.cc index 89368bce51..58b5a68444 100644 --- a/webrtc/modules/audio_coding/test/utility.cc +++ b/webrtc/modules/audio_coding/test/utility.cc @@ -16,7 +16,6 @@ #include #include "testing/gtest/include/gtest/gtest.h" -#include "webrtc/common.h" #include "webrtc/common_types.h" #include "webrtc/modules/audio_coding/include/audio_coding_module.h" #include "webrtc/modules/audio_coding/acm2/acm_common_defs.h" diff --git a/webrtc/modules/audio_coding/test/utility.h b/webrtc/modules/audio_coding/test/utility.h index dbd398ee7d..b6c3a7ae16 100644 --- a/webrtc/modules/audio_coding/test/utility.h +++ b/webrtc/modules/audio_coding/test/utility.h @@ -128,10 +128,6 @@ class VADCallback : public ACMVADCallback { uint32_t _numFrameTypes[5]; }; -void UseLegacyAcm(webrtc::Config* config); - -void UseNewAcm(webrtc::Config* config); - } // namespace webrtc #endif // WEBRTC_MODULES_AUDIO_CODING_TEST_UTILITY_H_ diff --git a/webrtc/modules/audio_processing/BUILD.gn b/webrtc/modules/audio_processing/BUILD.gn index 71338ea507..2387c2e85b 100644 --- a/webrtc/modules/audio_processing/BUILD.gn +++ b/webrtc/modules/audio_processing/BUILD.gn @@ -71,6 +71,8 @@ rtc_source_set("audio_processing") { "high_pass_filter_impl.cc", "high_pass_filter_impl.h", "include/audio_processing.h", + "include/config.cc", + "include/config.h", "level_controller/biquad_filter.cc", "level_controller/biquad_filter.h", "level_controller/down_sampler.cc", diff --git a/webrtc/modules/audio_processing/audio_processing.gypi b/webrtc/modules/audio_processing/audio_processing.gypi index cbd4fdf4a7..78f133a97a 100644 --- a/webrtc/modules/audio_processing/audio_processing.gypi +++ b/webrtc/modules/audio_processing/audio_processing.gypi @@ -83,6 +83,8 @@ 'high_pass_filter_impl.cc', 'high_pass_filter_impl.h', 'include/audio_processing.h', + 'include/config.cc', + 'include/config.h', 'level_controller/biquad_filter.cc', 'level_controller/biquad_filter.h', 'level_controller/down_sampler.cc', diff --git a/webrtc/test/common_unittest.cc b/webrtc/modules/audio_processing/config_unittest.cc similarity index 97% rename from webrtc/test/common_unittest.cc rename to webrtc/modules/audio_processing/config_unittest.cc index a239dade73..2dd9f0d999 100644 --- a/webrtc/test/common_unittest.cc +++ b/webrtc/modules/audio_processing/config_unittest.cc @@ -7,7 +7,7 @@ * in the file PATENTS. All contributing project authors may * be found in the AUTHORS file in the root of the source tree. */ -#include "webrtc/common.h" +#include "webrtc/modules/audio_processing/include/config.h" #include "testing/gtest/include/gtest/gtest.h" diff --git a/webrtc/modules/audio_processing/include/audio_processing.h b/webrtc/modules/audio_processing/include/audio_processing.h index 09e5d5be1c..44ff7327ff 100644 --- a/webrtc/modules/audio_processing/include/audio_processing.h +++ b/webrtc/modules/audio_processing/include/audio_processing.h @@ -21,8 +21,8 @@ #include "webrtc/base/arraysize.h" #include "webrtc/base/platform_file.h" -#include "webrtc/common.h" #include "webrtc/modules/audio_processing/beamformer/array_util.h" +#include "webrtc/modules/audio_processing/include/config.h" #include "webrtc/typedefs.h" namespace webrtc { diff --git a/webrtc/common.cc b/webrtc/modules/audio_processing/include/config.cc similarity index 91% rename from webrtc/common.cc rename to webrtc/modules/audio_processing/include/config.cc index bc24818a60..bbbc4520a8 100644 --- a/webrtc/common.cc +++ b/webrtc/modules/audio_processing/include/config.cc @@ -8,7 +8,7 @@ * be found in the AUTHORS file in the root of the source tree. */ -#include "webrtc/common.h" +#include "webrtc/modules/audio_processing/include/config.h" namespace webrtc { diff --git a/webrtc/common.h b/webrtc/modules/audio_processing/include/config.h similarity index 91% rename from webrtc/common.h rename to webrtc/modules/audio_processing/include/config.h index 79db50c5b5..615e3fa3ec 100644 --- a/webrtc/common.h +++ b/webrtc/modules/audio_processing/include/config.h @@ -8,8 +8,8 @@ * be found in the AUTHORS file in the root of the source tree. */ -#ifndef WEBRTC_COMMON_H_ -#define WEBRTC_COMMON_H_ +#ifndef WEBRTC_MODULES_AUDIO_PROCESSING_INCLUDE_CONFIG_H_ +#define WEBRTC_MODULES_AUDIO_PROCESSING_INCLUDE_CONFIG_H_ #include @@ -23,10 +23,10 @@ namespace webrtc { enum class ConfigOptionID { kMyExperimentForTest, kAlgo1CostFunctionForTest, - kTemporalLayersFactory, - kNetEqCapacityConfig, - kNetEqFastAccelerate, - kVoicePacing, + kTemporalLayersFactory, // Deprecated + kNetEqCapacityConfig, // Deprecated + kNetEqFastAccelerate, // Deprecated + kVoicePacing, // Deprecated kExtendedFilter, kDelayAgnostic, kExperimentalAgc, @@ -128,7 +128,6 @@ void Config::Set(T* value) { delete it; it = new Option(value); } - } // namespace webrtc -#endif // WEBRTC_COMMON_H_ +#endif // WEBRTC_MODULES_AUDIO_PROCESSING_INCLUDE_CONFIG_H_ diff --git a/webrtc/modules/audio_processing/test/process_test.cc b/webrtc/modules/audio_processing/test/process_test.cc index 6d5b97974a..ad769adab4 100644 --- a/webrtc/modules/audio_processing/test/process_test.cc +++ b/webrtc/modules/audio_processing/test/process_test.cc @@ -20,8 +20,8 @@ #include "webrtc/base/format_macros.h" #include "webrtc/base/timeutils.h" -#include "webrtc/common.h" #include "webrtc/modules/audio_processing/include/audio_processing.h" +#include "webrtc/modules/audio_processing/include/config.h" #include "webrtc/modules/audio_processing/test/protobuf_utils.h" #include "webrtc/modules/audio_processing/test/test_utils.h" #include "webrtc/modules/include/module_common_types.h" diff --git a/webrtc/modules/modules.gyp b/webrtc/modules/modules.gyp index a8da0b7d23..a345ba45af 100644 --- a/webrtc/modules/modules.gyp +++ b/webrtc/modules/modules.gyp @@ -245,6 +245,7 @@ 'audio_processing/beamformer/matrix_unittest.cc', 'audio_processing/beamformer/mock_nonlinear_beamformer.h', 'audio_processing/beamformer/nonlinear_beamformer_unittest.cc', + 'audio_processing/config_unittest.cc', 'audio_processing/echo_cancellation_impl_unittest.cc', 'audio_processing/splitting_filter_unittest.cc', 'audio_processing/transient/dyadic_decimator_unittest.cc', diff --git a/webrtc/test/BUILD.gn b/webrtc/test/BUILD.gn index 6b6a2bb33f..69914494bf 100644 --- a/webrtc/test/BUILD.gn +++ b/webrtc/test/BUILD.gn @@ -282,7 +282,6 @@ rtc_test("test_support_unittests") { "channel_transport/udp_socket_manager_unittest.cc", "channel_transport/udp_socket_wrapper_unittest.cc", "channel_transport/udp_transport_unittest.cc", - "common_unittest.cc", "fake_network_pipe_unittest.cc", "frame_generator_unittest.cc", "rtp_file_reader_unittest.cc", diff --git a/webrtc/test/call_test.cc b/webrtc/test/call_test.cc index a766f79f56..e81d947c30 100644 --- a/webrtc/test/call_test.cc +++ b/webrtc/test/call_test.cc @@ -8,7 +8,6 @@ * be found in the AUTHORS file in the root of the source tree. */ #include "webrtc/base/checks.h" -#include "webrtc/common.h" #include "webrtc/config.h" #include "webrtc/modules/audio_coding/codecs/builtin_audio_decoder_factory.h" #include "webrtc/test/call_test.h" @@ -312,9 +311,9 @@ void CallTest::CreateVoiceEngines() { voe_send_.codec = VoECodec::GetInterface(voe_send_.voice_engine); EXPECT_EQ(0, voe_send_.base->Init(fake_send_audio_device_.get(), nullptr, decoder_factory_)); - Config voe_config; - voe_config.Set(new VoicePacing(true)); - voe_send_.channel_id = voe_send_.base->CreateChannel(voe_config); + VoEBase::ChannelConfig config; + config.enable_voice_pacing = true; + voe_send_.channel_id = voe_send_.base->CreateChannel(config); EXPECT_GE(voe_send_.channel_id, 0); voe_recv_.voice_engine = VoiceEngine::Create(); diff --git a/webrtc/test/mock_voice_engine.h b/webrtc/test/mock_voice_engine.h index 469028dbf6..abd493b9d9 100644 --- a/webrtc/test/mock_voice_engine.h +++ b/webrtc/test/mock_voice_engine.h @@ -30,8 +30,7 @@ class MockVoiceEngine : public VoiceEngineImpl { // http://crbug.com/428099. MockVoiceEngine( rtc::scoped_refptr decoder_factory = nullptr) - : VoiceEngineImpl(new Config(), true), - decoder_factory_(decoder_factory) { + : decoder_factory_(decoder_factory) { // Increase ref count so this object isn't automatically deleted whenever // interfaces are Release():d. ++_ref_count; @@ -123,7 +122,7 @@ class MockVoiceEngine : public VoiceEngineImpl { MOCK_METHOD0(audio_processing, AudioProcessing*()); MOCK_METHOD0(Terminate, int()); MOCK_METHOD0(CreateChannel, int()); - MOCK_METHOD1(CreateChannel, int(const Config& config)); + MOCK_METHOD1(CreateChannel, int(const ChannelConfig& config)); MOCK_METHOD1(DeleteChannel, int(int channel)); MOCK_METHOD1(StartReceive, int(int channel)); MOCK_METHOD1(StopReceive, int(int channel)); diff --git a/webrtc/test/test.gyp b/webrtc/test/test.gyp index fc9a2ad1db..7f64b77aca 100644 --- a/webrtc/test/test.gyp +++ b/webrtc/test/test.gyp @@ -210,7 +210,6 @@ '<(DEPTH)/testing/gtest.gyp:gtest', ], 'sources': [ - 'common_unittest.cc', 'fake_network_pipe_unittest.cc', 'frame_generator_unittest.cc', 'rtp_file_reader_unittest.cc', diff --git a/webrtc/video/video_quality_test.cc b/webrtc/video/video_quality_test.cc index baccc71b39..aa1c9b1728 100644 --- a/webrtc/video/video_quality_test.cc +++ b/webrtc/video/video_quality_test.cc @@ -70,9 +70,9 @@ void CreateVoiceEngine(VoiceEngineState* voe, voe->base = webrtc::VoEBase::GetInterface(voe->voice_engine); voe->codec = webrtc::VoECodec::GetInterface(voe->voice_engine); EXPECT_EQ(0, voe->base->Init(nullptr, nullptr, decoder_factory)); - webrtc::Config voe_config; - voe_config.Set(new webrtc::VoicePacing(true)); - voe->send_channel_id = voe->base->CreateChannel(voe_config); + webrtc::VoEBase::ChannelConfig config; + config.enable_voice_pacing = true; + voe->send_channel_id = voe->base->CreateChannel(config); EXPECT_GE(voe->send_channel_id, 0); voe->receive_channel_id = voe->base->CreateChannel(); EXPECT_GE(voe->receive_channel_id, 0); diff --git a/webrtc/video/video_stream_decoder.h b/webrtc/video/video_stream_decoder.h index 465c8c4740..ad355570b6 100644 --- a/webrtc/video/video_stream_decoder.h +++ b/webrtc/video/video_stream_decoder.h @@ -28,7 +28,6 @@ namespace webrtc { class CallStatsObserver; class ChannelStatsObserver; -class Config; class EncodedImageCallback; class I420FrameCallback; class ReceiveStatisticsProxy; diff --git a/webrtc/voice_engine/channel.cc b/webrtc/voice_engine/channel.cc index 29ee30195d..301b5a6f8b 100644 --- a/webrtc/voice_engine/channel.cc +++ b/webrtc/voice_engine/channel.cc @@ -21,7 +21,6 @@ #include "webrtc/base/thread_checker.h" #include "webrtc/base/timeutils.h" #include "webrtc/call/rtc_event_log.h" -#include "webrtc/common.h" #include "webrtc/config.h" #include "webrtc/modules/audio_device/include/audio_device.h" #include "webrtc/modules/audio_processing/include/audio_processing.h" @@ -34,7 +33,6 @@ #include "webrtc/modules/utility/include/audio_frame_operations.h" #include "webrtc/modules/utility/include/process_thread.h" #include "webrtc/system_wrappers/include/trace.h" -#include "webrtc/voice_engine/include/voe_base.h" #include "webrtc/voice_engine/include/voe_external_media.h" #include "webrtc/voice_engine/include/voe_rtp_rtcp.h" #include "webrtc/voice_engine/output_mixer.h" @@ -754,13 +752,12 @@ int32_t Channel::CreateChannel( Channel*& channel, int32_t channelId, uint32_t instanceId, - const Config& config, - const rtc::scoped_refptr& decoder_factory) { + const VoEBase::ChannelConfig& config) { WEBRTC_TRACE(kTraceMemory, kTraceVoice, VoEId(instanceId, channelId), "Channel::CreateChannel(channelId=%d, instanceId=%d)", channelId, instanceId); - channel = new Channel(channelId, instanceId, config, decoder_factory); + channel = new Channel(channelId, instanceId, config); if (channel == NULL) { WEBRTC_TRACE(kTraceMemory, kTraceVoice, VoEId(instanceId, channelId), "Channel::CreateChannel() unable to allocate memory for" @@ -819,8 +816,7 @@ void Channel::RecordFileEnded(int32_t id) { Channel::Channel(int32_t channelId, uint32_t instanceId, - const Config& config, - const rtc::scoped_refptr& decoder_factory) + const VoEBase::ChannelConfig& config) : _instanceId(instanceId), _channelId(channelId), event_log_proxy_(new RtcEventLogProxy()), @@ -886,27 +882,18 @@ Channel::Channel(int32_t channelId, rtcp_observer_(new VoERtcpObserver(this)), network_predictor_(new NetworkPredictor(Clock::GetRealTimeClock())), associate_send_channel_(ChannelOwner(nullptr)), - pacing_enabled_(config.Get().enabled), + pacing_enabled_(config.enable_voice_pacing), feedback_observer_proxy_(new TransportFeedbackProxy()), seq_num_allocator_proxy_(new TransportSequenceNumberProxy()), rtp_packet_sender_proxy_(new RtpPacketSenderProxy()), retransmission_rate_limiter_(new RateLimiter(Clock::GetRealTimeClock(), kMaxRetransmissionWindowMs)), - decoder_factory_(decoder_factory) { + decoder_factory_(config.acm_config.decoder_factory) { WEBRTC_TRACE(kTraceMemory, kTraceVoice, VoEId(_instanceId, _channelId), "Channel::Channel() - ctor"); - AudioCodingModule::Config acm_config; + AudioCodingModule::Config acm_config(config.acm_config); acm_config.id = VoEModuleId(instanceId, channelId); - if (config.Get().enabled) { - // Clamping the buffer capacity at 20 packets. While going lower will - // probably work, it makes little sense. - acm_config.neteq_config.max_packets_in_buffer = - std::max(20, config.Get().capacity); - } - acm_config.neteq_config.enable_fast_accelerate = - config.Get().enabled; acm_config.neteq_config.enable_muted_state = true; - acm_config.decoder_factory = decoder_factory; audio_coding_.reset(AudioCodingModule::Create(acm_config)); _outputAudioLevel.Clear(); diff --git a/webrtc/voice_engine/channel.h b/webrtc/voice_engine/channel.h index 1cf49d9932..307b61ebcc 100644 --- a/webrtc/voice_engine/channel.h +++ b/webrtc/voice_engine/channel.h @@ -29,6 +29,7 @@ #include "webrtc/modules/utility/include/file_player.h" #include "webrtc/modules/utility/include/file_recorder.h" #include "webrtc/voice_engine/include/voe_audio_processing.h" +#include "webrtc/voice_engine/include/voe_base.h" #include "webrtc/voice_engine/include/voe_network.h" #include "webrtc/voice_engine/level_indicator.h" #include "webrtc/voice_engine/network_predictor.h" @@ -42,7 +43,6 @@ class TimestampWrapAroundHandler; namespace webrtc { class AudioDeviceModule; -class Config; class FileWrapper; class PacketRouter; class ProcessThread; @@ -175,12 +175,10 @@ class Channel Channel*& channel, int32_t channelId, uint32_t instanceId, - const Config& config, - const rtc::scoped_refptr& decoder_factory); + const VoEBase::ChannelConfig& config); Channel(int32_t channelId, uint32_t instanceId, - const Config& config, - const rtc::scoped_refptr& decoder_factory); + const VoEBase::ChannelConfig& config); int32_t Init(); int32_t SetEngineInformation(Statistics& engineStatistics, OutputMixer& outputMixer, diff --git a/webrtc/voice_engine/channel_manager.cc b/webrtc/voice_engine/channel_manager.cc index bcc22b05f4..b8ffe6e796 100644 --- a/webrtc/voice_engine/channel_manager.cc +++ b/webrtc/voice_engine/channel_manager.cc @@ -10,7 +10,6 @@ #include "webrtc/voice_engine/channel_manager.h" -#include "webrtc/common.h" #include "webrtc/voice_engine/channel.h" namespace webrtc { @@ -45,26 +44,13 @@ ChannelOwner& ChannelOwner::operator=(const ChannelOwner& other) { ChannelOwner::ChannelRef::ChannelRef(class Channel* channel) : channel(channel), ref_count(1) {} -ChannelManager::ChannelManager(uint32_t instance_id, const Config& config) - : instance_id_(instance_id), last_channel_id_(-1), config_(config) {} +ChannelManager::ChannelManager(uint32_t instance_id) + : instance_id_(instance_id), last_channel_id_(-1) {} ChannelOwner ChannelManager::CreateChannel( - const rtc::scoped_refptr& decoder_factory) { - return CreateChannelInternal(config_, decoder_factory); -} - -ChannelOwner ChannelManager::CreateChannel( - const Config& external_config, - const rtc::scoped_refptr& decoder_factory) { - return CreateChannelInternal(external_config, decoder_factory); -} - -ChannelOwner ChannelManager::CreateChannelInternal( - const Config& config, - const rtc::scoped_refptr& decoder_factory) { + const VoEBase::ChannelConfig& config) { Channel* channel; - Channel::CreateChannel(channel, ++last_channel_id_, instance_id_, config, - decoder_factory); + Channel::CreateChannel(channel, ++last_channel_id_, instance_id_, config); ChannelOwner channel_owner(channel); rtc::CritScope crit(&lock_); diff --git a/webrtc/voice_engine/channel_manager.h b/webrtc/voice_engine/channel_manager.h index adc9d901f1..ae16aca2b8 100644 --- a/webrtc/voice_engine/channel_manager.h +++ b/webrtc/voice_engine/channel_manager.h @@ -19,10 +19,10 @@ #include "webrtc/base/scoped_ref_ptr.h" #include "webrtc/system_wrappers/include/atomic32.h" #include "webrtc/typedefs.h" +#include "webrtc/voice_engine/include/voe_base.h" namespace webrtc { -class Config; class AudioDecoderFactory; namespace voe { @@ -72,7 +72,7 @@ class ChannelOwner { class ChannelManager { public: - ChannelManager(uint32_t instance_id, const Config& config); + ChannelManager(uint32_t instance_id); // Upon construction of an Iterator it will grab a copy of the channel list of // the ChannelManager. The iteration will then occur over this state, not the @@ -95,16 +95,8 @@ class ChannelManager { RTC_DISALLOW_COPY_AND_ASSIGN(Iterator); }; - // CreateChannel will always return a valid ChannelOwner instance. The channel - // is created either based on internal configuration, i.e. |config_|, by - // calling CreateChannel(...), or using and external configuration - // |external_config| if the overloaded method - // CreateChannel(const Config& external_config, ...) is called. - ChannelOwner CreateChannel( - const rtc::scoped_refptr& decoder_factory); - ChannelOwner CreateChannel( - const Config& external_config, - const rtc::scoped_refptr& decoder_factory); + // CreateChannel will always return a valid ChannelOwner instance. + ChannelOwner CreateChannel(const VoEBase::ChannelConfig& config); // ChannelOwner.channel() will be NULL if channel_id is invalid or no longer // exists. This should be checked with ChannelOwner::IsValid(). @@ -117,11 +109,6 @@ class ChannelManager { size_t NumOfChannels() const; private: - // Create a channel given a configuration, |config|. - ChannelOwner CreateChannelInternal( - const Config& config, - const rtc::scoped_refptr& decoder_factory); - uint32_t instance_id_; Atomic32 last_channel_id_; @@ -129,8 +116,6 @@ class ChannelManager { rtc::CriticalSection lock_; std::vector channels_; - const Config& config_; - RTC_DISALLOW_COPY_AND_ASSIGN(ChannelManager); }; } // namespace voe diff --git a/webrtc/voice_engine/include/voe_base.h b/webrtc/voice_engine/include/voe_base.h index 91df7d3e4f..751394e8d7 100644 --- a/webrtc/voice_engine/include/voe_base.h +++ b/webrtc/voice_engine/include/voe_base.h @@ -36,6 +36,7 @@ #include "webrtc/base/scoped_ref_ptr.h" #include "webrtc/modules/audio_coding/codecs/audio_decoder_factory.h" +#include "webrtc/modules/audio_coding/include/audio_coding_module.h" #include "webrtc/common_types.h" namespace webrtc { @@ -43,9 +44,6 @@ namespace webrtc { class AudioDeviceModule; class AudioProcessing; class AudioTransport; -class Config; - -const int kVoEDefault = -1; // VoiceEngineObserver class WEBRTC_DLLEXPORT VoiceEngineObserver { @@ -65,7 +63,6 @@ class WEBRTC_DLLEXPORT VoiceEngine { // Creates a VoiceEngine object, which can then be used to acquire // sub-APIs. Returns NULL on failure. static VoiceEngine* Create(); - static VoiceEngine* Create(const Config& config); // Deletes a created VoiceEngine object and releases the utilized resources. // Note that if there are outstanding references held via other interfaces, @@ -99,6 +96,11 @@ class WEBRTC_DLLEXPORT VoiceEngine { // VoEBase class WEBRTC_DLLEXPORT VoEBase { public: + struct ChannelConfig { + AudioCodingModule::Config acm_config; + bool enable_voice_pacing = false; + }; + // Factory for the VoEBase sub-API. Increases an internal reference // counter if successful. Returns NULL if the API is not supported or if // construction fails. @@ -146,11 +148,13 @@ class WEBRTC_DLLEXPORT VoEBase { virtual int Terminate() = 0; // Creates a new channel and allocates the required resources for it. - // One can use |config| to configure the channel. Currently that is used for - // choosing between ACM1 and ACM2, when creating Audio Coding Module. + // The second version accepts a |config| struct which includes an Audio Coding + // Module config and an option to enable voice pacing. Note that the + // decoder_factory member of the ACM config will be ignored (the decoder + // factory set through Init() will always be used). // Returns channel ID or -1 in case of an error. virtual int CreateChannel() = 0; - virtual int CreateChannel(const Config& config) = 0; + virtual int CreateChannel(const ChannelConfig& config) = 0; // Deletes an existing channel and releases the utilized resources. // Returns -1 in case of an error, 0 otherwise. diff --git a/webrtc/voice_engine/shared_data.cc b/webrtc/voice_engine/shared_data.cc index 7a67561d1e..41e261bd58 100644 --- a/webrtc/voice_engine/shared_data.cc +++ b/webrtc/voice_engine/shared_data.cc @@ -22,9 +22,9 @@ namespace voe { static int32_t _gInstanceCounter = 0; -SharedData::SharedData(const Config& config) +SharedData::SharedData() : _instanceId(++_gInstanceCounter), - _channelManager(_gInstanceCounter, config), + _channelManager(_gInstanceCounter), _engineStatistics(_gInstanceCounter), _audioDevicePtr(NULL), _moduleProcessThreadPtr( diff --git a/webrtc/voice_engine/shared_data.h b/webrtc/voice_engine/shared_data.h index ea84effd1b..0e57f9d250 100644 --- a/webrtc/voice_engine/shared_data.h +++ b/webrtc/voice_engine/shared_data.h @@ -25,8 +25,6 @@ class ProcessThread; namespace webrtc { -class Config; - namespace voe { class TransmitMixer; @@ -77,11 +75,10 @@ protected: AudioDeviceModule::AudioLayer _audioDeviceLayer; - SharedData(const Config& config); + SharedData(); virtual ~SharedData(); }; } // namespace voe - } // namespace webrtc #endif // WEBRTC_VOICE_ENGINE_SHARED_DATA_H diff --git a/webrtc/voice_engine/test/auto_test/fixtures/before_initialization_fixture.h b/webrtc/voice_engine/test/auto_test/fixtures/before_initialization_fixture.h index b9cd9e9b64..1b226ff74b 100644 --- a/webrtc/voice_engine/test/auto_test/fixtures/before_initialization_fixture.h +++ b/webrtc/voice_engine/test/auto_test/fixtures/before_initialization_fixture.h @@ -11,9 +11,6 @@ #ifndef SRC_VOICE_ENGINE_MAIN_TEST_AUTO_TEST_STANDARD_TEST_BASE_H_ #define SRC_VOICE_ENGINE_MAIN_TEST_AUTO_TEST_STANDARD_TEST_BASE_H_ -#include - -#include "webrtc/common.h" #include "webrtc/common_types.h" #include "webrtc/engine_configurations.h" #include "webrtc/voice_engine/include/voe_audio_processing.h" @@ -65,7 +62,6 @@ class BeforeInitializationFixture : public testing::Test { webrtc::VoEHardware* voe_hardware_; webrtc::VoEExternalMedia* voe_xmedia_; webrtc::VoENetEqStats* voe_neteq_stats_; - webrtc::Config config_; }; #endif // SRC_VOICE_ENGINE_MAIN_TEST_AUTO_TEST_STANDARD_TEST_BASE_H_ diff --git a/webrtc/voice_engine/voe_base_impl.cc b/webrtc/voice_engine/voe_base_impl.cc index 9c917b5881..f74bdb1dbc 100644 --- a/webrtc/voice_engine/voe_base_impl.cc +++ b/webrtc/voice_engine/voe_base_impl.cc @@ -12,7 +12,6 @@ #include "webrtc/base/format_macros.h" #include "webrtc/base/logging.h" -#include "webrtc/common.h" #include "webrtc/common_audio/signal_processing/include/signal_processing_library.h" #include "webrtc/modules/audio_coding/codecs/builtin_audio_decoder_factory.h" #include "webrtc/modules/audio_coding/include/audio_coding_module.h" @@ -355,25 +354,20 @@ int VoEBaseImpl::Terminate() { } int VoEBaseImpl::CreateChannel() { - rtc::CritScope cs(shared_->crit_sec()); - if (!shared_->statistics().Initialized()) { - shared_->SetLastError(VE_NOT_INITED, kTraceError); - return -1; - } - - voe::ChannelOwner channel_owner = - shared_->channel_manager().CreateChannel(decoder_factory_); - return InitializeChannel(&channel_owner); + return CreateChannel(ChannelConfig()); } -int VoEBaseImpl::CreateChannel(const Config& config) { +int VoEBaseImpl::CreateChannel(const ChannelConfig& config) { rtc::CritScope cs(shared_->crit_sec()); if (!shared_->statistics().Initialized()) { shared_->SetLastError(VE_NOT_INITED, kTraceError); return -1; } + + ChannelConfig config_copy(config); + config_copy.acm_config.decoder_factory = decoder_factory_; voe::ChannelOwner channel_owner = - shared_->channel_manager().CreateChannel(config, decoder_factory_); + shared_->channel_manager().CreateChannel(config_copy); return InitializeChannel(&channel_owner); } diff --git a/webrtc/voice_engine/voe_base_impl.h b/webrtc/voice_engine/voe_base_impl.h index 93e1cf5e86..050e9bb8d6 100644 --- a/webrtc/voice_engine/voe_base_impl.h +++ b/webrtc/voice_engine/voe_base_impl.h @@ -41,7 +41,7 @@ class VoEBaseImpl : public VoEBase, int Terminate() override; int CreateChannel() override; - int CreateChannel(const Config& config) override; + int CreateChannel(const ChannelConfig& config) override; int DeleteChannel(int channel) override; int StartReceive(int channel) override; diff --git a/webrtc/voice_engine/voice_engine_impl.cc b/webrtc/voice_engine/voice_engine_impl.cc index 919d0e8efd..5b92d27313 100644 --- a/webrtc/voice_engine/voice_engine_impl.cc +++ b/webrtc/voice_engine/voice_engine_impl.cc @@ -29,8 +29,8 @@ namespace webrtc { // improvement here. static int32_t gVoiceEngineInstanceCounter = 0; -VoiceEngine* GetVoiceEngine(const Config* config, bool owns_config) { - VoiceEngineImpl* self = new VoiceEngineImpl(config, owns_config); +VoiceEngine* GetVoiceEngine() { + VoiceEngineImpl* self = new VoiceEngineImpl(); if (self != NULL) { self->AddRef(); // First reference. Released in VoiceEngine::Delete. gVoiceEngineInstanceCounter++; @@ -72,12 +72,7 @@ std::unique_ptr VoiceEngineImpl::GetChannelProxy( } VoiceEngine* VoiceEngine::Create() { - Config* config = new Config(); - return GetVoiceEngine(config, true); -} - -VoiceEngine* VoiceEngine::Create(const Config& config) { - return GetVoiceEngine(&config, false); + return GetVoiceEngine(); } int VoiceEngine::SetTraceFilter(unsigned int filter) { diff --git a/webrtc/voice_engine/voice_engine_impl.h b/webrtc/voice_engine/voice_engine_impl.h index aa58007062..3237001c01 100644 --- a/webrtc/voice_engine/voice_engine_impl.h +++ b/webrtc/voice_engine/voice_engine_impl.h @@ -83,8 +83,8 @@ class VoiceEngineImpl : public voe::SharedData, // Must be the first base class #endif public VoEBaseImpl { public: - VoiceEngineImpl(const Config* config, bool owns_config) - : SharedData(*config), + VoiceEngineImpl() + : SharedData(), #ifdef WEBRTC_VOICE_ENGINE_AUDIO_PROCESSING_API VoEAudioProcessingImpl(this), #endif @@ -114,9 +114,7 @@ class VoiceEngineImpl : public voe::SharedData, // Must be the first base class VoEVolumeControlImpl(this), #endif VoEBaseImpl(this), - _ref_count(0), - own_config_(owns_config ? config : NULL) { - } + _ref_count(0) {} ~VoiceEngineImpl() override { assert(_ref_count.Value() == 0); } int AddRef(); @@ -132,8 +130,6 @@ class VoiceEngineImpl : public voe::SharedData, // Must be the first base class // manipulate the reference count. See: fake_voice_engine.h. protected: Atomic32 _ref_count; - private: - std::unique_ptr own_config_; }; } // namespace webrtc