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:
@ -246,8 +246,8 @@ std::unique_ptr<AudioEncoder> CreateEncoder(CodecType codec_type,
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
AudioEncoderCng::Config GetCngConfig(int sample_rate_hz) {
|
||||
AudioEncoderCng::Config cng_config;
|
||||
AudioEncoderCngConfig GetCngConfig(int sample_rate_hz) {
|
||||
AudioEncoderCngConfig cng_config;
|
||||
const auto default_payload_type = [&] {
|
||||
switch (sample_rate_hz) {
|
||||
case 8000:
|
||||
@ -313,10 +313,10 @@ int RunRtpEncode(int argc, char* argv[]) {
|
||||
|
||||
// Create an external VAD/CNG encoder if needed.
|
||||
if (FLAG_dtx && !codec_it->second.internal_dtx) {
|
||||
AudioEncoderCng::Config cng_config = GetCngConfig(codec->SampleRateHz());
|
||||
AudioEncoderCngConfig cng_config = GetCngConfig(codec->SampleRateHz());
|
||||
RTC_DCHECK(codec);
|
||||
cng_config.speech_encoder = std::move(codec);
|
||||
codec = absl::make_unique<AudioEncoderCng>(std::move(cng_config));
|
||||
codec = CreateComfortNoiseEncoder(std::move(cng_config));
|
||||
}
|
||||
RTC_DCHECK(codec);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user