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

Unified Diff: talk/media/webrtc/webrtcvoiceengine.cc

Issue 1327933002: Full impl of NnChannel::SetSendParameters and NnChannel::SetRecvParameters (Closed) Base URL: https://chromium.googlesource.com/external/webrtc.git@master
Patch Set: rebase Created 5 years, 3 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: talk/media/webrtc/webrtcvoiceengine.cc
diff --git a/talk/media/webrtc/webrtcvoiceengine.cc b/talk/media/webrtc/webrtcvoiceengine.cc
index 43cbc2e929dbbccd87e1434f8d6698ab47dcbf22..832ab26c637b3db705f63e10716d5442c1a137e8 100644
--- a/talk/media/webrtc/webrtcvoiceengine.cc
+++ b/talk/media/webrtc/webrtcvoiceengine.cc
@@ -581,14 +581,11 @@ int WebRtcVoiceEngine::GetCapabilities() {
VoiceMediaChannel* WebRtcVoiceEngine::CreateChannel(
const AudioOptions& options) {
- WebRtcVoiceMediaChannel* ch = new WebRtcVoiceMediaChannel(this);
+ WebRtcVoiceMediaChannel* ch = new WebRtcVoiceMediaChannel(this, options);
if (!ch->valid()) {
delete ch;
return nullptr;
}
- if (!ch->SetOptions(options)) {
- LOG(LS_WARNING) << "Failed to set options while creating channel.";
- }
return ch;
}
@@ -1689,7 +1686,8 @@ class WebRtcVoiceMediaChannel::WebRtcVoiceChannelRenderer
};
// WebRtcVoiceMediaChannel
-WebRtcVoiceMediaChannel::WebRtcVoiceMediaChannel(WebRtcVoiceEngine* engine)
+WebRtcVoiceMediaChannel::WebRtcVoiceMediaChannel(WebRtcVoiceEngine* engine,
+ const AudioOptions& options)
: engine_(engine),
voe_channel_(engine->CreateMediaVoiceChannel()),
send_bitrate_setting_(false),
@@ -1708,6 +1706,7 @@ WebRtcVoiceMediaChannel::WebRtcVoiceMediaChannel(WebRtcVoiceEngine* engine)
LOG(LS_VERBOSE) << "WebRtcVoiceMediaChannel::WebRtcVoiceMediaChannel "
<< voe_channel();
ConfigureSendChannel(voe_channel());
+ SetOptions(options);
}
WebRtcVoiceMediaChannel::~WebRtcVoiceMediaChannel() {
@@ -2093,6 +2092,11 @@ bool WebRtcVoiceMediaChannel::SetSendCodecs(
bool WebRtcVoiceMediaChannel::SetSendCodecs(
const std::vector<AudioCodec>& codecs) {
+ // Don't change any state if codec list is empty.
+ if (codecs.empty()) {
+ return true;
+ }
pthatcher1 2015/09/14 19:42:02 Same here
+
dtmf_allowed_ = false;
for (const AudioCodec& codec : codecs) {
// Find the DTMF telephone event "codec".

Powered by Google App Engine
This is Rietveld 408576698