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,7 +601,8 @@ VCMEncodedFrame* VCMJitterBuffer::ExtractAndSetDecode(uint32_t timestamp) {
|
|||||||
// Frame pulled out from jitter buffer, update the jitter estimate.
|
// Frame pulled out from jitter buffer, update the jitter estimate.
|
||||||
const bool retransmitted = (frame->GetNackCount() > 0);
|
const bool retransmitted = (frame->GetNackCount() > 0);
|
||||||
if (retransmitted) {
|
if (retransmitted) {
|
||||||
jitter_estimate_.FrameNacked();
|
if (WaitForRetransmissions())
|
||||||
|
jitter_estimate_.FrameNacked();
|
||||||
} else if (frame->Length() > 0) {
|
} else if (frame->Length() > 0) {
|
||||||
// Ignore retransmitted and empty frames.
|
// Ignore retransmitted and empty frames.
|
||||||
if (waiting_for_completion_.latest_packet_time >= 0) {
|
if (waiting_for_completion_.latest_packet_time >= 0) {
|
||||||
@ -958,6 +959,8 @@ void VCMJitterBuffer::UpdateRtt(int64_t rtt_ms) {
|
|||||||
jitter_estimate_.UpdateRtt(rtt_ms);
|
jitter_estimate_.UpdateRtt(rtt_ms);
|
||||||
if (nack_module_)
|
if (nack_module_)
|
||||||
nack_module_->UpdateRtt(rtt_ms);
|
nack_module_->UpdateRtt(rtt_ms);
|
||||||
|
if (!WaitForRetransmissions())
|
||||||
|
jitter_estimate_.ResetNackCount();
|
||||||
}
|
}
|
||||||
|
|
||||||
void VCMJitterBuffer::SetNackMode(VCMNackMode mode,
|
void VCMJitterBuffer::SetNackMode(VCMNackMode mode,
|
||||||
|
|||||||
@ -45,6 +45,10 @@ enum FilterPacketLossMode {
|
|||||||
// common to media optimization and the jitter buffer.
|
// common to media optimization and the jitter buffer.
|
||||||
const int64_t kLowRttNackMs = 20;
|
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 {
|
struct VCMProtectionParameters {
|
||||||
VCMProtectionParameters()
|
VCMProtectionParameters()
|
||||||
: rtt(0),
|
: rtt(0),
|
||||||
|
|||||||
@ -168,7 +168,9 @@ int32_t VideoReceiver::SetVideoProtection(VCMVideoProtection videoProtection,
|
|||||||
case kProtectionNackFEC: {
|
case kProtectionNackFEC: {
|
||||||
rtc::CritScope cs(&receive_crit_);
|
rtc::CritScope cs(&receive_crit_);
|
||||||
RTC_DCHECK(enable);
|
RTC_DCHECK(enable);
|
||||||
_receiver.SetNackMode(kNack, media_optimization::kLowRttNackMs, -1);
|
_receiver.SetNackMode(kNack,
|
||||||
|
media_optimization::kLowRttNackMs,
|
||||||
|
media_optimization::kMaxRttDelayThreshold);
|
||||||
_receiver.SetDecodeErrorMode(kNoErrors);
|
_receiver.SetDecodeErrorMode(kNoErrors);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|||||||
@ -176,6 +176,10 @@ RtpStreamReceiver::RtpStreamReceiver(
|
|||||||
config_.rtp.fec.red_rtx_payload_type,
|
config_.rtp.fec.red_rtx_payload_type,
|
||||||
config_.rtp.fec.red_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)
|
if (config.rtp.rtcp_xr.receiver_reference_time_report)
|
||||||
|
|||||||
@ -54,8 +54,14 @@ VideoStreamDecoder::VideoStreamDecoder(
|
|||||||
static const int kDefaultRenderDelayMs = 10;
|
static const int kDefaultRenderDelayMs = 10;
|
||||||
video_receiver_->SetRenderDelay(kDefaultRenderDelayMs);
|
video_receiver_->SetRenderDelay(kDefaultRenderDelayMs);
|
||||||
|
|
||||||
VCMVideoProtection video_protection = enable_nack ? kProtectionNack
|
VCMVideoProtection video_protection = kProtectionNone;
|
||||||
: kProtectionNone;
|
if (enable_nack) {
|
||||||
|
if (enable_fec)
|
||||||
|
video_protection = kProtectionNackFEC;
|
||||||
|
else
|
||||||
|
video_protection = kProtectionNack;
|
||||||
|
}
|
||||||
|
|
||||||
VCMDecodeErrorMode decode_error_mode = enable_nack ? kNoErrors : kWithErrors;
|
VCMDecodeErrorMode decode_error_mode = enable_nack ? kNoErrors : kWithErrors;
|
||||||
video_receiver_->SetVideoProtection(video_protection, true);
|
video_receiver_->SetVideoProtection(video_protection, true);
|
||||||
video_receiver_->SetDecodeErrorMode(decode_error_mode);
|
video_receiver_->SetDecodeErrorMode(decode_error_mode);
|
||||||
|
|||||||
Reference in New Issue
Block a user