Support receiving DTMF for multiple RTP clock rates.

BUG=webrtc:2795

Review-Url: https://codereview.webrtc.org/2337473002
Cr-Commit-Position: refs/heads/master@{#15128}
This commit is contained in:
solenberg
2016-11-17 04:45:19 -08:00
committed by Commit bot
parent fbfb536ee9
commit 2779bab02a
16 changed files with 266 additions and 93 deletions

View File

@ -102,6 +102,9 @@ const CodecInst ACMCodecDB::database_[] = {
{100, "CN", 48000, 1440, 1, 0},
#endif
{106, "telephone-event", 8000, 240, 1, 0},
{114, "telephone-event", 16000, 240, 1, 0},
{115, "telephone-event", 32000, 240, 1, 0},
{116, "telephone-event", 48000, 240, 1, 0},
#ifdef WEBRTC_CODEC_RED
{127, "red", 8000, 0, 1, 0},
#endif
@ -154,10 +157,14 @@ const ACMCodecDB::CodecSettings ACMCodecDB::codec_settings_[] = {
{1, {240}, 240, 1},
{1, {480}, 480, 1},
{1, {960}, 960, 1},
// TODO(solenberg): What is this flag? It is never set in the build files.
#ifdef ENABLE_48000_HZ
{1, {1440}, 1440, 1},
#endif
{1, {240}, 240, 1},
{1, {240}, 240, 1},
{1, {240}, 240, 1},
{1, {240}, 240, 1},
#ifdef WEBRTC_CODEC_RED
{1, {0}, 0, 1},
#endif
@ -204,6 +211,9 @@ const NetEqDecoder ACMCodecDB::neteq_decoders_[] = {
NetEqDecoder::kDecoderCNGswb48kHz,
#endif
NetEqDecoder::kDecoderAVT,
NetEqDecoder::kDecoderAVT16kHz,
NetEqDecoder::kDecoderAVT32kHz,
NetEqDecoder::kDecoderAVT48kHz,
#ifdef WEBRTC_CODEC_RED
NetEqDecoder::kDecoderRED,
#endif

View File

@ -81,8 +81,14 @@ bool RemapPltypeAndUseThisCodec(const char* plname,
*pltype = 103;
} else if (STR_CASE_CMP(plname, "ISAC") == 0 && plfreq == 32000) {
*pltype = 104;
} else if (STR_CASE_CMP(plname, "telephone-event") == 0) {
} else if (STR_CASE_CMP(plname, "telephone-event") == 0 && plfreq == 8000) {
*pltype = 106;
} else if (STR_CASE_CMP(plname, "telephone-event") == 0 && plfreq == 16000) {
*pltype = 114;
} else if (STR_CASE_CMP(plname, "telephone-event") == 0 && plfreq == 32000) {
*pltype = 115;
} else if (STR_CASE_CMP(plname, "telephone-event") == 0 && plfreq == 48000) {
*pltype = 116;
} else if (STR_CASE_CMP(plname, "red") == 0) {
*pltype = 117;
} else if (STR_CASE_CMP(plname, "L16") == 0 && plfreq == 8000) {

View File

@ -102,7 +102,6 @@ int AcmReceiver::InsertPacket(const WebRtcRTPHeader& rtp_header,
RTC_DCHECK(last_audio_format_);
last_packet_sample_rate_hz_ = rtc::Optional<int>(ci->plfreq);
}
} // |crit_sect_| is released.
if (neteq_->InsertPacket(rtp_header, incoming_payload, receive_timestamp) <

View File

@ -99,6 +99,15 @@ rtc::Optional<SdpAudioFormat> RentACodec::NetEqDecoderToSdpAudioFormat(
case NetEqDecoder::kDecoderAVT:
return rtc::Optional<SdpAudioFormat>(
SdpAudioFormat("telephone-event", 8000, 1));
case NetEqDecoder::kDecoderAVT16kHz:
return rtc::Optional<SdpAudioFormat>(
SdpAudioFormat("telephone-event", 16000, 1));
case NetEqDecoder::kDecoderAVT32kHz:
return rtc::Optional<SdpAudioFormat>(
SdpAudioFormat("telephone-event", 32000, 1));
case NetEqDecoder::kDecoderAVT48kHz:
return rtc::Optional<SdpAudioFormat>(
SdpAudioFormat("telephone-event", 48000, 1));
case NetEqDecoder::kDecoderCNGnb:
return rtc::Optional<SdpAudioFormat>(SdpAudioFormat("cn", 8000, 1));
case NetEqDecoder::kDecoderCNGwb:

View File

@ -72,6 +72,9 @@ class RentACodec {
kCNFB,
#endif
kAVT,
kAVT16kHz,
kAVT32kHz,
kAVT48kHz,
#ifdef WEBRTC_CODEC_RED
kRED,
#endif
@ -127,6 +130,9 @@ class RentACodec {
kDecoderG722_2ch,
kDecoderRED,
kDecoderAVT,
kDecoderAVT16kHz,
kDecoderAVT32kHz,
kDecoderAVT48kHz,
kDecoderCNGnb,
kDecoderCNGwb,
kDecoderCNGswb32kHz,