Implement RTCInboundRTPStreamStats.JitterBufferMinimumDelay
This metric was recently added to the standard (see https://w3c.github.io/webrtc-stats/#dom-rtcinboundrtpstreamstats-jitterbufferminimumdelay). This CL implements it for audio streams.
Bug: webrtc:14141
Change-Id: I79d918639cd12361ebbc28c2be41549e33fa7e2a
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/262770
Reviewed-by: Tomas Gunnarsson <tommi@webrtc.org>
Reviewed-by: Jakob Ivarsson <jakobi@webrtc.org>
Reviewed-by: Henrik Boström <hbos@webrtc.org>
Commit-Queue: Ivo Creusen <ivoc@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#37567}
diff --git a/api/neteq/neteq.h b/api/neteq/neteq.h
index 4c9c0b6..ffc3958 100644
--- a/api/neteq/neteq.h
+++ b/api/neteq/neteq.h
@@ -67,6 +67,7 @@
uint64_t jitter_buffer_delay_ms = 0;
uint64_t jitter_buffer_emitted_count = 0;
uint64_t jitter_buffer_target_delay_ms = 0;
+ uint64_t jitter_buffer_minimum_delay_ms = 0;
uint64_t inserted_samples_for_deceleration = 0;
uint64_t removed_samples_for_acceleration = 0;
uint64_t silent_concealed_samples = 0;
diff --git a/api/neteq/neteq_controller.h b/api/neteq/neteq_controller.h
index 2f203f4..f0101d3 100644
--- a/api/neteq/neteq_controller.h
+++ b/api/neteq/neteq_controller.h
@@ -163,6 +163,12 @@
// Returns the target buffer level in ms.
virtual int TargetLevelMs() const = 0;
+ // Returns the target buffer level in ms as it would be if no minimum or
+ // maximum delay was set.
+ // TODO(bugs.webrtc.org/14270): Make pure virtual once all implementations are
+ // updated.
+ virtual int UnlimitedTargetLevelMs() const { return 0; }
+
// Notify the NetEqController that a packet has arrived. Returns the relative
// arrival delay, if it can be computed.
virtual absl::optional<int> PacketArrived(int fs_hz,
@@ -170,7 +176,7 @@
const PacketArrivedInfo& info) = 0;
// Notify the NetEqController that we are currently in muted state.
- // TODO(ivoc): Make pure virtual when downstream is updated.
+ // TODO(bugs.webrtc.org/14270): Make pure virtual when downstream is updated.
virtual void NotifyMutedState() {}
// Returns true if a peak was found.