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

Unified Diff: webrtc/audio/audio_receive_stream.cc

Issue 2461523002: Remove usage of VoEBase::AssociateSendChannel() from WVoMC. (Closed)
Patch Set: Added unit tests Created 4 years, 1 month 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_receive_stream.cc
diff --git a/webrtc/audio/audio_receive_stream.cc b/webrtc/audio/audio_receive_stream.cc
index cc30939b92134af837ce91d76ec350d5ce570258..840352d9c2e8536dcefdc1a220b665392f4b9434 100644
--- a/webrtc/audio/audio_receive_stream.cc
+++ b/webrtc/audio/audio_receive_stream.cc
@@ -14,6 +14,7 @@
#include <utility>
#include "webrtc/api/call/audio_sink.h"
+#include "webrtc/audio/audio_send_stream.h"
#include "webrtc/audio/audio_state.h"
#include "webrtc/audio/conversion.h"
#include "webrtc/base/checks.h"
@@ -143,6 +144,7 @@ AudioReceiveStream::~AudioReceiveStream() {
RTC_DCHECK(thread_checker_.CalledOnValidThread());
LOG(LS_INFO) << "~AudioReceiveStream: " << config_.ToString();
Stop();
+ AssociateSendStream(nullptr);
kwiberg-webrtc 2016/11/11 13:47:39 Or just channel_proxy_->DisassociateSendChannel();
the sun 2016/11/11 20:03:39 Yes, thanks.
channel_proxy_->DeRegisterExternalTransport();
channel_proxy_->ResetCongestionControlObjects();
channel_proxy_->SetRtcEventLog(nullptr);
@@ -230,6 +232,18 @@ const webrtc::AudioReceiveStream::Config& AudioReceiveStream::config() const {
return config_;
}
+void AudioReceiveStream::AssociateSendStream(AudioSendStream* send_stream) {
+ RTC_DCHECK(thread_checker_.CalledOnValidThread());
+ if (send_stream) {
+ VoiceEngineImpl* voe_impl = static_cast<VoiceEngineImpl*>(voice_engine());
kwiberg-webrtc 2016/11/11 13:47:39 Is this static_cast guaranteed to be safe? And so,
the sun 2016/11/11 20:03:39 I don't see how, without exposing VoiceEngineImpl
kwiberg-webrtc 2016/11/13 20:17:02 The only way to make this statically safe (since y
the sun 2016/11/14 18:58:06 Well, no, we don't want to expose that method in t
+ std::unique_ptr<voe::ChannelProxy> send_channel_proxy =
+ voe_impl->GetChannelProxy(send_stream->config().voe_channel_id);
+ channel_proxy_->AssociateSendChannel(*send_channel_proxy.get());
+ } else {
+ channel_proxy_->DisassociateSendChannel();
+ }
+}
+
void AudioReceiveStream::SignalNetworkState(NetworkState state) {
RTC_DCHECK(thread_checker_.CalledOnValidThread());
}

Powered by Google App Engine
This is Rietveld 408576698