blob: 55af23e99af6d73908cb7a3f5b52118faa73d9a3 [file] [log] [blame]
henrik.lundin@webrtc.orgd94659d2013-01-29 12:09:21 +00001/*
2 * Copyright (c) 2012 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
Mirko Bonadei92ea95e2017-09-15 06:47:31 +020011#include "modules/audio_coding/neteq/include/neteq.h"
henrik.lundin@webrtc.orgd94659d2013-01-29 12:09:21 +000012
kwiberg84be5112016-04-27 01:19:58 -070013#include <memory>
Henrik Lundin905495c2015-05-25 16:58:41 +020014
Mirko Bonadei92ea95e2017-09-15 06:47:31 +020015#include "modules/audio_coding/neteq/neteq_impl.h"
Jonas Olsson3531ee12018-04-04 11:21:27 +020016#include "rtc_base/strings/string_builder.h"
henrik.lundin@webrtc.orgd94659d2013-01-29 12:09:21 +000017
18namespace webrtc {
19
Karl Wiberg08126342018-03-20 19:18:55 +010020NetEq::Config::Config() = default;
21NetEq::Config::Config(const Config&) = default;
22NetEq::Config::Config(Config&&) = default;
23NetEq::Config::~Config() = default;
24NetEq::Config& NetEq::Config::operator=(const Config&) = default;
25NetEq::Config& NetEq::Config::operator=(Config&&) = default;
26
Henrik Lundin905495c2015-05-25 16:58:41 +020027std::string NetEq::Config::ToString() const {
Jonas Olsson3531ee12018-04-04 11:21:27 +020028 char buf[1024];
29 rtc::SimpleStringBuilder ss(buf);
Yves Gerey665174f2018-06-19 15:03:05 +020030 ss << "sample_rate_hz=" << sample_rate_hz << ", enable_post_decode_vad="
henrik.lundin9bc26672015-11-02 03:25:57 -080031 << (enable_post_decode_vad ? "true" : "false")
Henrik Lundin905495c2015-05-25 16:58:41 +020032 << ", max_packets_in_buffer=" << max_packets_in_buffer
Yves Gerey665174f2018-06-19 15:03:05 +020033 << ", playout_mode=" << playout_mode << ", enable_fast_accelerate="
34 << (enable_fast_accelerate ? " true" : "false")
35 << ", enable_muted_state=" << (enable_muted_state ? " true" : "false");
Henrik Lundin905495c2015-05-25 16:58:41 +020036 return ss.str();
37}
38
henrik.lundin@webrtc.orgd94659d2013-01-29 12:09:21 +000039// Creates all classes needed and inject them into a new NetEqImpl object.
40// Return the new object.
ossue3525782016-05-25 07:37:43 -070041NetEq* NetEq::Create(
42 const NetEq::Config& config,
43 const rtc::scoped_refptr<AudioDecoderFactory>& decoder_factory) {
44 return new NetEqImpl(config,
45 NetEqImpl::Dependencies(config, decoder_factory));
henrik.lundin@webrtc.orgd94659d2013-01-29 12:09:21 +000046}
47
48} // namespace webrtc