Hide the AudioEncoderCng class behind a create function

And put codecs/cng/webrtc_cng.h in a non-public build target while
we're at it.

Bug: webrtc:8396
Change-Id: I9f51dffadfb645cd1454617fad30e09d639ff53c
Reviewed-on: https://webrtc-review.googlesource.com/c/108782
Reviewed-by: Ivo Creusen <ivoc@webrtc.org>
Commit-Queue: Karl Wiberg <kwiberg@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#25486}
This commit is contained in:
Karl Wiberg
2018-11-01 11:13:44 +01:00
committed by Commit Bot
parent 42e7d9c929
commit 2365936b87
13 changed files with 146 additions and 130 deletions

View File

@ -175,12 +175,12 @@ void TestRedFec::RegisterSendCodec(
EXPECT_NE(encoder, nullptr);
if (!absl::EqualsIgnoreCase(codec_format.name, "opus")) {
if (vad_mode.has_value()) {
AudioEncoderCng::Config config;
AudioEncoderCngConfig config;
config.speech_encoder = std::move(encoder);
config.num_channels = 1;
config.payload_type = cn_payload_type;
config.vad_mode = vad_mode.value();
encoder = absl::make_unique<AudioEncoderCng>(std::move(config));
encoder = CreateComfortNoiseEncoder(std::move(config));
EXPECT_EQ(true,
other_acm->RegisterReceiveCodec(
cn_payload_type, {"CN", codec_format.clockrate_hz, 1}));

View File

@ -83,12 +83,12 @@ bool TestVadDtx::RegisterCodec(const SdpAudioFormat& codec_format,
absl::nullopt);
if (vad_mode.has_value() &&
!absl::EqualsIgnoreCase(codec_format.name, "opus")) {
AudioEncoderCng::Config config;
AudioEncoderCngConfig config;
config.speech_encoder = std::move(encoder);
config.num_channels = 1;
config.payload_type = cn_payload_type;
config.vad_mode = vad_mode.value();
encoder = absl::make_unique<AudioEncoderCng>(std::move(config));
encoder = CreateComfortNoiseEncoder(std::move(config));
added_comfort_noise = true;
}
channel_->SetIsStereo(encoder->NumChannels() > 1);