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.
|
||||
const bool retransmitted = (frame->GetNackCount() > 0);
|
||||
if (retransmitted) {
|
||||
jitter_estimate_.FrameNacked();
|
||||
if (WaitForRetransmissions())
|
||||
jitter_estimate_.FrameNacked();
|
||||
} else if (frame->Length() > 0) {
|
||||
// Ignore retransmitted and empty frames.
|
||||
if (waiting_for_completion_.latest_packet_time >= 0) {
|
||||
@ -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;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user