Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(610)

Unified Diff: webrtc/voice_engine/channel.cc

Issue 2388153004: Stop using old AudioCodingModule::RegisterReceiveCodec overloads (Closed)
Patch Set: Created 4 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: webrtc/voice_engine/channel.cc
diff --git a/webrtc/voice_engine/channel.cc b/webrtc/voice_engine/channel.cc
index ce9770e8a461b68fa67c61ae9e17979b8199035c..ef657746c885737e674dafb071ab413216f56f3f 100644
--- a/webrtc/voice_engine/channel.cc
+++ b/webrtc/voice_engine/channel.cc
@@ -48,14 +48,6 @@ namespace {
constexpr int64_t kMaxRetransmissionWindowMs = 1000;
constexpr int64_t kMinRetransmissionWindowMs = 30;
-bool RegisterReceiveCodec(std::unique_ptr<AudioCodingModule>* acm,
- acm2::RentACodec* rac,
- const CodecInst& ci) {
- const int result = (*acm)->RegisterReceiveCodec(
- ci, [&] { return rac->RentIsacDecoder(ci.plfreq); });
- return result == 0;
-}
-
} // namespace
const int kTelephoneEventAttenuationdB = 10;
@@ -481,7 +473,8 @@ int32_t Channel::OnInitializeDecoder(
receiveCodec.pacsize = dummyCodec.pacsize;
// Register the new codec to the ACM
- if (!RegisterReceiveCodec(&audio_coding_, &rent_a_codec_, receiveCodec)) {
+ if (!audio_coding_->RegisterReceiveCodec(receiveCodec.pltype,
ossu 2016/10/05 13:39:59 Don't make a CodecInst just to convert it to an Sd
kwiberg-webrtc 2016/10/06 12:14:52 The problem is that since the caller has given us
+ CodecInstToSdp(receiveCodec))) {
WEBRTC_TRACE(kTraceWarning, kTraceVoice, VoEId(_instanceId, _channelId),
"Channel::OnInitializeDecoder() invalid codec ("
"pt=%d, name=%s) received - 1",
@@ -1027,7 +1020,8 @@ int32_t Channel::Init() {
// Register default PT for outband 'telephone-event'
if (!STR_CASE_CMP(codec.plname, "telephone-event")) {
if (_rtpRtcpModule->RegisterSendPayload(codec) == -1 ||
- !RegisterReceiveCodec(&audio_coding_, &rent_a_codec_, codec)) {
+ !audio_coding_->RegisterReceiveCodec(codec.pltype,
+ CodecInstToSdp(codec))) {
WEBRTC_TRACE(kTraceWarning, kTraceVoice, VoEId(_instanceId, _channelId),
"Channel::Init() failed to register outband "
"'telephone-event' (%d/%d) correctly",
@@ -1038,7 +1032,8 @@ int32_t Channel::Init() {
if (!STR_CASE_CMP(codec.plname, "CN")) {
if (!codec_manager_.RegisterEncoder(codec) ||
!codec_manager_.MakeEncoder(&rent_a_codec_, audio_coding_.get()) ||
- !RegisterReceiveCodec(&audio_coding_, &rent_a_codec_, codec) ||
+ !audio_coding_->RegisterReceiveCodec(codec.pltype,
+ CodecInstToSdp(codec)) ||
_rtpRtcpModule->RegisterSendPayload(codec) == -1) {
WEBRTC_TRACE(kTraceWarning, kTraceVoice, VoEId(_instanceId, _channelId),
"Channel::Init() failed to register CN (%d/%d) "
@@ -1387,9 +1382,11 @@ int32_t Channel::SetRecPayloadType(const CodecInst& codec) {
return -1;
}
}
- if (!RegisterReceiveCodec(&audio_coding_, &rent_a_codec_, codec)) {
+ if (!audio_coding_->RegisterReceiveCodec(codec.pltype,
+ CodecInstToSdp(codec))) {
audio_coding_->UnregisterReceiveCodec(codec.pltype);
- if (!RegisterReceiveCodec(&audio_coding_, &rent_a_codec_, codec)) {
+ if (!audio_coding_->RegisterReceiveCodec(codec.pltype,
+ CodecInstToSdp(codec))) {
_engineStatisticsPtr->SetLastError(
VE_AUDIO_CODING_MODULE_ERROR, kTraceError,
"SetRecPayloadType() ACM registration failed - 1");
« webrtc/modules/audio_coding/test/delay_test.cc ('K') | « webrtc/modules/utility/source/coder.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698