Remove PeerConnection voice_channel/video_channel methods
These methods no longer work with Unified Plan and have been
replaced by iterating over RtpTransceivers to get all the
VoiceChannels and VideoChannels.
Bug: webrtc:8587
Change-Id: I66ec282ee9f7eb987c32e30957733c13c6cf45b8
Reviewed-on: https://webrtc-review.googlesource.com/55760
Reviewed-by: Taylor Brandstetter <deadbeef@webrtc.org>
Commit-Queue: Steve Anton <steveanton@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#22110}
diff --git a/pc/peerconnection.h b/pc/peerconnection.h
index d788b1e..f1dc299 100644
--- a/pc/peerconnection.h
+++ b/pc/peerconnection.h
@@ -203,26 +203,6 @@
return initial_offerer_ && *initial_offerer_;
}
- cricket::VoiceChannel* voice_channel() const override {
- if (IsUnifiedPlan()) {
- // TODO(bugs.webrtc.org/8764): Change stats collection to work with
- // transceivers.
- return nullptr;
- }
- return static_cast<cricket::VoiceChannel*>(
- GetAudioTransceiver()->internal()->channel());
- }
-
- cricket::VideoChannel* video_channel() const override {
- if (IsUnifiedPlan()) {
- // TODO(bugs.webrtc.org/8764): Change stats collection to work with
- // transceivers.
- return nullptr;
- }
- return static_cast<cricket::VideoChannel*>(
- GetVideoTransceiver()->internal()->channel());
- }
-
std::vector<
rtc::scoped_refptr<RtpTransceiverProxyWithInternal<RtpTransceiver>>>
GetTransceiversInternal() const override {
@@ -295,13 +275,10 @@
// Implements MessageHandler.
void OnMessage(rtc::Message* msg) override;
- cricket::VoiceMediaChannel* voice_media_channel() const {
- return voice_channel() ? voice_channel()->media_channel() : nullptr;
- }
-
- cricket::VideoMediaChannel* video_media_channel() const {
- return video_channel() ? video_channel()->media_channel() : nullptr;
- }
+ // Plan B helpers for getting the voice/video media channels for the single
+ // audio/video transceiver, if it exists.
+ cricket::VoiceMediaChannel* voice_media_channel() const;
+ cricket::VideoMediaChannel* video_media_channel() const;
std::vector<rtc::scoped_refptr<RtpSenderProxyWithInternal<RtpSenderInternal>>>
GetSendersInternal() const;
@@ -314,6 +291,9 @@
rtc::scoped_refptr<RtpTransceiverProxyWithInternal<RtpTransceiver>>
GetVideoTransceiver() const;
+ rtc::scoped_refptr<RtpTransceiverProxyWithInternal<RtpTransceiver>>
+ GetFirstAudioTransceiver() const;
+
void CreateAudioReceiver(MediaStreamInterface* stream,
const RtpSenderInfo& remote_sender_info);