Index: talk/media/webrtc/webrtcvoiceengine.cc |
diff --git a/talk/media/webrtc/webrtcvoiceengine.cc b/talk/media/webrtc/webrtcvoiceengine.cc |
index 0b5bed1623753545b2087a6c61f595ea52fcf7f4..e41ad048fba175720954af746ed2237609518f60 100644 |
--- a/talk/media/webrtc/webrtcvoiceengine.cc |
+++ b/talk/media/webrtc/webrtcvoiceengine.cc |
@@ -1248,6 +1248,11 @@ class WebRtcVoiceMediaChannel::WebRtcAudioReceiveStream { |
return config_.voe_channel_id; |
} |
+ void SetRawAudioSink(rtc::scoped_ptr<webrtc::AudioSinkInterface> sink) { |
+ RTC_DCHECK(worker_thread_checker_.CalledOnValidThread()); |
+ stream_->SetSink(std::move(sink)); |
+ } |
+ |
private: |
void RecreateAudioReceiveStream(bool use_combined_bwe, |
const std::vector<webrtc::RtpExtension>& extensions) { |
@@ -2032,6 +2037,7 @@ bool WebRtcVoiceMediaChannel::RemoveRecvStream(uint32_t ssrc) { |
// Clean up and delete the receive stream+channel. |
LOG(LS_INFO) << "Removing audio receive stream " << ssrc |
<< " with VoiceEngine channel #" << channel << "."; |
+ it->second->SetRawAudioSink(nullptr); |
delete it->second; |
recv_streams_.erase(it); |
return DeleteVoEChannel(channel); |
@@ -2408,6 +2414,18 @@ bool WebRtcVoiceMediaChannel::GetStats(VoiceMediaInfo* info) { |
return true; |
} |
+void WebRtcVoiceMediaChannel::SetRawAudioSink( |
+ uint32_t ssrc, |
+ rtc::scoped_ptr<webrtc::AudioSinkInterface> sink) { |
+ RTC_DCHECK(worker_thread_checker_.CalledOnValidThread()); |
the sun
2015/12/11 16:32:05
Nit: add
LOG(LS_VERBOSE) << "WebRtcVoiceMediaChann
tommi (sloooow) - chröme
2015/12/11 17:51:18
Done.
|
+ const auto it = recv_streams_.find(ssrc); |
+ if (it == recv_streams_.end()) { |
+ LOG(LS_WARNING) << "SetRawAudioSink: no recv stream" << ssrc; |
+ return; |
+ } |
+ it->second->SetRawAudioSink(std::move(sink)); |
+} |
+ |
int WebRtcVoiceMediaChannel::GetOutputLevel(int channel) { |
unsigned int ulevel = 0; |
int ret = engine()->voe()->volume()->GetSpeechOutputLevel(channel, ulevel); |