Don't disable FEC if timing frames are disabled.

Don't disable fec for packets without timing frames extension
even if they are marked as belonging to timing frames.

BUG=webrtc:7894

Review-Url: https://codereview.webrtc.org/2956263002
Cr-Commit-Position: refs/heads/master@{#18826}
This commit is contained in:
ilnik 2017-06-29 02:27:44 -07:00 committed by Commit Bot
parent 8c1ee7b73a
commit e4350197ec
2 changed files with 6 additions and 3 deletions

View File

@ -951,6 +951,7 @@ TEST_P(RtpSenderTest, NoFlexfecForTimingFrames) {
constexpr uint32_t kFlexfecSsrc = 5678;
const std::vector<RtpExtension> kNoRtpExtensions;
const std::vector<RtpExtensionSize> kNoRtpExtensionSizes;
FlexfecSender flexfec_sender(kFlexfecPayloadType, kFlexfecSsrc, kMediaSsrc,
kNoRtpExtensions, kNoRtpExtensionSizes,
nullptr /* rtp_state */, &fake_clock_);
@ -966,6 +967,10 @@ TEST_P(RtpSenderTest, NoFlexfecForTimingFrames) {
rtp_sender_->SetSendPayloadType(kMediaPayloadType);
rtp_sender_->SetStorePacketsStatus(true, 10);
// Need extension to be registered for timing frames to be sent.
ASSERT_EQ(0, rtp_sender_->RegisterRtpHeaderExtension(
kRtpExtensionVideoTiming, kVideoTimingExtensionId));
// Parameters selected to generate a single FEC packet per media packet.
FecProtectionParams params;
params.fec_rate = 15;

View File

@ -304,7 +304,6 @@ bool RTPSenderVideo::SendVideo(RtpVideoCodecTypes video_type,
auto last_packet = rtc::MakeUnique<RtpPacketToSend>(*rtp_header);
size_t fec_packet_overhead;
bool is_timing_frame = false;
bool red_enabled;
int32_t retransmission_settings;
{
@ -336,7 +335,6 @@ bool RTPSenderVideo::SendVideo(RtpVideoCodecTypes video_type,
if (video_header->video_timing.is_timing_frame) {
last_packet->SetExtension<VideoTimingExtension>(
video_header->video_timing);
is_timing_frame = true;
}
}
@ -396,7 +394,7 @@ bool RTPSenderVideo::SendVideo(RtpVideoCodecTypes video_type,
bool protect_packet = (packetizer->GetProtectionType() == kProtectedPacket);
// Put packetization finish timestamp into extension.
if (last && is_timing_frame) {
if (packet->HasExtension<VideoTimingExtension>()) {
packet->set_packetization_finish_time_ms(clock_->TimeInMilliseconds());
// TODO(ilnik): Due to webrtc:7859, packets with timing extensions are not
// protected by FEC. It reduces FEC efficiency a bit. When FEC is moved