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

Unified Diff: webrtc/audio/audio_send_stream.cc

Issue 2397573006: Using AudioOption to enable audio network adaptor. (Closed)
Patch Set: new approach: go through AudioSendStream's ctor 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/audio/audio_send_stream.cc
diff --git a/webrtc/audio/audio_send_stream.cc b/webrtc/audio/audio_send_stream.cc
index fbed0f12af09281f57adc8620a3de708d1bb5a63..904cd5b3b37470756b91822742e69382775297da 100644
--- a/webrtc/audio/audio_send_stream.cc
+++ b/webrtc/audio/audio_send_stream.cc
@@ -387,6 +387,24 @@ bool AudioSendStream::SetupSendCodec() {
return false;
}
}
+
+ if (config_.enable_audio_network_adaptor) {
+ // Audio network adaptor is only allowed for Opus currently.
+ // |SetReceiverFrameLengthRange| needs to be called before
+ // |EnableAudioNetworkAdaptor|.
+ channel_proxy_->SetReceiverFrameLengthRange(send_codec_spec.min_ptime_ms,
+ send_codec_spec.max_ptime_ms);
+ if (!channel_proxy_->EnableAudioNetworkAdaptor(
+ config_.audio_network_adaptor_config)) {
+ LOG(LS_ERROR) << "Audio network adaptor cannot be enabled on SSRC "
+ << config_.rtp.ssrc;
+ return false;
+ }
+ LOG(LS_INFO) << "Audio network adaptor enabled on SSRC "
+ << config_.rtp.ssrc;
+ } else {
+ channel_proxy_->DisableAudioNetworkAdaptor();
+ }
}
// Set the CN payloadtype and the VAD status.

Powered by Google App Engine
This is Rietveld 408576698