Ivo Creusen | 55de08e | 2018-09-03 11:49:27 +0200 | [diff] [blame] | 1 | /* |
| 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 Creusen | 5ec6156 | 2019-03-20 10:52:18 +0100 | [diff] [blame^] | 15 | #include <string> |
Ivo Creusen | 55de08e | 2018-09-03 11:49:27 +0200 | [diff] [blame] | 16 | |
Ivo Creusen | 5ec6156 | 2019-03-20 10:52:18 +0100 | [diff] [blame^] | 17 | #include "absl/strings/string_view.h" |
Ivo Creusen | 55de08e | 2018-09-03 11:49:27 +0200 | [diff] [blame] | 18 | #include "api/test/neteq_simulator.h" |
| 19 | |
| 20 | namespace webrtc { |
| 21 | namespace test { |
| 22 | |
| 23 | class NetEqTestFactory; |
| 24 | |
| 25 | class NetEqSimulatorFactory { |
| 26 | public: |
| 27 | NetEqSimulatorFactory(); |
| 28 | ~NetEqSimulatorFactory(); |
Ivo Creusen | 5ec6156 | 2019-03-20 10:52:18 +0100 | [diff] [blame^] | 29 | struct Config { |
| 30 | int max_nr_packets_in_buffer = 0; |
| 31 | }; |
Ivo Creusen | 55de08e | 2018-09-03 11:49:27 +0200 | [diff] [blame] | 32 | // This function takes the same arguments as the neteq_rtpplay utility. |
| 33 | std::unique_ptr<NetEqSimulator> CreateSimulator(int argc, char* argv[]); |
Ivo Creusen | 5ec6156 | 2019-03-20 10:52:18 +0100 | [diff] [blame^] | 34 | 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 Creusen | 55de08e | 2018-09-03 11:49:27 +0200 | [diff] [blame] | 43 | |
| 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_ |