Rename FecConfig to UlpfecConfig in config.h.
Also rename some related minor methods. No functional changes are intended/expected. BUG=webrtc:5654 Review-Url: https://codereview.webrtc.org/2391963002 Cr-Commit-Position: refs/heads/master@{#14513}
This commit is contained in:
parent
f122a85287
commit
b5f2c3fbe9
@ -233,10 +233,11 @@ void CallPerfTest::TestAudioVideoSync(FecMode fec,
|
||||
|
||||
video_send_config_.rtp.nack.rtp_history_ms = kNackRtpHistoryMs;
|
||||
if (fec == FecMode::kOn) {
|
||||
video_send_config_.rtp.fec.red_payload_type = kRedPayloadType;
|
||||
video_send_config_.rtp.fec.ulpfec_payload_type = kUlpfecPayloadType;
|
||||
video_receive_configs_[0].rtp.fec.red_payload_type = kRedPayloadType;
|
||||
video_receive_configs_[0].rtp.fec.ulpfec_payload_type = kUlpfecPayloadType;
|
||||
video_send_config_.rtp.ulpfec.red_payload_type = kRedPayloadType;
|
||||
video_send_config_.rtp.ulpfec.ulpfec_payload_type = kUlpfecPayloadType;
|
||||
video_receive_configs_[0].rtp.ulpfec.red_payload_type = kRedPayloadType;
|
||||
video_receive_configs_[0].rtp.ulpfec.ulpfec_payload_type =
|
||||
kUlpfecPayloadType;
|
||||
}
|
||||
video_receive_configs_[0].rtp.nack.rtp_history_ms = 1000;
|
||||
video_receive_configs_[0].renderer = &observer;
|
||||
|
||||
@ -169,9 +169,9 @@ void RampUpTester::ModifyVideoConfigs(
|
||||
send_config->rtp.rtx.ssrcs = video_rtx_ssrcs_;
|
||||
}
|
||||
if (red_) {
|
||||
send_config->rtp.fec.ulpfec_payload_type =
|
||||
send_config->rtp.ulpfec.ulpfec_payload_type =
|
||||
test::CallTest::kUlpfecPayloadType;
|
||||
send_config->rtp.fec.red_payload_type = test::CallTest::kRedPayloadType;
|
||||
send_config->rtp.ulpfec.red_payload_type = test::CallTest::kRedPayloadType;
|
||||
}
|
||||
|
||||
size_t i = 0;
|
||||
@ -184,10 +184,10 @@ void RampUpTester::ModifyVideoConfigs(
|
||||
recv_config.rtp.nack.rtp_history_ms = send_config->rtp.nack.rtp_history_ms;
|
||||
|
||||
if (red_) {
|
||||
recv_config.rtp.fec.red_payload_type =
|
||||
send_config->rtp.fec.red_payload_type;
|
||||
recv_config.rtp.fec.ulpfec_payload_type =
|
||||
send_config->rtp.fec.ulpfec_payload_type;
|
||||
recv_config.rtp.ulpfec.red_payload_type =
|
||||
send_config->rtp.ulpfec.red_payload_type;
|
||||
recv_config.rtp.ulpfec.ulpfec_payload_type =
|
||||
send_config->rtp.ulpfec.ulpfec_payload_type;
|
||||
}
|
||||
|
||||
if (rtx_) {
|
||||
|
||||
@ -22,7 +22,7 @@ std::string NackConfig::ToString() const {
|
||||
return ss.str();
|
||||
}
|
||||
|
||||
std::string FecConfig::ToString() const {
|
||||
std::string UlpfecConfig::ToString() const {
|
||||
std::stringstream ss;
|
||||
ss << "{ulpfec_payload_type: " << ulpfec_payload_type;
|
||||
ss << ", red_payload_type: " << red_payload_type;
|
||||
|
||||
@ -35,10 +35,10 @@ struct NackConfig {
|
||||
int rtp_history_ms;
|
||||
};
|
||||
|
||||
// Settings for forward error correction, see RFC 5109 for details. Set the
|
||||
// payload types to '-1' to disable.
|
||||
struct FecConfig {
|
||||
FecConfig()
|
||||
// Settings for ULPFEC forward error correction.
|
||||
// Set the payload types to '-1' to disable.
|
||||
struct UlpfecConfig {
|
||||
UlpfecConfig()
|
||||
: ulpfec_payload_type(-1),
|
||||
red_payload_type(-1),
|
||||
red_rtx_payload_type(-1) {}
|
||||
|
||||
@ -897,13 +897,13 @@ bool WebRtcVideoChannel2::SetSendParameters(const VideoSendParameters& params) {
|
||||
if (changed_params.codec) {
|
||||
bool red_was_disabled = red_disabled_by_remote_side_;
|
||||
red_disabled_by_remote_side_ =
|
||||
changed_params.codec->fec.red_payload_type == -1;
|
||||
changed_params.codec->ulpfec.red_payload_type == -1;
|
||||
if (red_was_disabled != red_disabled_by_remote_side_) {
|
||||
for (auto& kv : receive_streams_) {
|
||||
// In practice VideoChannel::SetRemoteContent appears to most of the
|
||||
// time also call UpdateRemoteStreams, which recreates the receive
|
||||
// streams. If that's always true this call isn't needed.
|
||||
kv.second->SetFecDisabledRemotely(red_disabled_by_remote_side_);
|
||||
kv.second->SetUlpfecDisabledRemotely(red_disabled_by_remote_side_);
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -1475,8 +1475,8 @@ void WebRtcVideoChannel2::OnPacketReceived(
|
||||
// for these.
|
||||
for (auto& codec : recv_codecs_) {
|
||||
if (payload_type == codec.rtx_payload_type ||
|
||||
payload_type == codec.fec.red_rtx_payload_type ||
|
||||
payload_type == codec.fec.ulpfec_payload_type) {
|
||||
payload_type == codec.ulpfec.red_rtx_payload_type ||
|
||||
payload_type == codec.ulpfec.ulpfec_payload_type) {
|
||||
return;
|
||||
}
|
||||
}
|
||||
@ -1846,7 +1846,7 @@ void WebRtcVideoChannel2::WebRtcVideoSendStream::SetCodec(
|
||||
parameters_.config.encoder_settings.internal_source =
|
||||
external_encoder_factory_->EncoderTypeHasInternalSource(type);
|
||||
}
|
||||
parameters_.config.rtp.fec = codec_settings.fec;
|
||||
parameters_.config.rtp.ulpfec = codec_settings.ulpfec;
|
||||
|
||||
// Set RTX payload type if RTX is enabled.
|
||||
if (!parameters_.config.rtp.rtx.ssrcs.empty()) {
|
||||
@ -2394,7 +2394,7 @@ void WebRtcVideoChannel2::WebRtcVideoReceiveStream::ConfigureCodecs(
|
||||
}
|
||||
|
||||
// TODO(pbos): Reconfigure RTX based on incoming recv_codecs.
|
||||
config_.rtp.fec = recv_codecs.front().fec;
|
||||
config_.rtp.ulpfec = recv_codecs.front().ulpfec;
|
||||
config_.rtp.nack.rtp_history_ms =
|
||||
HasNack(recv_codecs.begin()->codec) ? kNackHistoryMs : 0;
|
||||
}
|
||||
@ -2471,9 +2471,9 @@ void WebRtcVideoChannel2::WebRtcVideoReceiveStream::RecreateWebRtcStream() {
|
||||
}
|
||||
webrtc::VideoReceiveStream::Config config = config_.Copy();
|
||||
if (red_disabled_by_remote_side_) {
|
||||
config.rtp.fec.red_payload_type = -1;
|
||||
config.rtp.fec.ulpfec_payload_type = -1;
|
||||
config.rtp.fec.red_rtx_payload_type = -1;
|
||||
config.rtp.ulpfec.red_payload_type = -1;
|
||||
config.rtp.ulpfec.ulpfec_payload_type = -1;
|
||||
config.rtp.ulpfec.red_rtx_payload_type = -1;
|
||||
}
|
||||
stream_ = call_->CreateVideoReceiveStream(std::move(config));
|
||||
stream_->Start();
|
||||
@ -2584,7 +2584,7 @@ WebRtcVideoChannel2::WebRtcVideoReceiveStream::GetVideoReceiverInfo(
|
||||
return info;
|
||||
}
|
||||
|
||||
void WebRtcVideoChannel2::WebRtcVideoReceiveStream::SetFecDisabledRemotely(
|
||||
void WebRtcVideoChannel2::WebRtcVideoReceiveStream::SetUlpfecDisabledRemotely(
|
||||
bool disable) {
|
||||
red_disabled_by_remote_side_ = disable;
|
||||
RecreateWebRtcStream();
|
||||
@ -2596,9 +2596,9 @@ WebRtcVideoChannel2::VideoCodecSettings::VideoCodecSettings()
|
||||
bool WebRtcVideoChannel2::VideoCodecSettings::operator==(
|
||||
const WebRtcVideoChannel2::VideoCodecSettings& other) const {
|
||||
return codec == other.codec &&
|
||||
fec.ulpfec_payload_type == other.fec.ulpfec_payload_type &&
|
||||
fec.red_payload_type == other.fec.red_payload_type &&
|
||||
fec.red_rtx_payload_type == other.fec.red_rtx_payload_type &&
|
||||
ulpfec.ulpfec_payload_type == other.ulpfec.ulpfec_payload_type &&
|
||||
ulpfec.red_payload_type == other.ulpfec.red_payload_type &&
|
||||
ulpfec.red_rtx_payload_type == other.ulpfec.red_rtx_payload_type &&
|
||||
rtx_payload_type == other.rtx_payload_type;
|
||||
}
|
||||
|
||||
@ -2617,7 +2617,7 @@ WebRtcVideoChannel2::MapCodecs(const std::vector<VideoCodec>& codecs) {
|
||||
// |rtx_mapping| maps video payload type to rtx payload type.
|
||||
std::map<int, int> rtx_mapping;
|
||||
|
||||
webrtc::FecConfig fec_settings;
|
||||
webrtc::UlpfecConfig ulpfec_config;
|
||||
|
||||
for (size_t i = 0; i < codecs.size(); ++i) {
|
||||
const VideoCodec& in_codec = codecs[i];
|
||||
@ -2634,15 +2634,15 @@ WebRtcVideoChannel2::MapCodecs(const std::vector<VideoCodec>& codecs) {
|
||||
switch (in_codec.GetCodecType()) {
|
||||
case VideoCodec::CODEC_RED: {
|
||||
// RED payload type, should not have duplicates.
|
||||
RTC_DCHECK(fec_settings.red_payload_type == -1);
|
||||
fec_settings.red_payload_type = in_codec.id;
|
||||
RTC_DCHECK(ulpfec_config.red_payload_type == -1);
|
||||
ulpfec_config.red_payload_type = in_codec.id;
|
||||
continue;
|
||||
}
|
||||
|
||||
case VideoCodec::CODEC_ULPFEC: {
|
||||
// ULPFEC payload type, should not have duplicates.
|
||||
RTC_DCHECK(fec_settings.ulpfec_payload_type == -1);
|
||||
fec_settings.ulpfec_payload_type = in_codec.id;
|
||||
RTC_DCHECK(ulpfec_config.ulpfec_payload_type == -1);
|
||||
ulpfec_config.ulpfec_payload_type = in_codec.id;
|
||||
continue;
|
||||
}
|
||||
|
||||
@ -2685,16 +2685,16 @@ WebRtcVideoChannel2::MapCodecs(const std::vector<VideoCodec>& codecs) {
|
||||
return std::vector<VideoCodecSettings>();
|
||||
}
|
||||
|
||||
if (it->first == fec_settings.red_payload_type) {
|
||||
fec_settings.red_rtx_payload_type = it->second;
|
||||
if (it->first == ulpfec_config.red_payload_type) {
|
||||
ulpfec_config.red_rtx_payload_type = it->second;
|
||||
}
|
||||
}
|
||||
|
||||
for (size_t i = 0; i < video_codecs.size(); ++i) {
|
||||
video_codecs[i].fec = fec_settings;
|
||||
video_codecs[i].ulpfec = ulpfec_config;
|
||||
if (rtx_mapping[video_codecs[i].codec.id] != 0 &&
|
||||
rtx_mapping[video_codecs[i].codec.id] !=
|
||||
fec_settings.red_payload_type) {
|
||||
ulpfec_config.red_payload_type) {
|
||||
video_codecs[i].rtx_payload_type = rtx_mapping[video_codecs[i].codec.id];
|
||||
}
|
||||
}
|
||||
|
||||
@ -199,7 +199,7 @@ class WebRtcVideoChannel2 : public VideoMediaChannel, public webrtc::Transport {
|
||||
bool operator!=(const VideoCodecSettings& other) const;
|
||||
|
||||
VideoCodec codec;
|
||||
webrtc::FecConfig fec;
|
||||
webrtc::UlpfecConfig ulpfec;
|
||||
int rtx_payload_type;
|
||||
};
|
||||
|
||||
@ -438,7 +438,7 @@ class WebRtcVideoChannel2 : public VideoMediaChannel, public webrtc::Transport {
|
||||
// configured to receive RED.
|
||||
// TODO(holmer): Remove this after a couple of Chrome versions, M53-54
|
||||
// time frame.
|
||||
void SetFecDisabledRemotely(bool disable);
|
||||
void SetUlpfecDisabledRemotely(bool disable);
|
||||
|
||||
private:
|
||||
struct AllocatedDecoder {
|
||||
|
||||
@ -82,10 +82,10 @@ void VerifySendStreamHasRtxTypes(const webrtc::VideoSendStream::Config& config,
|
||||
EXPECT_TRUE(it != rtx_types.end() &&
|
||||
it->second == config.rtp.rtx.payload_type);
|
||||
|
||||
if (config.rtp.fec.red_rtx_payload_type != -1) {
|
||||
it = rtx_types.find(config.rtp.fec.red_payload_type);
|
||||
if (config.rtp.ulpfec.red_rtx_payload_type != -1) {
|
||||
it = rtx_types.find(config.rtp.ulpfec.red_payload_type);
|
||||
EXPECT_TRUE(it != rtx_types.end() &&
|
||||
it->second == config.rtp.fec.red_rtx_payload_type);
|
||||
it->second == config.rtp.ulpfec.red_rtx_payload_type);
|
||||
}
|
||||
}
|
||||
} // namespace
|
||||
@ -2245,8 +2245,8 @@ TEST_F(WebRtcVideoChannel2Test, SetDefaultSendCodecs) {
|
||||
|
||||
// Make sure NACK and FEC are enabled on the correct payload types.
|
||||
EXPECT_EQ(1000, config.rtp.nack.rtp_history_ms);
|
||||
EXPECT_EQ(default_ulpfec_codec_.id, config.rtp.fec.ulpfec_payload_type);
|
||||
EXPECT_EQ(default_red_codec_.id, config.rtp.fec.red_payload_type);
|
||||
EXPECT_EQ(default_ulpfec_codec_.id, config.rtp.ulpfec.ulpfec_payload_type);
|
||||
EXPECT_EQ(default_red_codec_.id, config.rtp.ulpfec.red_payload_type);
|
||||
|
||||
EXPECT_EQ(1u, config.rtp.rtx.ssrcs.size());
|
||||
EXPECT_EQ(kRtxSsrcs1[0], config.rtp.rtx.ssrcs[0]);
|
||||
@ -2262,8 +2262,8 @@ TEST_F(WebRtcVideoChannel2Test, SetSendCodecsWithoutFec) {
|
||||
FakeVideoSendStream* stream = AddSendStream();
|
||||
webrtc::VideoSendStream::Config config = stream->GetConfig().Copy();
|
||||
|
||||
EXPECT_EQ(-1, config.rtp.fec.ulpfec_payload_type);
|
||||
EXPECT_EQ(-1, config.rtp.fec.red_payload_type);
|
||||
EXPECT_EQ(-1, config.rtp.ulpfec.ulpfec_payload_type);
|
||||
EXPECT_EQ(-1, config.rtp.ulpfec.red_payload_type);
|
||||
}
|
||||
|
||||
TEST_F(WebRtcVideoChannel2Test,
|
||||
@ -2301,14 +2301,14 @@ TEST_F(WebRtcVideoChannel2Test, SetSendCodecsWithoutFecDisablesFec) {
|
||||
FakeVideoSendStream* stream = AddSendStream();
|
||||
webrtc::VideoSendStream::Config config = stream->GetConfig().Copy();
|
||||
|
||||
EXPECT_EQ(kUlpfecCodec.id, config.rtp.fec.ulpfec_payload_type);
|
||||
EXPECT_EQ(kUlpfecCodec.id, config.rtp.ulpfec.ulpfec_payload_type);
|
||||
|
||||
parameters.codecs.pop_back();
|
||||
ASSERT_TRUE(channel_->SetSendParameters(parameters));
|
||||
stream = fake_call_->GetVideoSendStreams()[0];
|
||||
ASSERT_TRUE(stream != NULL);
|
||||
config = stream->GetConfig().Copy();
|
||||
EXPECT_EQ(-1, config.rtp.fec.ulpfec_payload_type)
|
||||
EXPECT_EQ(-1, config.rtp.ulpfec.ulpfec_payload_type)
|
||||
<< "SetSendCodec without FEC should disable current FEC.";
|
||||
}
|
||||
|
||||
@ -2657,20 +2657,22 @@ TEST_F(WebRtcVideoChannel2Test, SetRecvCodecsWithoutFecDisablesFec) {
|
||||
|
||||
FakeVideoReceiveStream* stream = AddRecvStream();
|
||||
|
||||
EXPECT_EQ(kUlpfecCodec.id, stream->GetConfig().rtp.fec.ulpfec_payload_type);
|
||||
EXPECT_EQ(kUlpfecCodec.id,
|
||||
stream->GetConfig().rtp.ulpfec.ulpfec_payload_type);
|
||||
|
||||
cricket::VideoRecvParameters recv_parameters;
|
||||
recv_parameters.codecs.push_back(kVp8Codec);
|
||||
ASSERT_TRUE(channel_->SetRecvParameters(recv_parameters));
|
||||
stream = fake_call_->GetVideoReceiveStreams()[0];
|
||||
ASSERT_TRUE(stream != NULL);
|
||||
EXPECT_EQ(-1, stream->GetConfig().rtp.fec.ulpfec_payload_type)
|
||||
EXPECT_EQ(-1, stream->GetConfig().rtp.ulpfec.ulpfec_payload_type)
|
||||
<< "SetSendCodec without FEC should disable current FEC.";
|
||||
}
|
||||
|
||||
TEST_F(WebRtcVideoChannel2Test, SetSendParamsWithoutFecDisablesReceivingFec) {
|
||||
FakeVideoReceiveStream* stream = AddRecvStream();
|
||||
EXPECT_EQ(kUlpfecCodec.id, stream->GetConfig().rtp.fec.ulpfec_payload_type);
|
||||
EXPECT_EQ(kUlpfecCodec.id,
|
||||
stream->GetConfig().rtp.ulpfec.ulpfec_payload_type);
|
||||
|
||||
cricket::VideoRecvParameters recv_parameters;
|
||||
recv_parameters.codecs.push_back(kVp8Codec);
|
||||
@ -2679,14 +2681,14 @@ TEST_F(WebRtcVideoChannel2Test, SetSendParamsWithoutFecDisablesReceivingFec) {
|
||||
ASSERT_TRUE(channel_->SetRecvParameters(recv_parameters));
|
||||
stream = fake_call_->GetVideoReceiveStreams()[0];
|
||||
ASSERT_TRUE(stream != NULL);
|
||||
EXPECT_EQ(kUlpfecCodec.id, stream->GetConfig().rtp.fec.ulpfec_payload_type)
|
||||
EXPECT_EQ(kUlpfecCodec.id, stream->GetConfig().rtp.ulpfec.ulpfec_payload_type)
|
||||
<< "FEC should be enabled on the recieve stream.";
|
||||
|
||||
cricket::VideoSendParameters send_parameters;
|
||||
send_parameters.codecs.push_back(kVp8Codec);
|
||||
ASSERT_TRUE(channel_->SetSendParameters(send_parameters));
|
||||
stream = fake_call_->GetVideoReceiveStreams()[0];
|
||||
EXPECT_EQ(-1, stream->GetConfig().rtp.fec.ulpfec_payload_type)
|
||||
EXPECT_EQ(-1, stream->GetConfig().rtp.ulpfec.ulpfec_payload_type)
|
||||
<< "FEC should have been disabled when we know the other side won't do "
|
||||
"FEC.";
|
||||
|
||||
@ -2694,7 +2696,7 @@ TEST_F(WebRtcVideoChannel2Test, SetSendParamsWithoutFecDisablesReceivingFec) {
|
||||
send_parameters.codecs.push_back(kUlpfecCodec);
|
||||
ASSERT_TRUE(channel_->SetSendParameters(send_parameters));
|
||||
stream = fake_call_->GetVideoReceiveStreams()[0];
|
||||
EXPECT_EQ(kUlpfecCodec.id, stream->GetConfig().rtp.fec.ulpfec_payload_type)
|
||||
EXPECT_EQ(kUlpfecCodec.id, stream->GetConfig().rtp.ulpfec.ulpfec_payload_type)
|
||||
<< "FEC should be enabled on the recieve stream.";
|
||||
}
|
||||
|
||||
|
||||
@ -642,11 +642,11 @@ TEST_F(EndToEndTest, CanReceiveFec) {
|
||||
// int rtp_history_ms = 1000;
|
||||
// (*receive_configs)[0].rtp.nack.rtp_history_ms = rtp_history_ms;
|
||||
// send_config->rtp.nack.rtp_history_ms = rtp_history_ms;
|
||||
send_config->rtp.fec.red_payload_type = kRedPayloadType;
|
||||
send_config->rtp.fec.ulpfec_payload_type = kUlpfecPayloadType;
|
||||
send_config->rtp.ulpfec.red_payload_type = kRedPayloadType;
|
||||
send_config->rtp.ulpfec.ulpfec_payload_type = kUlpfecPayloadType;
|
||||
|
||||
(*receive_configs)[0].rtp.fec.red_payload_type = kRedPayloadType;
|
||||
(*receive_configs)[0].rtp.fec.ulpfec_payload_type = kUlpfecPayloadType;
|
||||
(*receive_configs)[0].rtp.ulpfec.red_payload_type = kRedPayloadType;
|
||||
(*receive_configs)[0].rtp.ulpfec.ulpfec_payload_type = kUlpfecPayloadType;
|
||||
(*receive_configs)[0].renderer = this;
|
||||
}
|
||||
|
||||
@ -783,16 +783,16 @@ TEST_F(EndToEndTest, ReceivedFecPacketsNotNacked) {
|
||||
VideoEncoderConfig* encoder_config) override {
|
||||
// Configure hybrid NACK/FEC.
|
||||
send_config->rtp.nack.rtp_history_ms = kNackRtpHistoryMs;
|
||||
send_config->rtp.fec.red_payload_type = kRedPayloadType;
|
||||
send_config->rtp.fec.ulpfec_payload_type = kUlpfecPayloadType;
|
||||
send_config->rtp.ulpfec.red_payload_type = kRedPayloadType;
|
||||
send_config->rtp.ulpfec.ulpfec_payload_type = kUlpfecPayloadType;
|
||||
// Set codec to VP8, otherwise NACK/FEC hybrid will be disabled.
|
||||
send_config->encoder_settings.encoder = encoder_.get();
|
||||
send_config->encoder_settings.payload_name = "VP8";
|
||||
send_config->encoder_settings.payload_type = kFakeVideoSendPayloadType;
|
||||
|
||||
(*receive_configs)[0].rtp.nack.rtp_history_ms = kNackRtpHistoryMs;
|
||||
(*receive_configs)[0].rtp.fec.red_payload_type = kRedPayloadType;
|
||||
(*receive_configs)[0].rtp.fec.ulpfec_payload_type = kUlpfecPayloadType;
|
||||
(*receive_configs)[0].rtp.ulpfec.red_payload_type = kRedPayloadType;
|
||||
(*receive_configs)[0].rtp.ulpfec.ulpfec_payload_type = kUlpfecPayloadType;
|
||||
|
||||
(*receive_configs)[0].decoders.resize(1);
|
||||
(*receive_configs)[0].decoders[0].payload_type =
|
||||
@ -904,16 +904,16 @@ void EndToEndTest::DecodesRetransmittedFrame(bool enable_rtx, bool enable_red) {
|
||||
(*receive_configs)[0].rtp.nack.rtp_history_ms = kNackRtpHistoryMs;
|
||||
|
||||
if (payload_type_ == kRedPayloadType) {
|
||||
send_config->rtp.fec.ulpfec_payload_type = kUlpfecPayloadType;
|
||||
send_config->rtp.fec.red_payload_type = kRedPayloadType;
|
||||
send_config->rtp.ulpfec.ulpfec_payload_type = kUlpfecPayloadType;
|
||||
send_config->rtp.ulpfec.red_payload_type = kRedPayloadType;
|
||||
if (retransmission_ssrc_ == kSendRtxSsrcs[0])
|
||||
send_config->rtp.fec.red_rtx_payload_type = kRtxRedPayloadType;
|
||||
(*receive_configs)[0].rtp.fec.ulpfec_payload_type =
|
||||
send_config->rtp.fec.ulpfec_payload_type;
|
||||
(*receive_configs)[0].rtp.fec.red_payload_type =
|
||||
send_config->rtp.fec.red_payload_type;
|
||||
(*receive_configs)[0].rtp.fec.red_rtx_payload_type =
|
||||
send_config->rtp.fec.red_rtx_payload_type;
|
||||
send_config->rtp.ulpfec.red_rtx_payload_type = kRtxRedPayloadType;
|
||||
(*receive_configs)[0].rtp.ulpfec.ulpfec_payload_type =
|
||||
send_config->rtp.ulpfec.ulpfec_payload_type;
|
||||
(*receive_configs)[0].rtp.ulpfec.red_payload_type =
|
||||
send_config->rtp.ulpfec.red_payload_type;
|
||||
(*receive_configs)[0].rtp.ulpfec.red_rtx_payload_type =
|
||||
send_config->rtp.ulpfec.red_rtx_payload_type;
|
||||
}
|
||||
|
||||
if (retransmission_ssrc_ == kSendRtxSsrcs[0]) {
|
||||
@ -2162,13 +2162,14 @@ void EndToEndTest::VerifyHistogramStats(bool use_rtx,
|
||||
(*receive_configs)[0].renderer = this;
|
||||
// FEC
|
||||
if (use_red_) {
|
||||
send_config->rtp.fec.ulpfec_payload_type = kUlpfecPayloadType;
|
||||
send_config->rtp.fec.red_payload_type = kRedPayloadType;
|
||||
send_config->rtp.ulpfec.ulpfec_payload_type = kUlpfecPayloadType;
|
||||
send_config->rtp.ulpfec.red_payload_type = kRedPayloadType;
|
||||
send_config->encoder_settings.encoder = vp8_encoder_.get();
|
||||
send_config->encoder_settings.payload_name = "VP8";
|
||||
(*receive_configs)[0].decoders[0].payload_name = "VP8";
|
||||
(*receive_configs)[0].rtp.fec.red_payload_type = kRedPayloadType;
|
||||
(*receive_configs)[0].rtp.fec.ulpfec_payload_type = kUlpfecPayloadType;
|
||||
(*receive_configs)[0].rtp.ulpfec.red_payload_type = kRedPayloadType;
|
||||
(*receive_configs)[0].rtp.ulpfec.ulpfec_payload_type =
|
||||
kUlpfecPayloadType;
|
||||
}
|
||||
// RTX
|
||||
if (use_rtx_) {
|
||||
@ -3715,7 +3716,7 @@ void VerifyEmptyNackConfig(const NackConfig& config) {
|
||||
<< "Enabling NACK requires rtcp-fb: nack negotiation.";
|
||||
}
|
||||
|
||||
void VerifyEmptyFecConfig(const FecConfig& config) {
|
||||
void VerifyEmptyUlpfecConfig(const UlpfecConfig& config) {
|
||||
EXPECT_EQ(-1, config.ulpfec_payload_type)
|
||||
<< "Enabling FEC requires rtpmap: ulpfec negotiation.";
|
||||
EXPECT_EQ(-1, config.red_payload_type)
|
||||
@ -3734,7 +3735,7 @@ TEST_F(EndToEndTest, VerifyDefaultSendConfigParameters) {
|
||||
<< "Enabling RTP extensions require negotiation.";
|
||||
|
||||
VerifyEmptyNackConfig(default_send_config.rtp.nack);
|
||||
VerifyEmptyFecConfig(default_send_config.rtp.fec);
|
||||
VerifyEmptyUlpfecConfig(default_send_config.rtp.ulpfec);
|
||||
}
|
||||
|
||||
TEST_F(EndToEndTest, VerifyDefaultReceiveConfigParameters) {
|
||||
@ -3752,7 +3753,7 @@ TEST_F(EndToEndTest, VerifyDefaultReceiveConfigParameters) {
|
||||
<< "Enabling RTP extensions require negotiation.";
|
||||
|
||||
VerifyEmptyNackConfig(default_receive_config.rtp.nack);
|
||||
VerifyEmptyFecConfig(default_receive_config.rtp.fec);
|
||||
VerifyEmptyUlpfecConfig(default_receive_config.rtp.ulpfec);
|
||||
}
|
||||
|
||||
TEST_F(EndToEndTest, TransportSeqNumOnAudioAndVideo) {
|
||||
|
||||
@ -131,7 +131,7 @@ void ReceiveStatisticsProxy::UpdateHistograms() {
|
||||
static_cast<int>(rtx.transmitted.TotalBytes() *
|
||||
8 / elapsed_sec / 1000));
|
||||
}
|
||||
if (config_.rtp.fec.ulpfec_payload_type != -1) {
|
||||
if (config_.rtp.ulpfec.ulpfec_payload_type != -1) {
|
||||
RTC_HISTOGRAM_COUNTS_10000(
|
||||
"WebRTC.Video.FecBitrateReceivedInKbps",
|
||||
static_cast<int>(rtp_rtx.fec.TotalBytes() * 8 / elapsed_sec / 1000));
|
||||
|
||||
@ -99,7 +99,7 @@ class ReceiveStatisticsProxy : public VCMReceiveStatisticsCallback,
|
||||
// Ownership of this object lies with the owner of the ReceiveStatisticsProxy
|
||||
// instance. Lifetime is guaranteed to outlive |this|.
|
||||
// TODO(tommi): In practice the config_ reference is only used for accessing
|
||||
// config_.rtp.fec.ulpfec_payload_type. Instead of holding a pointer back,
|
||||
// config_.rtp.ulpfec.ulpfec_payload_type. Instead of holding a pointer back,
|
||||
// we could just store the value of ulpfec_payload_type and change the
|
||||
// ReceiveStatisticsProxy() ctor to accept a const& of Config (since we'll
|
||||
// then no longer store a pointer to the object).
|
||||
|
||||
@ -217,8 +217,8 @@ void RtpReplay() {
|
||||
VideoReceiveStream::Config receive_config(&transport);
|
||||
receive_config.rtp.remote_ssrc = flags::Ssrc();
|
||||
receive_config.rtp.local_ssrc = kReceiverLocalSsrc;
|
||||
receive_config.rtp.fec.ulpfec_payload_type = flags::FecPayloadType();
|
||||
receive_config.rtp.fec.red_payload_type = flags::RedPayloadType();
|
||||
receive_config.rtp.ulpfec.ulpfec_payload_type = flags::FecPayloadType();
|
||||
receive_config.rtp.ulpfec.red_payload_type = flags::RedPayloadType();
|
||||
receive_config.rtp.nack.rtp_history_ms = 1000;
|
||||
if (flags::TransmissionOffsetId() != -1) {
|
||||
receive_config.rtp.extensions.push_back(RtpExtension(
|
||||
|
||||
@ -165,23 +165,22 @@ RtpStreamReceiver::RtpStreamReceiver(
|
||||
VideoCodec ulpfec_codec = {};
|
||||
ulpfec_codec.codecType = kVideoCodecULPFEC;
|
||||
strncpy(ulpfec_codec.plName, "ulpfec", sizeof(ulpfec_codec.plName));
|
||||
ulpfec_codec.plType = config_.rtp.fec.ulpfec_payload_type;
|
||||
ulpfec_codec.plType = config_.rtp.ulpfec.ulpfec_payload_type;
|
||||
RTC_CHECK(SetReceiveCodec(ulpfec_codec));
|
||||
|
||||
VideoCodec red_codec = {};
|
||||
red_codec.codecType = kVideoCodecRED;
|
||||
strncpy(red_codec.plName, "red", sizeof(red_codec.plName));
|
||||
red_codec.plType = config_.rtp.fec.red_payload_type;
|
||||
red_codec.plType = config_.rtp.ulpfec.red_payload_type;
|
||||
RTC_CHECK(SetReceiveCodec(red_codec));
|
||||
if (config_.rtp.fec.red_rtx_payload_type != -1) {
|
||||
if (config_.rtp.ulpfec.red_rtx_payload_type != -1) {
|
||||
rtp_payload_registry_.SetRtxPayloadType(
|
||||
config_.rtp.fec.red_rtx_payload_type,
|
||||
config_.rtp.fec.red_payload_type);
|
||||
config_.rtp.ulpfec.red_rtx_payload_type,
|
||||
config_.rtp.ulpfec.red_payload_type);
|
||||
}
|
||||
|
||||
rtp_rtcp_->SetGenericFECStatus(true,
|
||||
config_.rtp.fec.red_payload_type,
|
||||
config_.rtp.fec.ulpfec_payload_type);
|
||||
rtp_rtcp_->SetGenericFECStatus(true, config_.rtp.ulpfec.red_payload_type,
|
||||
config_.rtp.ulpfec.ulpfec_payload_type);
|
||||
}
|
||||
|
||||
if (config_.rtp.rtcp_xr.receiver_reference_time_report)
|
||||
@ -338,8 +337,8 @@ int32_t RtpStreamReceiver::SliceLossIndicationRequest(
|
||||
}
|
||||
|
||||
bool RtpStreamReceiver::IsFecEnabled() const {
|
||||
return config_.rtp.fec.red_payload_type != -1 &&
|
||||
config_.rtp.fec.ulpfec_payload_type != -1;
|
||||
return config_.rtp.ulpfec.red_payload_type != -1 &&
|
||||
config_.rtp.ulpfec.ulpfec_payload_type != -1;
|
||||
}
|
||||
|
||||
bool RtpStreamReceiver::IsRetransmissionsEnabled() const {
|
||||
|
||||
@ -329,7 +329,7 @@ void SendStatisticsProxy::UmaSamplesContainer::UpdateHistograms(
|
||||
static_cast<int>(rtx.transmitted.TotalBytes() * 8 / elapsed_sec /
|
||||
1000));
|
||||
}
|
||||
if (rtp_config.fec.red_payload_type != -1) {
|
||||
if (rtp_config.ulpfec.red_payload_type != -1) {
|
||||
RTC_HISTOGRAMS_COUNTS_10000(kIndex,
|
||||
uma_prefix_ + "FecBitrateSentInKbps",
|
||||
static_cast<int>(rtp_rtx.fec.TotalBytes() *
|
||||
|
||||
@ -57,7 +57,7 @@ class SendStatisticsProxyTest : public ::testing::Test {
|
||||
config.rtp.ssrcs.push_back(kSecondSsrc);
|
||||
config.rtp.rtx.ssrcs.push_back(kFirstRtxSsrc);
|
||||
config.rtp.rtx.ssrcs.push_back(kSecondRtxSsrc);
|
||||
config.rtp.fec.red_payload_type = 17;
|
||||
config.rtp.ulpfec.red_payload_type = 17;
|
||||
return config;
|
||||
}
|
||||
|
||||
|
||||
@ -1293,12 +1293,12 @@ void VideoQualityTest::RunWithRenderers(const Params& params) {
|
||||
params_.common.suspend_below_min_bitrate;
|
||||
|
||||
if (params.common.fec) {
|
||||
video_send_config_.rtp.fec.red_payload_type = kRedPayloadType;
|
||||
video_send_config_.rtp.fec.ulpfec_payload_type = kUlpfecPayloadType;
|
||||
video_receive_configs_[stream_id].rtp.fec.red_payload_type =
|
||||
kRedPayloadType;
|
||||
video_receive_configs_[stream_id].rtp.fec.ulpfec_payload_type =
|
||||
kUlpfecPayloadType;
|
||||
video_send_config_.rtp.ulpfec.red_payload_type = kRedPayloadType;
|
||||
video_send_config_.rtp.ulpfec.ulpfec_payload_type = kUlpfecPayloadType;
|
||||
video_receive_configs_[stream_id].rtp.ulpfec.red_payload_type =
|
||||
kRedPayloadType;
|
||||
video_receive_configs_[stream_id].rtp.ulpfec.ulpfec_payload_type =
|
||||
kUlpfecPayloadType;
|
||||
}
|
||||
|
||||
if (params_.screenshare.enabled)
|
||||
|
||||
@ -94,7 +94,7 @@ std::string VideoReceiveStream::Config::Rtp::ToString() const {
|
||||
ss << ", remb: " << (remb ? "on" : "off");
|
||||
ss << ", transport_cc: " << (transport_cc ? "on" : "off");
|
||||
ss << ", nack: {rtp_history_ms: " << nack.rtp_history_ms << '}';
|
||||
ss << ", fec: " << fec.ToString();
|
||||
ss << ", ulpfec: " << ulpfec.ToString();
|
||||
ss << ", rtx: {";
|
||||
for (auto& kv : rtx) {
|
||||
ss << kv.first << " -> ";
|
||||
|
||||
@ -132,7 +132,7 @@ std::string VideoSendStream::Config::Rtp::ToString() const {
|
||||
ss << ']';
|
||||
|
||||
ss << ", nack: {rtp_history_ms: " << nack.rtp_history_ms << '}';
|
||||
ss << ", fec: " << fec.ToString();
|
||||
ss << ", ulpfec: " << ulpfec.ToString();
|
||||
ss << ", rtx: " << rtx.ToString();
|
||||
ss << ", c_name: " << c_name;
|
||||
ss << '}';
|
||||
@ -922,7 +922,7 @@ void VideoSendStreamImpl::ConfigureProtection() {
|
||||
RTC_DCHECK_RUN_ON(worker_queue_);
|
||||
// Enable NACK, FEC or both.
|
||||
const bool enable_protection_nack = config_->rtp.nack.rtp_history_ms > 0;
|
||||
bool enable_protection_fec = config_->rtp.fec.ulpfec_payload_type != -1;
|
||||
bool enable_protection_fec = config_->rtp.ulpfec.ulpfec_payload_type != -1;
|
||||
// Payload types without picture ID cannot determine that a stream is complete
|
||||
// without retransmitting FEC, so using FEC + NACK for H.264 (for instance) is
|
||||
// a waste of bandwidth since FEC packets still have to be transmitted. Note
|
||||
@ -943,21 +943,22 @@ void VideoSendStreamImpl::ConfigureProtection() {
|
||||
// TODO(changbin): Should set RTX for RED mapping in RTP sender in future.
|
||||
// Validate payload types. If either RED or FEC payload types are set then
|
||||
// both should be. If FEC is enabled then they both have to be set.
|
||||
if (config_->rtp.fec.red_payload_type != -1) {
|
||||
RTC_DCHECK_GE(config_->rtp.fec.red_payload_type, 0);
|
||||
RTC_DCHECK_LE(config_->rtp.fec.red_payload_type, 127);
|
||||
if (config_->rtp.ulpfec.red_payload_type != -1) {
|
||||
RTC_DCHECK_GE(config_->rtp.ulpfec.red_payload_type, 0);
|
||||
RTC_DCHECK_LE(config_->rtp.ulpfec.red_payload_type, 127);
|
||||
// TODO(holmer): We should only enable red if ulpfec is also enabled, but
|
||||
// but due to an incompatibility issue with previous versions the receiver
|
||||
// assumes rtx packets are containing red if it has been configured to
|
||||
// receive red. Remove this in a few versions once the incompatibility
|
||||
// issue is resolved (M53 timeframe).
|
||||
payload_type_red = static_cast<uint8_t>(config_->rtp.fec.red_payload_type);
|
||||
payload_type_red =
|
||||
static_cast<uint8_t>(config_->rtp.ulpfec.red_payload_type);
|
||||
}
|
||||
if (config_->rtp.fec.ulpfec_payload_type != -1) {
|
||||
RTC_DCHECK_GE(config_->rtp.fec.ulpfec_payload_type, 0);
|
||||
RTC_DCHECK_LE(config_->rtp.fec.ulpfec_payload_type, 127);
|
||||
if (config_->rtp.ulpfec.ulpfec_payload_type != -1) {
|
||||
RTC_DCHECK_GE(config_->rtp.ulpfec.ulpfec_payload_type, 0);
|
||||
RTC_DCHECK_LE(config_->rtp.ulpfec.ulpfec_payload_type, 127);
|
||||
payload_type_fec =
|
||||
static_cast<uint8_t>(config_->rtp.fec.ulpfec_payload_type);
|
||||
static_cast<uint8_t>(config_->rtp.ulpfec.ulpfec_payload_type);
|
||||
}
|
||||
|
||||
for (RtpRtcp* rtp_rtcp : rtp_rtcp_modules_) {
|
||||
@ -1012,11 +1013,11 @@ void VideoSendStreamImpl::ConfigureSsrcs() {
|
||||
config_->encoder_settings.payload_type);
|
||||
rtp_rtcp->SetRtxSendStatus(kRtxRetransmitted | kRtxRedundantPayloads);
|
||||
}
|
||||
if (config_->rtp.fec.red_payload_type != -1 &&
|
||||
config_->rtp.fec.red_rtx_payload_type != -1) {
|
||||
if (config_->rtp.ulpfec.red_payload_type != -1 &&
|
||||
config_->rtp.ulpfec.red_rtx_payload_type != -1) {
|
||||
for (RtpRtcp* rtp_rtcp : rtp_rtcp_modules_) {
|
||||
rtp_rtcp->SetRtxSendPayloadType(config_->rtp.fec.red_rtx_payload_type,
|
||||
config_->rtp.fec.red_payload_type);
|
||||
rtp_rtcp->SetRtxSendPayloadType(config_->rtp.ulpfec.red_rtx_payload_type,
|
||||
config_->rtp.ulpfec.red_payload_type);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@ -429,10 +429,10 @@ class FecObserver : public test::EndToEndTest {
|
||||
}
|
||||
send_config->encoder_settings.encoder = encoder_.get();
|
||||
send_config->encoder_settings.payload_name = payload_name_;
|
||||
send_config->rtp.fec.red_payload_type =
|
||||
VideoSendStreamTest::kRedPayloadType;
|
||||
send_config->rtp.fec.ulpfec_payload_type =
|
||||
VideoSendStreamTest::kUlpfecPayloadType;
|
||||
send_config->rtp.ulpfec.red_payload_type =
|
||||
VideoSendStreamTest::kRedPayloadType;
|
||||
send_config->rtp.ulpfec.ulpfec_payload_type =
|
||||
VideoSendStreamTest::kUlpfecPayloadType;
|
||||
if (header_extensions_enabled_) {
|
||||
send_config->rtp.extensions.push_back(RtpExtension(
|
||||
RtpExtension::kAbsSendTimeUri, test::kAbsSendTimeExtensionId));
|
||||
@ -440,10 +440,10 @@ class FecObserver : public test::EndToEndTest {
|
||||
RtpExtension(RtpExtension::kTransportSequenceNumberUri,
|
||||
test::kTransportSequenceNumberExtensionId));
|
||||
}
|
||||
(*receive_configs)[0].rtp.fec.red_payload_type =
|
||||
send_config->rtp.fec.red_payload_type;
|
||||
(*receive_configs)[0].rtp.fec.ulpfec_payload_type =
|
||||
send_config->rtp.fec.ulpfec_payload_type;
|
||||
(*receive_configs)[0].rtp.ulpfec.red_payload_type =
|
||||
send_config->rtp.ulpfec.red_payload_type;
|
||||
(*receive_configs)[0].rtp.ulpfec.ulpfec_payload_type =
|
||||
send_config->rtp.ulpfec.ulpfec_payload_type;
|
||||
}
|
||||
|
||||
void PerformTest() override {
|
||||
@ -749,8 +749,8 @@ void VideoSendStreamTest::TestPacketFragmentationSize(VideoFormat format,
|
||||
new internal::TransportAdapter(send_config->send_transport));
|
||||
transport_adapter_->Enable();
|
||||
if (use_fec_) {
|
||||
send_config->rtp.fec.red_payload_type = kRedPayloadType;
|
||||
send_config->rtp.fec.ulpfec_payload_type = kUlpfecPayloadType;
|
||||
send_config->rtp.ulpfec.red_payload_type = kRedPayloadType;
|
||||
send_config->rtp.ulpfec.ulpfec_payload_type = kUlpfecPayloadType;
|
||||
}
|
||||
|
||||
if (!test_generic_packetization_)
|
||||
|
||||
@ -134,8 +134,8 @@ class VideoReceiveStream {
|
||||
// See NackConfig for description.
|
||||
NackConfig nack;
|
||||
|
||||
// See FecConfig for description.
|
||||
FecConfig fec;
|
||||
// See UlpfecConfig for description.
|
||||
UlpfecConfig ulpfec;
|
||||
|
||||
// RTX settings for incoming video payloads that may be received. RTX is
|
||||
// disabled if there's no config present.
|
||||
|
||||
@ -129,8 +129,8 @@ class VideoSendStream {
|
||||
// See NackConfig for description.
|
||||
NackConfig nack;
|
||||
|
||||
// See FecConfig for description.
|
||||
FecConfig fec;
|
||||
// See UlpfecConfig for description.
|
||||
UlpfecConfig ulpfec;
|
||||
|
||||
// Settings for RTP retransmission payload format, see RFC 4588 for
|
||||
// details.
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user