Refactor the relationship between BaseChannel and MediaChannel so that we send over all the parameters in one method call rather then having them broken up into multiple method calls. This should allow future refactorings of the WebRtcVideoEngine2 to not recreate configurations so many times, and have more simple code as well.
R=deadbeef@webrtc.org, pbos@webrtc.org
Review URL: https://codereview.webrtc.org/1229283003 .
Cr-Commit-Position: refs/heads/master@{#9690}
diff --git a/talk/media/webrtc/webrtcvoiceengine.cc b/talk/media/webrtc/webrtcvoiceengine.cc
index 6a448c8..e288e70 100644
--- a/talk/media/webrtc/webrtcvoiceengine.cc
+++ b/talk/media/webrtc/webrtcvoiceengine.cc
@@ -1743,6 +1743,24 @@
DeleteChannel(voe_channel());
}
+bool WebRtcVoiceMediaChannel::SetSendParameters(
+ const AudioSendParameters& params) {
+ // TODO(pthatcher): Refactor this to be more clean now that we have
+ // all the information at once.
+ return (SetSendCodecs(params.codecs) &&
+ SetSendRtpHeaderExtensions(params.extensions) &&
+ SetMaxSendBandwidth(params.max_bandwidth_bps) &&
+ SetOptions(params.options));
+}
+
+bool WebRtcVoiceMediaChannel::SetRecvParameters(
+ const AudioRecvParameters& params) {
+ // TODO(pthatcher): Refactor this to be more clean now that we have
+ // all the information at once.
+ return (SetRecvCodecs(params.codecs) &&
+ SetRecvRtpHeaderExtensions(params.extensions));
+}
+
bool WebRtcVoiceMediaChannel::SetOptions(const AudioOptions& options) {
LOG(LS_INFO) << "Setting voice channel options: "
<< options.ToString();