AudioCodingModule::Create(): Require caller to supply an AudioDecoderFactory

So that we don't have to be capable of creating one ourselves, which
requires a dependency on the audio decoders.

BUG=webrtc:5801, webrtc:8396

Change-Id: I80749ec3b86cba73994307046d05964f59167d44
Reviewed-on: https://webrtc-review.googlesource.com/18440
Commit-Queue: Karl Wiberg <kwiberg@webrtc.org>
Reviewed-by: Oskar Sundbom <ossu@webrtc.org>
Reviewed-by: Henrik Lundin <henrik.lundin@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#22774}
This commit is contained in:
Karl Wiberg
2018-04-06 10:06:42 +02:00
committed by Commit Bot
parent d31843e436
commit 5817d3dfaa
19 changed files with 112 additions and 83 deletions

View File

@ -66,7 +66,8 @@ class AudioCodingModule {
public:
struct Config {
Config();
explicit Config(
rtc::scoped_refptr<AudioDecoderFactory> decoder_factory = nullptr);
Config(const Config&);
~Config();
@ -75,17 +76,6 @@ class AudioCodingModule {
rtc::scoped_refptr<AudioDecoderFactory> decoder_factory;
};
///////////////////////////////////////////////////////////////////////////
// Creation and destruction of a ACM.
//
// The second method is used for testing where a simulated clock can be
// injected into ACM. ACM will take the ownership of the object clock and
// delete it when destroyed.
//
// TODO(solenberg): Remove once downstream projects are updated.
RTC_DEPRECATED static AudioCodingModule* Create(int id);
static AudioCodingModule* Create();
static AudioCodingModule* Create(Clock* clock);
static AudioCodingModule* Create(const Config& config);
virtual ~AudioCodingModule() = default;