blob: 0a36cb2215140b8f21fab2c20acd1a965b29d307 [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
Mirko Bonadei92ea95e2017-09-15 06:47:31 +020013#include "modules/audio_coding/neteq/neteq_impl.h"
Jonas Olsson3531ee12018-04-04 11:21:27 +020014#include "rtc_base/strings/string_builder.h"
henrik.lundin@webrtc.orgd94659d2013-01-29 12:09:21 +000015
16namespace webrtc {
17
Karl Wiberg08126342018-03-20 19:18:55 +010018NetEq::Config::Config() = default;
19NetEq::Config::Config(const Config&) = default;
20NetEq::Config::Config(Config&&) = default;
21NetEq::Config::~Config() = default;
22NetEq::Config& NetEq::Config::operator=(const Config&) = default;
23NetEq::Config& NetEq::Config::operator=(Config&&) = default;
24
Henrik Lundin905495c2015-05-25 16:58:41 +020025std::string NetEq::Config::ToString() const {
Jonas Olsson3531ee12018-04-04 11:21:27 +020026 char buf[1024];
27 rtc::SimpleStringBuilder ss(buf);
Yves Gerey665174f2018-06-19 15:03:05 +020028 ss << "sample_rate_hz=" << sample_rate_hz << ", enable_post_decode_vad="
henrik.lundin9bc26672015-11-02 03:25:57 -080029 << (enable_post_decode_vad ? "true" : "false")
Henrik Lundin905495c2015-05-25 16:58:41 +020030 << ", max_packets_in_buffer=" << max_packets_in_buffer
Jakob Ivarsson39b934b2019-01-10 10:28:23 +010031 << ", min_delay_ms=" << min_delay_ms << ", enable_fast_accelerate="
32 << (enable_fast_accelerate ? "true" : "false")
33 << ", enable_muted_state=" << (enable_muted_state ? "true" : "false")
34 << ", enable_rtx_handling=" << (enable_rtx_handling ? "true" : "false");
Henrik Lundin905495c2015-05-25 16:58:41 +020035 return ss.str();
36}
37
henrik.lundin@webrtc.orgd94659d2013-01-29 12:09:21 +000038// Creates all classes needed and inject them into a new NetEqImpl object.
39// Return the new object.
ossue3525782016-05-25 07:37:43 -070040NetEq* NetEq::Create(
41 const NetEq::Config& config,
Chen Xing99739332019-07-24 14:53:25 +020042 Clock* clock,
ossue3525782016-05-25 07:37:43 -070043 const rtc::scoped_refptr<AudioDecoderFactory>& decoder_factory) {
44 return new NetEqImpl(config,
Chen Xing99739332019-07-24 14:53:25 +020045 NetEqImpl::Dependencies(config, clock, decoder_factory));
henrik.lundin@webrtc.orgd94659d2013-01-29 12:09:21 +000046}
47
48} // namespace webrtc