Index: webrtc/modules/audio_coding/codecs/g711/audio_encoder_pcm.cc |
diff --git a/webrtc/modules/audio_coding/codecs/g711/audio_encoder_pcm.cc b/webrtc/modules/audio_coding/codecs/g711/audio_encoder_pcm.cc |
index 8bff2ec1ee27fa6b5d227a7ccd3074ab1276825a..711eed73de1f6f6c7f2269ef4dfd3d12b3645bda 100644 |
--- a/webrtc/modules/audio_coding/codecs/g711/audio_encoder_pcm.cc |
+++ b/webrtc/modules/audio_coding/codecs/g711/audio_encoder_pcm.cc |
@@ -16,7 +16,6 @@ |
#include "webrtc/common_types.h" |
#include "webrtc/modules/audio_coding/codecs/g711/g711_interface.h" |
#include "webrtc/rtc_base/checks.h" |
-#include "webrtc/rtc_base/string_to_number.h" |
namespace webrtc { |
@@ -31,35 +30,6 @@ typename T::Config CreateConfig(const CodecInst& codec_inst) { |
return config; |
} |
-template <typename T> |
-typename T::Config CreateConfig(int payload_type, |
- const SdpAudioFormat& format) { |
- typename T::Config config; |
- config.frame_size_ms = 20; |
- auto ptime_iter = format.parameters.find("ptime"); |
- if (ptime_iter != format.parameters.end()) { |
- auto ptime = rtc::StringToNumber<int>(ptime_iter->second); |
- if (ptime && *ptime > 0) { |
- const int whole_packets = *ptime / 10; |
- config.frame_size_ms = std::max(10, std::min(whole_packets * 10, 60)); |
- } |
- } |
- config.num_channels = format.num_channels; |
- config.payload_type = payload_type; |
- return config; |
-} |
- |
-template <typename T> |
-rtc::Optional<AudioCodecInfo> QueryAudioEncoderImpl( |
- const SdpAudioFormat& format) { |
- if (STR_CASE_CMP(format.name.c_str(), T::GetPayloadName()) == 0 && |
- format.clockrate_hz == 8000 && format.num_channels >= 1 && |
- CreateConfig<T>(0, format).IsOk()) { |
- return rtc::Optional<AudioCodecInfo>({8000, format.num_channels, 64000}); |
- } |
- return rtc::Optional<AudioCodecInfo>(); |
-} |
- |
} // namespace |
bool AudioEncoderPcm::Config::IsOk() const { |
@@ -138,15 +108,6 @@ void AudioEncoderPcm::Reset() { |
AudioEncoderPcmA::AudioEncoderPcmA(const CodecInst& codec_inst) |
: AudioEncoderPcmA(CreateConfig<AudioEncoderPcmA>(codec_inst)) {} |
-AudioEncoderPcmA::AudioEncoderPcmA(int payload_type, |
- const SdpAudioFormat& format) |
- : AudioEncoderPcmA(CreateConfig<AudioEncoderPcmA>(payload_type, format)) {} |
- |
-rtc::Optional<AudioCodecInfo> AudioEncoderPcmA::QueryAudioEncoder( |
- const SdpAudioFormat& format) { |
- return QueryAudioEncoderImpl<AudioEncoderPcmA>(format); |
-} |
- |
size_t AudioEncoderPcmA::EncodeCall(const int16_t* audio, |
size_t input_len, |
uint8_t* encoded) { |
@@ -164,15 +125,6 @@ AudioEncoder::CodecType AudioEncoderPcmA::GetCodecType() const { |
AudioEncoderPcmU::AudioEncoderPcmU(const CodecInst& codec_inst) |
: AudioEncoderPcmU(CreateConfig<AudioEncoderPcmU>(codec_inst)) {} |
-AudioEncoderPcmU::AudioEncoderPcmU(int payload_type, |
- const SdpAudioFormat& format) |
- : AudioEncoderPcmU(CreateConfig<AudioEncoderPcmU>(payload_type, format)) {} |
- |
-rtc::Optional<AudioCodecInfo> AudioEncoderPcmU::QueryAudioEncoder( |
- const SdpAudioFormat& format) { |
- return QueryAudioEncoderImpl<AudioEncoderPcmU>(format); |
-} |
- |
size_t AudioEncoderPcmU::EncodeCall(const int16_t* audio, |
size_t input_len, |
uint8_t* encoded) { |