blob: 245162fd234fefd874fd019adaff30619e86287d [file] [log] [blame]
Ivo Creusen55de08e2018-09-03 11:49:27 +02001/*
2 * Copyright (c) 2018 The WebRTC project authors. All Rights Reserved.
3 *
4 * Use of this source code is governed by a BSD-style license
5 * that can be found in the LICENSE file in the root of the source
6 * tree. An additional intellectual property rights grant can be found
7 * in the file PATENTS. All contributing project authors may
8 * be found in the AUTHORS file in the root of the source tree.
9 */
10
11#ifndef API_TEST_NETEQ_SIMULATOR_FACTORY_H_
12#define API_TEST_NETEQ_SIMULATOR_FACTORY_H_
13
14#include <memory>
Ivo Creusen5ec61562019-03-20 10:52:18 +010015#include <string>
Ivo Creusen55de08e2018-09-03 11:49:27 +020016
Ivo Creusen5ec61562019-03-20 10:52:18 +010017#include "absl/strings/string_view.h"
Ivo Creusen55de08e2018-09-03 11:49:27 +020018#include "api/test/neteq_simulator.h"
19
20namespace webrtc {
21namespace test {
22
23class NetEqTestFactory;
24
25class NetEqSimulatorFactory {
26 public:
27 NetEqSimulatorFactory();
28 ~NetEqSimulatorFactory();
Ivo Creusen5ec61562019-03-20 10:52:18 +010029 struct Config {
30 int max_nr_packets_in_buffer = 0;
31 };
Ivo Creusen55de08e2018-09-03 11:49:27 +020032 // This function takes the same arguments as the neteq_rtpplay utility.
33 std::unique_ptr<NetEqSimulator> CreateSimulator(int argc, char* argv[]);
Ivo Creusen5ec61562019-03-20 10:52:18 +010034 std::unique_ptr<NetEqSimulator> CreateSimulatorFromFile(
35 absl::string_view event_log_filename,
36 absl::string_view replacement_audio_filename,
37 Config simulation_config);
38 // The same as above, but pass the file contents as a string.
39 std::unique_ptr<NetEqSimulator> CreateSimulatorFromString(
40 absl::string_view event_log_file_contents,
41 absl::string_view replacement_audio_file,
42 Config simulation_config);
Ivo Creusen55de08e2018-09-03 11:49:27 +020043
44 private:
45 std::unique_ptr<NetEqTestFactory> factory_;
46};
47
48} // namespace test
49} // namespace webrtc
50
51#endif // API_TEST_NETEQ_SIMULATOR_FACTORY_H_