Index: webrtc/voice_engine/channel.cc |
diff --git a/webrtc/voice_engine/channel.cc b/webrtc/voice_engine/channel.cc |
index 8c9b00179f37c705a4356475d3baaa9aef52da7b..f56d1d822c84f24d1534791c38f02cc3fa74f4fd 100644 |
--- a/webrtc/voice_engine/channel.cc |
+++ b/webrtc/voice_engine/channel.cc |
@@ -1303,9 +1303,15 @@ bool Channel::SetEncoder(int payload_type, |
} |
audio_coding_->SetEncoder(std::move(encoder)); |
+ codec_manager_.UnsetCodecInst(); |
return true; |
} |
+void Channel::ModifyEncoder( |
+ rtc::FunctionView<void(std::unique_ptr<AudioEncoder>*)> modifier) { |
+ audio_coding_->ModifyEncoder(modifier); |
+} |
+ |
int32_t Channel::RegisterVoiceEngineObserver(VoiceEngineObserver& observer) { |
WEBRTC_TRACE(kTraceInfo, kTraceVoice, VoEId(_instanceId, _channelId), |
"Channel::RegisterVoiceEngineObserver()"); |
@@ -1337,9 +1343,16 @@ int32_t Channel::DeRegisterVoiceEngineObserver() { |
} |
int32_t Channel::GetSendCodec(CodecInst& codec) { |
- auto send_codec = codec_manager_.GetCodecInst(); |
- if (send_codec) { |
- codec = *send_codec; |
+ { |
ossu
2017/04/26 15:45:36
At first, I had this code just ask the ACM directl
kwiberg-webrtc
2017/04/26 20:03:36
Yes. Hopefully we can remove that soon-ish.
|
+ const CodecInst* send_codec = codec_manager_.GetCodecInst(); |
+ if (send_codec) { |
+ codec = *send_codec; |
+ return 0; |
+ } |
+ } |
+ rtc::Optional<CodecInst> acm_send_codec = audio_coding_->SendCodec(); |
+ if (acm_send_codec) { |
+ codec = *acm_send_codec; |
return 0; |
} |
return -1; |