blob: 88ed158a450bc598d2f45b0bbff5604295288ee6 [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#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 Creusenf81b0f12018-09-11 10:30:58 +020015#include "rtc_base/checks.h"
16#include "rtc_base/flags.h"
Ivo Creusen55de08e2018-09-03 11:49:27 +020017
18namespace webrtc {
19namespace test {
20
21NetEqSimulatorFactory::NetEqSimulatorFactory()
22 : factory_(absl::make_unique<NetEqTestFactory>()) {}
23
24NetEqSimulatorFactory::~NetEqSimulatorFactory() = default;
25
26std::unique_ptr<NetEqSimulator> NetEqSimulatorFactory::CreateSimulator(
27 int argc,
28 char* argv[]) {
Ivo Creusenf81b0f12018-09-11 10:30:58 +020029 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 Creusen55de08e2018-09-03 11:49:27 +020034}
35
36} // namespace test
37} // namespace webrtc