henrik.lundin@webrtc.org | d94659d | 2013-01-29 12:09:21 +0000 | [diff] [blame] | 1 | /* |
| 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 Bonadei | 92ea95e | 2017-09-15 06:47:31 +0200 | [diff] [blame] | 11 | #include "modules/audio_coding/neteq/include/neteq.h" |
henrik.lundin@webrtc.org | d94659d | 2013-01-29 12:09:21 +0000 | [diff] [blame] | 12 | |
kwiberg | 84be511 | 2016-04-27 01:19:58 -0700 | [diff] [blame] | 13 | #include <memory> |
Henrik Lundin | 905495c | 2015-05-25 16:58:41 +0200 | [diff] [blame] | 14 | |
Mirko Bonadei | 92ea95e | 2017-09-15 06:47:31 +0200 | [diff] [blame] | 15 | #include "modules/audio_coding/neteq/neteq_impl.h" |
Jonas Olsson | 3531ee1 | 2018-04-04 11:21:27 +0200 | [diff] [blame] | 16 | #include "rtc_base/strings/string_builder.h" |
henrik.lundin@webrtc.org | d94659d | 2013-01-29 12:09:21 +0000 | [diff] [blame] | 17 | |
| 18 | namespace webrtc { |
| 19 | |
Karl Wiberg | 0812634 | 2018-03-20 19:18:55 +0100 | [diff] [blame] | 20 | NetEq::Config::Config() = default; |
| 21 | NetEq::Config::Config(const Config&) = default; |
| 22 | NetEq::Config::Config(Config&&) = default; |
| 23 | NetEq::Config::~Config() = default; |
| 24 | NetEq::Config& NetEq::Config::operator=(const Config&) = default; |
| 25 | NetEq::Config& NetEq::Config::operator=(Config&&) = default; |
| 26 | |
Henrik Lundin | 905495c | 2015-05-25 16:58:41 +0200 | [diff] [blame] | 27 | std::string NetEq::Config::ToString() const { |
Jonas Olsson | 3531ee1 | 2018-04-04 11:21:27 +0200 | [diff] [blame] | 28 | char buf[1024]; |
| 29 | rtc::SimpleStringBuilder ss(buf); |
Yves Gerey | 665174f | 2018-06-19 15:03:05 +0200 | [diff] [blame^] | 30 | ss << "sample_rate_hz=" << sample_rate_hz << ", enable_post_decode_vad=" |
henrik.lundin | 9bc2667 | 2015-11-02 03:25:57 -0800 | [diff] [blame] | 31 | << (enable_post_decode_vad ? "true" : "false") |
Henrik Lundin | 905495c | 2015-05-25 16:58:41 +0200 | [diff] [blame] | 32 | << ", max_packets_in_buffer=" << max_packets_in_buffer |
Yves Gerey | 665174f | 2018-06-19 15:03:05 +0200 | [diff] [blame^] | 33 | << ", playout_mode=" << playout_mode << ", enable_fast_accelerate=" |
| 34 | << (enable_fast_accelerate ? " true" : "false") |
| 35 | << ", enable_muted_state=" << (enable_muted_state ? " true" : "false"); |
Henrik Lundin | 905495c | 2015-05-25 16:58:41 +0200 | [diff] [blame] | 36 | return ss.str(); |
| 37 | } |
| 38 | |
henrik.lundin@webrtc.org | d94659d | 2013-01-29 12:09:21 +0000 | [diff] [blame] | 39 | // Creates all classes needed and inject them into a new NetEqImpl object. |
| 40 | // Return the new object. |
ossu | e352578 | 2016-05-25 07:37:43 -0700 | [diff] [blame] | 41 | NetEq* 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.org | d94659d | 2013-01-29 12:09:21 +0000 | [diff] [blame] | 46 | } |
| 47 | |
| 48 | } // namespace webrtc |