Remove unused properties from MediaContentDescription

Bug: webrtc:8620
Change-Id: I0597495a93aa7507177cf7bcbb8c6d35ee90ae0d
Reviewed-on: https://webrtc-review.googlesource.com/30500
Commit-Queue: Steve Anton <steveanton@webrtc.org>
Reviewed-by: Peter Thatcher <pthatcher@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#21150}
This commit is contained in:
Steve Anton
2017-12-07 14:30:25 -08:00
committed by Commit Bot
parent cedd351e73
commit 5634427c09
4 changed files with 1 additions and 80 deletions

View File

@ -63,8 +63,6 @@ enum {
MSG_FIRSTPACKETRECEIVED,
};
static const int kAgcMinus10db = -10;
static void SafeSetError(const std::string& message, std::string* error_desc) {
if (error_desc) {
*error_desc = message;
@ -1491,9 +1489,6 @@ bool VoiceChannel::SetRemoteContent_w(const MediaContentDescription* content,
AudioSendParameters send_params = last_send_params_;
RtpSendParametersFromMediaDescription(audio, rtp_header_extensions,
&send_params);
if (audio->agc_minus_10db()) {
send_params.options.adjust_agc_delta = kAgcMinus10db;
}
bool parameters_applied = media_channel()->SetSendParameters(send_params);
if (!parameters_applied) {

View File

@ -469,7 +469,6 @@ static bool AddStreamParams(
for (size_t i = 0; i < ssrcs.size(); ++i) {
stream_param.AddFidSsrc(ssrcs[i], rtx_ssrcs[i]);
}
content_description->set_multistream(true);
}
// Generate extra ssrc for include_flexfec_stream case.
if (include_flexfec_stream) {
@ -478,7 +477,6 @@ static bool AddStreamParams(
std::vector<uint32_t> flexfec_ssrcs;
GenerateSsrcs(*current_streams, 1, &flexfec_ssrcs);
stream_param.AddFecFrSsrc(ssrcs[0], flexfec_ssrcs[0]);
content_description->set_multistream(true);
} else if (!ssrcs.empty()) {
RTC_LOG(LS_WARNING)
<< "Our FlexFEC implementation only supports protecting "
@ -736,7 +734,6 @@ static bool CreateMediaContentOffer(
if (offer->type() == cricket::MEDIA_TYPE_VIDEO) {
offer->set_rtcp_reduced_size(true);
}
offer->set_multistream(session_options.is_muc);
offer->set_rtp_header_extensions(rtp_extensions);
if (!AddStreamParams(sender_options, session_options.rtcp_cname,
@ -1867,7 +1864,6 @@ bool MediaSessionDescriptionFactory::AddAudioContentForOffer(
crypto_suites, audio_rtp_extensions, current_streams, audio.get())) {
return false;
}
audio->set_lang(lang_);
bool secure_transport = (transport_desc_factory_->secure() != SEC_DISABLED);
SetMediaProtocol(secure_transport, audio.get());

View File

@ -124,7 +124,6 @@ struct MediaSessionOptions {
bool HasMediaDescription(MediaType type) const;
DataChannelType data_channel_type = DCT_NONE;
bool is_muc = false;
bool vad_enabled = true; // When disabled, removes all CN codecs from SDP.
bool rtcp_mux_enabled = true;
bool bundle_enabled = false;
@ -174,11 +173,6 @@ class MediaContentDescription : public ContentDescription {
cryptos_ = cryptos;
}
CryptoType crypto_required() const { return crypto_required_; }
void set_crypto_required(CryptoType type) {
crypto_required_ = type;
}
const RtpHeaderExtensions& rtp_header_extensions() const {
return rtp_header_extensions_;
}
@ -209,9 +203,6 @@ class MediaContentDescription : public ContentDescription {
bool rtp_header_extensions_set() const {
return rtp_header_extensions_set_;
}
// True iff the client supports multiple streams.
void set_multistream(bool multistream) { multistream_ = multistream; }
bool multistream() const { return multistream_; }
const StreamParamsVec& streams() const {
return streams_;
}
@ -256,9 +247,6 @@ class MediaContentDescription : public ContentDescription {
void set_conference_mode(bool enable) { conference_mode_ = enable; }
bool conference_mode() const { return conference_mode_; }
void set_partial(bool partial) { partial_ = partial; }
bool partial() const { return partial_; }
// https://tools.ietf.org/html/rfc4566#section-5.7
// May be present at the media or session level of SDP. If present at both
// levels, the media-level attribute overwrites the session-level one.
@ -275,13 +263,10 @@ class MediaContentDescription : public ContentDescription {
int bandwidth_ = kAutoBandwidth;
std::string protocol_;
std::vector<CryptoParams> cryptos_;
CryptoType crypto_required_ = CT_NONE;
std::vector<webrtc::RtpExtension> rtp_header_extensions_;
bool rtp_header_extensions_set_ = false;
bool multistream_ = false;
StreamParamsVec streams_;
bool conference_mode_ = false;
bool partial_ = false;
webrtc::RtpTransceiverDirection direction_ =
webrtc::RtpTransceiverDirection::kSendRecv;
rtc::SocketAddress connection_address_;
@ -333,27 +318,12 @@ class MediaContentDescriptionImpl : public MediaContentDescription {
class AudioContentDescription : public MediaContentDescriptionImpl<AudioCodec> {
public:
AudioContentDescription() :
agc_minus_10db_(false) {}
AudioContentDescription() {}
virtual ContentDescription* Copy() const {
return new AudioContentDescription(*this);
}
virtual MediaType type() const { return MEDIA_TYPE_AUDIO; }
const std::string &lang() const { return lang_; }
void set_lang(const std::string &lang) { lang_ = lang; }
bool agc_minus_10db() const { return agc_minus_10db_; }
void set_agc_minus_10db(bool enable) {
agc_minus_10db_ = enable;
}
private:
bool agc_minus_10db_;
private:
std::string lang_;
};
class VideoContentDescription : public MediaContentDescriptionImpl<VideoCodec> {
@ -553,7 +523,6 @@ class MediaSessionDescriptionFactory {
// TODO(zhihuang): Rename secure_ to sdec_policy_; rename the related getter
// and setter.
SecurePolicy secure_ = SEC_DISABLED;
std::string lang_;
const TransportDescriptionFactory* transport_desc_factory_;
};

View File

@ -1469,42 +1469,6 @@ TEST_F(MediaSessionDescriptionFactoryTest,
EXPECT_FALSE(dcd->has_ssrcs()); // No StreamParams.
}
TEST_F(MediaSessionDescriptionFactoryTest, TestPartial) {
MediaSessionOptions opts;
AddAudioVideoSections(RtpTransceiverDirection::kRecvOnly, &opts);
AddDataSection(cricket::DCT_RTP, RtpTransceiverDirection::kRecvOnly, &opts);
f1_.set_secure(SEC_ENABLED);
std::unique_ptr<SessionDescription> offer(f1_.CreateOffer(opts, NULL));
ASSERT_TRUE(offer.get() != NULL);
const ContentInfo* ac = offer->GetContentByName("audio");
const ContentInfo* vc = offer->GetContentByName("video");
const ContentInfo* dc = offer->GetContentByName("data");
AudioContentDescription* acd = const_cast<AudioContentDescription*>(
static_cast<const AudioContentDescription*>(ac->description));
VideoContentDescription* vcd = const_cast<VideoContentDescription*>(
static_cast<const VideoContentDescription*>(vc->description));
DataContentDescription* dcd = const_cast<DataContentDescription*>(
static_cast<const DataContentDescription*>(dc->description));
EXPECT_FALSE(acd->partial()); // default is false.
acd->set_partial(true);
EXPECT_TRUE(acd->partial());
acd->set_partial(false);
EXPECT_FALSE(acd->partial());
EXPECT_FALSE(vcd->partial()); // default is false.
vcd->set_partial(true);
EXPECT_TRUE(vcd->partial());
vcd->set_partial(false);
EXPECT_FALSE(vcd->partial());
EXPECT_FALSE(dcd->partial()); // default is false.
dcd->set_partial(true);
EXPECT_TRUE(dcd->partial());
dcd->set_partial(false);
EXPECT_FALSE(dcd->partial());
}
// Create a typical video answer, and ensure it matches what we expect.
TEST_F(MediaSessionDescriptionFactoryTest, TestCreateVideoAnswerRtcpMux) {
MediaSessionOptions offer_opts;
@ -2412,7 +2376,6 @@ TEST_F(MediaSessionDescriptionFactoryTest, SimSsrcsGenerateMultipleRtxSsrcs) {
VideoContentDescription* desc = static_cast<VideoContentDescription*>(
offer->GetContentDescriptionByName(cricket::CN_VIDEO));
ASSERT_TRUE(desc != NULL);
EXPECT_TRUE(desc->multistream());
const StreamParamsVec& streams = desc->streams();
// Single stream.
ASSERT_EQ(1u, streams.size());
@ -2453,7 +2416,6 @@ TEST_F(MediaSessionDescriptionFactoryTest, GenerateFlexfecSsrc) {
VideoContentDescription* desc = static_cast<VideoContentDescription*>(
offer->GetContentDescriptionByName(cricket::CN_VIDEO));
ASSERT_TRUE(desc != nullptr);
EXPECT_TRUE(desc->multistream());
const StreamParamsVec& streams = desc->streams();
// Single stream.
ASSERT_EQ(1u, streams.size());
@ -2493,7 +2455,6 @@ TEST_F(MediaSessionDescriptionFactoryTest, SimSsrcsGenerateNoFlexfecSsrcs) {
VideoContentDescription* desc = static_cast<VideoContentDescription*>(
offer->GetContentDescriptionByName(cricket::CN_VIDEO));
ASSERT_TRUE(desc != nullptr);
EXPECT_FALSE(desc->multistream());
const StreamParamsVec& streams = desc->streams();
// Single stream.
ASSERT_EQ(1u, streams.size());