From 48171ec264b01e712e70239ef009403826c3f0ef Mon Sep 17 00:00:00 2001 From: Harald Alvestrand Date: Tue, 20 Apr 2021 15:06:03 +0000 Subject: [PATCH] Remove more mentions of RTP datachannels Bug: webtc:6625 Change-Id: I38c51c4c10df8a5f517733f211e030359d33e787 Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/215783 Reviewed-by: Florent Castelli Commit-Queue: Harald Alvestrand Cr-Commit-Position: refs/heads/master@{#33799} --- media/base/codec.cc | 19 ----------------- media/base/codec.h | 17 --------------- media/base/codec_unittest.cc | 22 -------------------- media/base/media_constants.cc | 5 ----- media/base/media_constants.h | 8 ------- media/engine/payload_type_mapper.cc | 1 - media/engine/payload_type_mapper_unittest.cc | 7 +------ pc/channel_manager.h | 1 - pc/channel_unittest.cc | 3 +-- pc/peer_connection.cc | 2 +- pc/sdp_offer_answer.h | 3 +-- pc/session_description.h | 1 - pc/webrtc_sdp.cc | 15 ------------- pc/webrtc_sdp_unittest.cc | 1 - sdk/media_constraints.cc | 1 - sdk/media_constraints.h | 2 -- 16 files changed, 4 insertions(+), 104 deletions(-) diff --git a/media/base/codec.cc b/media/base/codec.cc index 6b0e4886fc..cb6913e76a 100644 --- a/media/base/codec.cc +++ b/media/base/codec.cc @@ -384,25 +384,6 @@ bool VideoCodec::ValidateCodecFormat() const { return true; } -RtpDataCodec::RtpDataCodec(int id, const std::string& name) - : Codec(id, name, kDataCodecClockrate) {} - -RtpDataCodec::RtpDataCodec() : Codec() { - clockrate = kDataCodecClockrate; -} - -RtpDataCodec::RtpDataCodec(const RtpDataCodec& c) = default; -RtpDataCodec::RtpDataCodec(RtpDataCodec&& c) = default; -RtpDataCodec& RtpDataCodec::operator=(const RtpDataCodec& c) = default; -RtpDataCodec& RtpDataCodec::operator=(RtpDataCodec&& c) = default; - -std::string RtpDataCodec::ToString() const { - char buf[256]; - rtc::SimpleStringBuilder sb(buf); - sb << "RtpDataCodec[" << id << ":" << name << "]"; - return sb.str(); -} - bool HasLntf(const Codec& codec) { return codec.HasFeedbackParam( FeedbackParam(kRtcpFbParamLntf, kParamValueEmpty)); diff --git a/media/base/codec.h b/media/base/codec.h index c3be2334ce..c7c99bf732 100644 --- a/media/base/codec.h +++ b/media/base/codec.h @@ -202,23 +202,6 @@ struct RTC_EXPORT VideoCodec : public Codec { void SetDefaultParameters(); }; -struct RtpDataCodec : public Codec { - RtpDataCodec(int id, const std::string& name); - RtpDataCodec(); - RtpDataCodec(const RtpDataCodec& c); - RtpDataCodec(RtpDataCodec&& c); - ~RtpDataCodec() override = default; - - RtpDataCodec& operator=(const RtpDataCodec& c); - RtpDataCodec& operator=(RtpDataCodec&& c); - - std::string ToString() const; -}; - -// For backwards compatibility -// TODO(bugs.webrtc.org/10597): Remove when no longer needed. -typedef RtpDataCodec DataCodec; - // Get the codec setting associated with |payload_type|. If there // is no codec associated with that payload type it returns nullptr. template diff --git a/media/base/codec_unittest.cc b/media/base/codec_unittest.cc index 3586760a14..3f246c66cc 100644 --- a/media/base/codec_unittest.cc +++ b/media/base/codec_unittest.cc @@ -19,7 +19,6 @@ using cricket::AudioCodec; using cricket::Codec; -using cricket::DataCodec; using cricket::FeedbackParam; using cricket::kCodecParamAssociatedPayloadType; using cricket::kCodecParamMaxBitrate; @@ -303,27 +302,6 @@ TEST(CodecTest, TestH264CodecMatches) { } } -TEST(CodecTest, TestDataCodecMatches) { - // Test a codec with a static payload type. - DataCodec c0(34, "D"); - EXPECT_TRUE(c0.Matches(DataCodec(34, ""))); - EXPECT_FALSE(c0.Matches(DataCodec(96, "D"))); - EXPECT_FALSE(c0.Matches(DataCodec(96, ""))); - - // Test a codec with a dynamic payload type. - DataCodec c1(96, "D"); - EXPECT_TRUE(c1.Matches(DataCodec(96, "D"))); - EXPECT_TRUE(c1.Matches(DataCodec(97, "D"))); - EXPECT_TRUE(c1.Matches(DataCodec(96, "d"))); - EXPECT_TRUE(c1.Matches(DataCodec(97, "d"))); - EXPECT_TRUE(c1.Matches(DataCodec(35, "d"))); - EXPECT_TRUE(c1.Matches(DataCodec(42, "d"))); - EXPECT_TRUE(c1.Matches(DataCodec(63, "d"))); - EXPECT_FALSE(c1.Matches(DataCodec(96, ""))); - EXPECT_FALSE(c1.Matches(DataCodec(95, "D"))); - EXPECT_FALSE(c1.Matches(DataCodec(34, "D"))); -} - TEST(CodecTest, TestSetParamGetParamAndRemoveParam) { AudioCodec codec; codec.SetParam("a", "1"); diff --git a/media/base/media_constants.cc b/media/base/media_constants.cc index 2ac382510b..17a8a83bd0 100644 --- a/media/base/media_constants.cc +++ b/media/base/media_constants.cc @@ -13,8 +13,6 @@ namespace cricket { const int kVideoCodecClockrate = 90000; -const int kDataCodecClockrate = 90000; -const int kRtpDataMaxBandwidth = 30720; // bps const int kVideoMtu = 1200; const int kVideoRtpSendBufferSize = 65536; @@ -97,9 +95,6 @@ const char kCodecParamMinBitrate[] = "x-google-min-bitrate"; const char kCodecParamStartBitrate[] = "x-google-start-bitrate"; const char kCodecParamMaxQuantization[] = "x-google-max-quantization"; -const int kGoogleRtpDataCodecPlType = 109; -const char kGoogleRtpDataCodecName[] = "google-data"; - const char kComfortNoiseCodecName[] = "CN"; const char kVp8CodecName[] = "VP8"; diff --git a/media/base/media_constants.h b/media/base/media_constants.h index 16b97caacb..bf7f0c3047 100644 --- a/media/base/media_constants.h +++ b/media/base/media_constants.h @@ -20,8 +20,6 @@ namespace cricket { extern const int kVideoCodecClockrate; -extern const int kDataCodecClockrate; -extern const int kRtpDataMaxBandwidth; // bps extern const int kVideoMtu; extern const int kVideoRtpSendBufferSize; @@ -119,12 +117,6 @@ extern const char kCodecParamMinBitrate[]; extern const char kCodecParamStartBitrate[]; extern const char kCodecParamMaxQuantization[]; -// We put the data codec names here so callers of DataEngine::CreateChannel -// don't have to import rtpdataengine.h to get the codec names they want to -// pass in. -extern const int kGoogleRtpDataCodecPlType; -extern const char kGoogleRtpDataCodecName[]; - extern const char kComfortNoiseCodecName[]; RTC_EXPORT extern const char kVp8CodecName[]; diff --git a/media/engine/payload_type_mapper.cc b/media/engine/payload_type_mapper.cc index 8c85f02fe8..4c46975997 100644 --- a/media/engine/payload_type_mapper.cc +++ b/media/engine/payload_type_mapper.cc @@ -61,7 +61,6 @@ PayloadTypeMapper::PayloadTypeMapper() // Payload type assignments currently used by WebRTC. // Includes data to reduce collisions (and thus reassignments) - {{kGoogleRtpDataCodecName, 0, 0}, kGoogleRtpDataCodecPlType}, {{kIlbcCodecName, 8000, 1}, 102}, {{kIsacCodecName, 16000, 1}, 103}, {{kIsacCodecName, 32000, 1}, 104}, diff --git a/media/engine/payload_type_mapper_unittest.cc b/media/engine/payload_type_mapper_unittest.cc index fa6864b48a..9361f76116 100644 --- a/media/engine/payload_type_mapper_unittest.cc +++ b/media/engine/payload_type_mapper_unittest.cc @@ -46,13 +46,8 @@ TEST_F(PayloadTypeMapperTest, StaticPayloadTypes) { } TEST_F(PayloadTypeMapperTest, WebRTCPayloadTypes) { - // Tests that the payload mapper knows about the audio and data formats we've + // Tests that the payload mapper knows about the audio formats we've // been using in WebRTC, with their hard coded values. - auto data_mapping = [this](const char* name) { - return mapper_.FindMappingFor({name, 0, 0}); - }; - EXPECT_EQ(kGoogleRtpDataCodecPlType, data_mapping(kGoogleRtpDataCodecName)); - EXPECT_EQ(102, mapper_.FindMappingFor({kIlbcCodecName, 8000, 1})); EXPECT_EQ(103, mapper_.FindMappingFor({kIsacCodecName, 16000, 1})); EXPECT_EQ(104, mapper_.FindMappingFor({kIsacCodecName, 32000, 1})); diff --git a/pc/channel_manager.h b/pc/channel_manager.h index 69ccf6a585..43fa27935f 100644 --- a/pc/channel_manager.h +++ b/pc/channel_manager.h @@ -67,7 +67,6 @@ class ChannelManager final { void GetSupportedAudioReceiveCodecs(std::vector* codecs) const; void GetSupportedVideoSendCodecs(std::vector* codecs) const; void GetSupportedVideoReceiveCodecs(std::vector* codecs) const; - void GetSupportedDataCodecs(std::vector* codecs) const; RtpHeaderExtensions GetDefaultEnabledAudioRtpHeaderExtensions() const; std::vector GetSupportedAudioRtpHeaderExtensions() const; diff --git a/pc/channel_unittest.cc b/pc/channel_unittest.cc index 4322219c8d..35413edf8f 100644 --- a/pc/channel_unittest.cc +++ b/pc/channel_unittest.cc @@ -52,7 +52,6 @@ const cricket::AudioCodec kPcmaCodec(8, "PCMA", 64000, 8000, 1); const cricket::AudioCodec kIsacCodec(103, "ISAC", 40000, 16000, 1); const cricket::VideoCodec kH264Codec(97, "H264"); const cricket::VideoCodec kH264SvcCodec(99, "H264-SVC"); -const cricket::DataCodec kGoogleDataCodec(101, "google-data"); const uint32_t kSsrc1 = 0x1111; const uint32_t kSsrc2 = 0x2222; const uint32_t kSsrc3 = 0x3333; @@ -93,7 +92,7 @@ class VideoTraits : public Traits {}; -// Base class for Voice/Video/RtpDataChannel tests +// Base class for Voice/Video tests template class ChannelTest : public ::testing::Test, public sigslot::has_slots<> { public: diff --git a/pc/peer_connection.cc b/pc/peer_connection.cc index 95abb108b9..9793336d7e 100644 --- a/pc/peer_connection.cc +++ b/pc/peer_connection.cc @@ -1295,7 +1295,7 @@ rtc::scoped_refptr PeerConnection::CreateDataChannel( return nullptr; } - // Trigger the onRenegotiationNeeded event for every new RTP DataChannel, or + // Trigger the onRenegotiationNeeded event for // the first SCTP DataChannel. if (first_datachannel) { sdp_handler_->UpdateNegotiationNeeded(); diff --git a/pc/sdp_offer_answer.h b/pc/sdp_offer_answer.h index 0608c38ce5..a913a9bad8 100644 --- a/pc/sdp_offer_answer.h +++ b/pc/sdp_offer_answer.h @@ -452,8 +452,7 @@ class SdpOfferAnswerHandler : public SdpStateProvider, StreamCollection* new_streams); // Enables media channels to allow sending of media. - // This enables media to flow on all configured audio/video channels and the - // RtpDataChannel. + // This enables media to flow on all configured audio/video channels. void EnableSending(); // Push the media parts of the local or remote session description // down to all of the channels. diff --git a/pc/session_description.h b/pc/session_description.h index 0d462eb2b2..fe0fdefd15 100644 --- a/pc/session_description.h +++ b/pc/session_description.h @@ -44,7 +44,6 @@ namespace cricket { typedef std::vector AudioCodecs; typedef std::vector VideoCodecs; -typedef std::vector RtpDataCodecs; typedef std::vector CryptoParamsVec; typedef std::vector RtpHeaderExtensions; diff --git a/pc/webrtc_sdp.cc b/pc/webrtc_sdp.cc index 58dcc4f606..282c7f705d 100644 --- a/pc/webrtc_sdp.cc +++ b/pc/webrtc_sdp.cc @@ -3049,21 +3049,6 @@ bool ParseContent(const std::string& message, return ParseFailed( line, "b=" + bandwidth_type + " value can't be negative.", error); } - // We should never use more than the default bandwidth for RTP-based - // data channels. Don't allow SDP to set the bandwidth, because - // that would give JS the opportunity to "break the Internet". - // See: https://code.google.com/p/chromium/issues/detail?id=280726 - // Disallow TIAS since it shouldn't be generated for RTP data channels in - // the first place and provides another way to get around the limitation. - if (media_type == cricket::MEDIA_TYPE_DATA && - cricket::IsRtpProtocol(protocol) && - (b > cricket::kRtpDataMaxBandwidth / 1000 || - bandwidth_type == kTransportSpecificBandwidth)) { - rtc::StringBuilder description; - description << "RTP-based data channels may not send more than " - << cricket::kRtpDataMaxBandwidth / 1000 << "kbps."; - return ParseFailed(line, description.str(), error); - } // Convert values. Prevent integer overflow. if (bandwidth_type == kApplicationSpecificBandwidth) { b = std::min(b, INT_MAX / 1000) * 1000; diff --git a/pc/webrtc_sdp_unittest.cc b/pc/webrtc_sdp_unittest.cc index a4f75e262b..7c435f64df 100644 --- a/pc/webrtc_sdp_unittest.cc +++ b/pc/webrtc_sdp_unittest.cc @@ -56,7 +56,6 @@ using cricket::Candidate; using cricket::ContentGroup; using cricket::ContentInfo; using cricket::CryptoParams; -using cricket::DataCodec; using cricket::ICE_CANDIDATE_COMPONENT_RTCP; using cricket::ICE_CANDIDATE_COMPONENT_RTP; using cricket::kFecSsrcGroupSemantics; diff --git a/sdk/media_constraints.cc b/sdk/media_constraints.cc index f4d72bdf36..6f4901c97e 100644 --- a/sdk/media_constraints.cc +++ b/sdk/media_constraints.cc @@ -118,7 +118,6 @@ const char MediaConstraints::kUseRtpMux[] = "googUseRtpMUX"; // Below constraints should be used during PeerConnection construction. const char MediaConstraints::kEnableDtlsSrtp[] = "DtlsSrtpKeyAgreement"; -const char MediaConstraints::kEnableRtpDataChannels[] = "RtpDataChannels"; // Google-specific constraint keys. const char MediaConstraints::kEnableDscp[] = "googDscp"; const char MediaConstraints::kEnableIPv6[] = "googIPv6"; diff --git a/sdk/media_constraints.h b/sdk/media_constraints.h index b85dc472e0..15cb363f7c 100644 --- a/sdk/media_constraints.h +++ b/sdk/media_constraints.h @@ -85,8 +85,6 @@ class MediaConstraints { // PeerConnection constraint keys. // Temporary pseudo-constraints used to enable DTLS-SRTP static const char kEnableDtlsSrtp[]; // Enable DTLS-SRTP - // Temporary pseudo-constraints used to enable DataChannels - static const char kEnableRtpDataChannels[]; // Enable RTP DataChannels // Google-specific constraint keys. // Temporary pseudo-constraint for enabling DSCP through JS. static const char kEnableDscp[]; // googDscp