Skip to content
This repository was archived by the owner on Oct 25, 2024. It is now read-only.

Commit d998135

Browse files
grgustafjianjunz
authored andcommitted
Identify keyframe packets for FEC protection (#106)
There is code to set different protection levels for keyframes vs. delta frames, but because this set_is_key_frame was never called, the distinction was never used. Also, clear old media packets from a previous frame, which can happen if a keyframe request comes from the receiver.
1 parent 7806200 commit d998135

File tree

2 files changed

+7
-0
lines changed

2 files changed

+7
-0
lines changed

modules/rtp_rtcp/source/rtp_sender_video.cc

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -715,6 +715,8 @@ bool RTPSenderVideo::SendVideo(
715715
packet->set_is_key_frame(video_header.frame_type ==
716716
VideoFrameType::kVideoFrameKey);
717717

718+
packet->set_is_key_frame(video_header.frame_type == VideoFrameType::kVideoFrameKey);
719+
718720
// Put packetization finish timestamp into extension.
719721
if (packet->HasExtension<VideoTimingExtension>()) {
720722
packet->set_packetization_finish_time(clock_->CurrentTime());

modules/rtp_rtcp/source/ulpfec_generator.cc

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -110,6 +110,11 @@ void UlpfecGenerator::AddPacketAndGenerateFec(const RtpPacketToSend& packet) {
110110
RTC_DCHECK_RUNS_SERIALIZED(&race_checker_);
111111
RTC_DCHECK(generated_fec_packets_.empty());
112112

113+
// reset state upon async keyframe request
114+
if (keyframe_in_process_ != packet.is_key_frame()) {
115+
ResetState();
116+
}
117+
113118
{
114119
MutexLock lock(&mutex_);
115120
if (pending_params_) {

0 commit comments

Comments
 (0)