12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182 |
- #ifndef API_TEST_NETEQ_SIMULATOR_H_
- #define API_TEST_NETEQ_SIMULATOR_H_
- #include <stdint.h>
- #include <map>
- #include <vector>
- namespace webrtc {
- namespace test {
- class NetEqSimulator {
- public:
- virtual ~NetEqSimulator() = default;
- enum class Action { kNormal, kExpand, kAccelerate, kPreemptiveExpand };
-
- struct SimulationStepResult {
- SimulationStepResult();
- SimulationStepResult(const SimulationStepResult& other);
- ~SimulationStepResult();
- bool is_simulation_finished = false;
-
- std::map<Action, int> action_times_ms;
-
-
-
- int64_t simulation_step_ms = 0;
- };
- struct NetEqState {
- NetEqState();
- NetEqState(const NetEqState& other);
- ~NetEqState();
-
- int current_delay_ms = 0;
-
- bool packet_loss_occurred = false;
-
-
- bool packet_buffer_flushed = false;
-
- bool next_packet_available = false;
-
-
- std::vector<int> packet_iat_ms;
-
- int packet_size_ms = 0;
- };
-
-
- virtual int64_t Run() = 0;
-
-
-
- virtual SimulationStepResult RunToNextGetAudio() = 0;
-
-
- virtual void SetNextAction(Action next_operation) = 0;
-
- virtual NetEqState GetNetEqState() = 0;
- };
- }
- }
- #endif
|