From 0800010dd6976bd1a1fb19c3c25ba167ed31bd27 Mon Sep 17 00:00:00 2001 From: Philipp Hancke Date: Fri, 10 Jul 2020 13:26:44 +0200 Subject: [PATCH] peerconnection: remove old helper function MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit the TODO is obsolete, that code is only supported in plan-b mode and is a one-liner. BUG=webrtc:7600 Change-Id: I4e6c52c3a5b4cfff1b2d9185dedc786df9f474a4 Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/179066 Reviewed-by: Henrik Boström Commit-Queue: Philipp Hancke Cr-Commit-Position: refs/heads/master@{#31701} --- pc/peer_connection.cc | 23 ++++------------------- pc/peer_connection.h | 4 ---- 2 files changed, 4 insertions(+), 23 deletions(-) diff --git a/pc/peer_connection.cc b/pc/peer_connection.cc index 60d6b16895..877f1003a9 100644 --- a/pc/peer_connection.cc +++ b/pc/peer_connection.cc @@ -4810,8 +4810,8 @@ void PeerConnection::GetOptionsForPlanBOffer( const PeerConnectionInterface::RTCOfferAnswerOptions& offer_answer_options, cricket::MediaSessionOptions* session_options) { // Figure out transceiver directional preferences. - bool send_audio = HasRtpSender(cricket::MEDIA_TYPE_AUDIO); - bool send_video = HasRtpSender(cricket::MEDIA_TYPE_VIDEO); + bool send_audio = !GetAudioTransceiver()->internal()->senders().empty(); + bool send_video = !GetVideoTransceiver()->internal()->senders().empty(); // By default, generate sendrecv/recvonly m= sections. bool recv_audio = true; @@ -5112,8 +5112,8 @@ void PeerConnection::GetOptionsForPlanBAnswer( const PeerConnectionInterface::RTCOfferAnswerOptions& offer_answer_options, cricket::MediaSessionOptions* session_options) { // Figure out transceiver directional preferences. - bool send_audio = HasRtpSender(cricket::MEDIA_TYPE_AUDIO); - bool send_video = HasRtpSender(cricket::MEDIA_TYPE_VIDEO); + bool send_audio = !GetAudioTransceiver()->internal()->senders().empty(); + bool send_video = !GetVideoTransceiver()->internal()->senders().empty(); // By default, generate sendrecv/recvonly m= sections. The direction is also // restricted by the direction in the offer. @@ -5576,21 +5576,6 @@ PeerConnection::GetVideoTransceiver() const { return nullptr; } -// TODO(bugs.webrtc.org/7600): Remove this when multiple transceivers with -// individual transceiver directions are supported. -bool PeerConnection::HasRtpSender(cricket::MediaType type) const { - switch (type) { - case cricket::MEDIA_TYPE_AUDIO: - return !GetAudioTransceiver()->internal()->senders().empty(); - case cricket::MEDIA_TYPE_VIDEO: - return !GetVideoTransceiver()->internal()->senders().empty(); - case cricket::MEDIA_TYPE_DATA: - return false; - } - RTC_NOTREACHED(); - return false; -} - rtc::scoped_refptr> PeerConnection::FindSenderForTrack(MediaStreamTrackInterface* track) const { for (const auto& transceiver : transceivers_) { diff --git a/pc/peer_connection.h b/pc/peer_connection.h index 4351831237..2591c4b75f 100644 --- a/pc/peer_connection.h +++ b/pc/peer_connection.h @@ -810,10 +810,6 @@ class PeerConnection : public PeerConnectionInternal, void FillInMissingRemoteMids(cricket::SessionDescription* remote_description) RTC_RUN_ON(signaling_thread()); - // Is there an RtpSender of the given type? - bool HasRtpSender(cricket::MediaType type) const - RTC_RUN_ON(signaling_thread()); - // Return the RtpSender with the given track attached. rtc::scoped_refptr> FindSenderForTrack(MediaStreamTrackInterface* track) const