Change RtpSenders to interact with the media channel directly
Similar to the change for RtpReceivers, this removes the BaseChannel
methods that would just proxy calls to the MediaChannel and instead
gives the MediaChannel directly to the RtpSenders to make the calls
directly.
Bug: webrtc:8587
Change-Id: Ibab98d75ff1641e902281ad9e31ffdad36caff35
Reviewed-on: https://webrtc-review.googlesource.com/38983
Commit-Queue: Steve Anton <steveanton@webrtc.org>
Reviewed-by: Taylor Brandstetter <deadbeef@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#21608}
diff --git a/pc/rtptransceiver.cc b/pc/rtptransceiver.cc
index 0dfc8b5..ecb8ec8 100644
--- a/pc/rtptransceiver.cc
+++ b/pc/rtptransceiver.cc
@@ -60,11 +60,15 @@
for (auto sender : senders_) {
if (media_type() == cricket::MEDIA_TYPE_AUDIO) {
+ auto* voice_channel = static_cast<cricket::VoiceChannel*>(channel);
static_cast<AudioRtpSender*>(sender->internal())
- ->SetChannel(static_cast<cricket::VoiceChannel*>(channel));
+ ->SetMediaChannel(voice_channel ? voice_channel->media_channel()
+ : nullptr);
} else {
+ auto* video_channel = static_cast<cricket::VideoChannel*>(channel);
static_cast<VideoRtpSender*>(sender->internal())
- ->SetChannel(static_cast<cricket::VideoChannel*>(channel));
+ ->SetMediaChannel(video_channel ? video_channel->media_channel()
+ : nullptr);
}
}