Prevent channels being set on stopped transceiver.
Fixing bug that allows a channel to be set on a stopped transceiver.
This CL contains the following refactoring:
1. Extracted ChannelInterface from BaseChannel
2. Unified SetXxxMediaChannel (Voice, Video) into SetMediaChannel
Bug: webrtc:9932
Change-Id: I2fbf00c823b7848ad4f2acb6e80b1b58ac45ee38
Reviewed-on: https://webrtc-review.googlesource.com/c/110564
Reviewed-by: Seth Hampson <shampson@webrtc.org>
Reviewed-by: Steve Anton <steveanton@webrtc.org>
Commit-Queue: Amit Hilbuch <amithi@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#25641}
diff --git a/pc/rtptransceiver.h b/pc/rtptransceiver.h
index 3e0d433..07db196 100644
--- a/pc/rtptransceiver.h
+++ b/pc/rtptransceiver.h
@@ -70,11 +70,11 @@
// Returns the Voice/VideoChannel set for this transceiver. May be null if
// the transceiver is not in the currently set local/remote description.
- cricket::BaseChannel* channel() const { return channel_; }
+ cricket::ChannelInterface* channel() const { return channel_; }
// Sets the Voice/VideoChannel. The caller must pass in the correct channel
// implementation based on the type of the transceiver.
- void SetChannel(cricket::BaseChannel* channel);
+ void SetChannel(cricket::ChannelInterface* channel);
// Adds an RtpSender of the appropriate type to be owned by this transceiver.
// Must not be null.
@@ -177,7 +177,7 @@
void SetCodecPreferences(rtc::ArrayView<RtpCodecCapability> codecs) override;
private:
- void OnFirstPacketReceived(cricket::BaseChannel* channel);
+ void OnFirstPacketReceived(cricket::ChannelInterface* channel);
const bool unified_plan_;
const cricket::MediaType media_type_;
@@ -196,7 +196,7 @@
bool created_by_addtrack_ = false;
bool has_ever_been_used_to_send_ = false;
- cricket::BaseChannel* channel_ = nullptr;
+ cricket::ChannelInterface* channel_ = nullptr;
};
BEGIN_SIGNALING_PROXY_MAP(RtpTransceiver)