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