Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(203)

Unified Diff: webrtc/modules/remote_bitrate_estimator/inter_arrival.h

Issue 2126793002: Reset InterArrival if arrival time clock makes a jump. (Closed) Base URL: https://chromium.googlesource.com/external/webrtc.git@master
Patch Set: Fix a few test issues. Created 4 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « webrtc/modules/modules.gyp ('k') | webrtc/modules/remote_bitrate_estimator/inter_arrival.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: webrtc/modules/remote_bitrate_estimator/inter_arrival.h
diff --git a/webrtc/modules/remote_bitrate_estimator/inter_arrival.h b/webrtc/modules/remote_bitrate_estimator/inter_arrival.h
index 427bafcf96ffaedea1ce6ffca4ab8c56635b54f4..088b925d2e206b1594e9d34edf61d28f9f9e8e78 100644
--- a/webrtc/modules/remote_bitrate_estimator/inter_arrival.h
+++ b/webrtc/modules/remote_bitrate_estimator/inter_arrival.h
@@ -23,6 +23,11 @@ namespace webrtc {
// a client defined rate.
class InterArrival {
public:
+ // After this many packet groups received out of order InterArrival will
+ // reset, assuming that clocks have made a jump.
+ static constexpr int kReorderedResetThreshold = 3;
+ static constexpr int64_t kArrivalTimeOffsetThresholdMs = 3000;
+
// A timestamp group is defined as all packets with a timestamp which are at
// most timestamp_group_length_ticks older than the first timestamp in that
// group.
@@ -40,6 +45,7 @@ class InterArrival {
// |packet_size_delta| (output) is the computed size delta.
bool ComputeDeltas(uint32_t timestamp,
int64_t arrival_time_ms,
+ int64_t system_time_ms,
size_t packet_size,
uint32_t* timestamp_delta,
int64_t* arrival_time_delta_ms,
@@ -61,6 +67,7 @@ class InterArrival {
uint32_t first_timestamp;
uint32_t timestamp;
int64_t complete_time_ms;
+ int64_t last_system_time_ms;
};
// Returns true if the packet with timestamp |timestamp| arrived in order.
@@ -72,11 +79,14 @@ class InterArrival {
bool BelongsToBurst(int64_t arrival_time_ms, uint32_t timestamp) const;
+ void Reset();
+
const uint32_t kTimestampGroupLengthTicks;
TimestampGroup current_timestamp_group_;
TimestampGroup prev_timestamp_group_;
double timestamp_to_ms_coeff_;
bool burst_grouping_;
+ int num_consecutive_reordered_packets_;
RTC_DISALLOW_IMPLICIT_CONSTRUCTORS(InterArrival);
};
« no previous file with comments | « webrtc/modules/modules.gyp ('k') | webrtc/modules/remote_bitrate_estimator/inter_arrival.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698