peerconnection: remove old helper function

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 <hbos@webrtc.org>
Commit-Queue: Philipp Hancke <philipp.hancke@googlemail.com>
Cr-Commit-Position: refs/heads/master@{#31701}
This commit is contained in:
Philipp Hancke
2020-07-10 13:26:44 +02:00
committed by Commit Bot
parent edacbd53de
commit 0800010dd6
2 changed files with 4 additions and 23 deletions

View File

@ -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<RtpSenderProxyWithInternal<RtpSenderInternal>>
PeerConnection::FindSenderForTrack(MediaStreamTrackInterface* track) const {
for (const auto& transceiver : transceivers_) {

View File

@ -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<RtpSenderProxyWithInternal<RtpSenderInternal>>
FindSenderForTrack(MediaStreamTrackInterface* track) const