Add more useful information to NetEqState and implement action_times_ms
This CL adds more useful information to NetEqState, and implements setting action_times_ms, which can be used to get a better idea of what actually happened during a timestep.
Bug: webrtc:9667
Change-Id: I789a3e1ad852066fdf4e9b4c96b8fb6033dacb27
Reviewed-on: https://webrtc-review.googlesource.com/98163
Reviewed-by: Minyue Li <minyue@webrtc.org>
Reviewed-by: Karl Wiberg <kwiberg@webrtc.org>
Commit-Queue: Ivo Creusen <ivoc@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#24643}
diff --git a/api/test/neteq_simulator.h b/api/test/neteq_simulator.h
index 8f1cd81..d7dbb1e 100644
--- a/api/test/neteq_simulator.h
+++ b/api/test/neteq_simulator.h
@@ -13,6 +13,7 @@
#include <stdint.h>
#include <map>
+#include <vector>
namespace webrtc {
namespace test {
@@ -39,9 +40,17 @@
};
struct NetEqState {
+ NetEqState();
+ NetEqState(const NetEqState& other);
+ NetEqState(NetEqState&& other);
+ ~NetEqState();
// The sum of the packet buffer and sync buffer delay.
int current_delay_ms = 0;
- // TODO(ivoc): Expand this struct with more useful metrics.
+ // An indicator that packet loss occurred since the last GetAudio event.
+ bool packet_loss_occurred = false;
+ // The inter-arrival times in ms of the packets that have arrived since the
+ // last GetAudio event.
+ std::vector<int> packet_iat_ms;
};
// Runs the simulation until we hit the next GetAudio event. If the simulation