Prevent a voice channel from sending data before a source is set.
At the top level, setting a track on an RtpSender is equivalent to
setting a source (previously called a renderer)
on a voice send stream. An RtpSender without a track
is not supposed to send data (not even muted data), so a send stream without
a source shouldn't send data.
Also replacing SendFlags with a boolean and implementing "Start"
and "Stop" methods on AudioSendStream, which was planned anyway
and simplifies this CL.
R=pthatcher@webrtc.org, solenberg@webrtc.org
Review URL: https://codereview.webrtc.org/1741933002 .
Cr-Commit-Position: refs/heads/master@{#11918}
diff --git a/webrtc/pc/channel.cc b/webrtc/pc/channel.cc
index b05c0bc..c6553a0 100644
--- a/webrtc/pc/channel.cc
+++ b/webrtc/pc/channel.cc
@@ -1334,9 +1334,9 @@
bool VoiceChannel::SetAudioSend(uint32_t ssrc,
bool enable,
const AudioOptions* options,
- AudioRenderer* renderer) {
+ AudioSource* source) {
return InvokeOnWorker(Bind(&VoiceMediaChannel::SetAudioSend, media_channel(),
- ssrc, enable, options, renderer));
+ ssrc, enable, options, source));
}
// TODO(juberti): Handle early media the right way. We should get an explicit
@@ -1454,10 +1454,7 @@
// Send outgoing data if we're the active call, we have the remote content,
// and we have had some form of connectivity.
bool send = IsReadyToSend();
- SendFlags send_flag = send ? SEND_MICROPHONE : SEND_NOTHING;
- if (!media_channel()->SetSend(send_flag)) {
- LOG(LS_ERROR) << "Failed to SetSend " << send_flag << " on voice channel";
- }
+ media_channel()->SetSend(send);
LOG(LS_INFO) << "Changing voice state, recv=" << recv << " send=" << send;
}