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 <orphis@webrtc.org>
Commit-Queue: Harald Alvestrand <hta@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#33799}
This commit is contained in:
Harald Alvestrand 2021-04-20 15:06:03 +00:00 committed by Commit Bot
parent 762f21ce8d
commit 48171ec264
16 changed files with 4 additions and 104 deletions

View file

@ -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));

View file

@ -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 <class Codec>

View file

@ -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");

View file

@ -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";

View file

@ -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[];

View file

@ -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},

View file

@ -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}));

View file

@ -67,7 +67,6 @@ class ChannelManager final {
void GetSupportedAudioReceiveCodecs(std::vector<AudioCodec>* codecs) const;
void GetSupportedVideoSendCodecs(std::vector<VideoCodec>* codecs) const;
void GetSupportedVideoReceiveCodecs(std::vector<VideoCodec>* codecs) const;
void GetSupportedDataCodecs(std::vector<DataCodec>* codecs) const;
RtpHeaderExtensions GetDefaultEnabledAudioRtpHeaderExtensions() const;
std::vector<webrtc::RtpHeaderExtensionCapability>
GetSupportedAudioRtpHeaderExtensions() const;

View file

@ -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<cricket::VideoChannel,
cricket::VideoMediaInfo,
cricket::VideoOptions> {};
// Base class for Voice/Video/RtpDataChannel tests
// Base class for Voice/Video tests
template <class T>
class ChannelTest : public ::testing::Test, public sigslot::has_slots<> {
public:

View file

@ -1295,7 +1295,7 @@ rtc::scoped_refptr<DataChannelInterface> 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();

View file

@ -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.

View file

@ -44,7 +44,6 @@ namespace cricket {
typedef std::vector<AudioCodec> AudioCodecs;
typedef std::vector<VideoCodec> VideoCodecs;
typedef std::vector<RtpDataCodec> RtpDataCodecs;
typedef std::vector<CryptoParams> CryptoParamsVec;
typedef std::vector<webrtc::RtpExtension> RtpHeaderExtensions;

View file

@ -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;

View file

@ -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;

View file

@ -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";

View file

@ -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