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

Unified Diff: webrtc/voice_engine/channel.cc

Issue 2705093002: Injectable audio encoders: WebRtcVoiceEngine and company (Closed)
Patch Set: Channel::GetSendCodec asks both its acm and its codec manager. Created 3 years, 8 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
« no previous file with comments | « webrtc/voice_engine/channel.h ('k') | webrtc/voice_engine/channel_proxy.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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;
« no previous file with comments | « webrtc/voice_engine/channel.h ('k') | webrtc/voice_engine/channel_proxy.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698