Jitter delay now depend on protection mode (FEC/NACK).
R=stefan@webrtc.org Review URL: https://codereview.webrtc.org/1942683003 . Cr-Commit-Position: refs/heads/master@{#12661}
This commit is contained in:
@ -601,6 +601,7 @@ VCMEncodedFrame* VCMJitterBuffer::ExtractAndSetDecode(uint32_t timestamp) {
|
||||
// Frame pulled out from jitter buffer, update the jitter estimate.
|
||||
const bool retransmitted = (frame->GetNackCount() > 0);
|
||||
if (retransmitted) {
|
||||
if (WaitForRetransmissions())
|
||||
jitter_estimate_.FrameNacked();
|
||||
} else if (frame->Length() > 0) {
|
||||
// Ignore retransmitted and empty frames.
|
||||
@ -958,6 +959,8 @@ void VCMJitterBuffer::UpdateRtt(int64_t rtt_ms) {
|
||||
jitter_estimate_.UpdateRtt(rtt_ms);
|
||||
if (nack_module_)
|
||||
nack_module_->UpdateRtt(rtt_ms);
|
||||
if (!WaitForRetransmissions())
|
||||
jitter_estimate_.ResetNackCount();
|
||||
}
|
||||
|
||||
void VCMJitterBuffer::SetNackMode(VCMNackMode mode,
|
||||
|
||||
@ -45,6 +45,10 @@ enum FilterPacketLossMode {
|
||||
// common to media optimization and the jitter buffer.
|
||||
const int64_t kLowRttNackMs = 20;
|
||||
|
||||
// If the RTT is higher than this an extra RTT wont be added to to the jitter
|
||||
// buffer delay.
|
||||
const int kMaxRttDelayThreshold = 500;
|
||||
|
||||
struct VCMProtectionParameters {
|
||||
VCMProtectionParameters()
|
||||
: rtt(0),
|
||||
|
||||
@ -168,7 +168,9 @@ int32_t VideoReceiver::SetVideoProtection(VCMVideoProtection videoProtection,
|
||||
case kProtectionNackFEC: {
|
||||
rtc::CritScope cs(&receive_crit_);
|
||||
RTC_DCHECK(enable);
|
||||
_receiver.SetNackMode(kNack, media_optimization::kLowRttNackMs, -1);
|
||||
_receiver.SetNackMode(kNack,
|
||||
media_optimization::kLowRttNackMs,
|
||||
media_optimization::kMaxRttDelayThreshold);
|
||||
_receiver.SetDecodeErrorMode(kNoErrors);
|
||||
break;
|
||||
}
|
||||
|
||||
@ -176,6 +176,10 @@ RtpStreamReceiver::RtpStreamReceiver(
|
||||
config_.rtp.fec.red_rtx_payload_type,
|
||||
config_.rtp.fec.red_payload_type);
|
||||
}
|
||||
|
||||
rtp_rtcp_->SetGenericFECStatus(true,
|
||||
config_.rtp.fec.red_payload_type,
|
||||
config_.rtp.fec.ulpfec_payload_type);
|
||||
}
|
||||
|
||||
if (config.rtp.rtcp_xr.receiver_reference_time_report)
|
||||
|
||||
@ -54,8 +54,14 @@ VideoStreamDecoder::VideoStreamDecoder(
|
||||
static const int kDefaultRenderDelayMs = 10;
|
||||
video_receiver_->SetRenderDelay(kDefaultRenderDelayMs);
|
||||
|
||||
VCMVideoProtection video_protection = enable_nack ? kProtectionNack
|
||||
: kProtectionNone;
|
||||
VCMVideoProtection video_protection = kProtectionNone;
|
||||
if (enable_nack) {
|
||||
if (enable_fec)
|
||||
video_protection = kProtectionNackFEC;
|
||||
else
|
||||
video_protection = kProtectionNack;
|
||||
}
|
||||
|
||||
VCMDecodeErrorMode decode_error_mode = enable_nack ? kNoErrors : kWithErrors;
|
||||
video_receiver_->SetVideoProtection(video_protection, true);
|
||||
video_receiver_->SetDecodeErrorMode(decode_error_mode);
|
||||
|
||||
Reference in New Issue
Block a user