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 | #include "api/test/neteq_simulator_factory.h" |
| 12 | |
| 13 | #include "absl/memory/memory.h" |
| 14 | #include "modules/audio_coding/neteq/tools/neteq_test_factory.h" |
Ivo Creusen | f81b0f1 | 2018-09-11 10:30:58 +0200 | [diff] [blame^] | 15 | #include "rtc_base/checks.h" |
| 16 | #include "rtc_base/flags.h" |
Ivo Creusen | 55de08e | 2018-09-03 11:49:27 +0200 | [diff] [blame] | 17 | |
| 18 | namespace webrtc { |
| 19 | namespace test { |
| 20 | |
| 21 | NetEqSimulatorFactory::NetEqSimulatorFactory() |
| 22 | : factory_(absl::make_unique<NetEqTestFactory>()) {} |
| 23 | |
| 24 | NetEqSimulatorFactory::~NetEqSimulatorFactory() = default; |
| 25 | |
| 26 | std::unique_ptr<NetEqSimulator> NetEqSimulatorFactory::CreateSimulator( |
| 27 | int argc, |
| 28 | char* argv[]) { |
Ivo Creusen | f81b0f1 | 2018-09-11 10:30:58 +0200 | [diff] [blame^] | 29 | RTC_CHECK(!rtc::FlagList::SetFlagsFromCommandLine(&argc, argv, true)) |
| 30 | << "Error while parsing command-line flags"; |
| 31 | RTC_CHECK_EQ(argc, 3) << "Wrong number of input arguments. Expected 3, got " |
| 32 | << argc; |
| 33 | return factory_->InitializeTest(argv[1], argv[2]); |
Ivo Creusen | 55de08e | 2018-09-03 11:49:27 +0200 | [diff] [blame] | 34 | } |
| 35 | |
| 36 | } // namespace test |
| 37 | } // namespace webrtc |