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 | |
Henrik Kjellander | 7464089 | 2015-10-29 11:31:02 +0100 | [diff] [blame] | 11 | #include "webrtc/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 | #include <sstream> |
| 15 | |
henrik.lundin@webrtc.org | 9c55f0f | 2014-06-09 08:10:28 +0000 | [diff] [blame] | 16 | #include "webrtc/modules/audio_coding/neteq/neteq_impl.h" |
henrik.lundin@webrtc.org | d94659d | 2013-01-29 12:09:21 +0000 | [diff] [blame] | 17 | |
| 18 | namespace webrtc { |
| 19 | |
Henrik Lundin | 905495c | 2015-05-25 16:58:41 +0200 | [diff] [blame] | 20 | std::string NetEq::Config::ToString() const { |
| 21 | std::stringstream ss; |
flim | de770dd | 2017-01-06 09:49:47 -0800 | [diff] [blame] | 22 | ss << "sample_rate_hz=" << sample_rate_hz |
henrik.lundin | 9bc2667 | 2015-11-02 03:25:57 -0800 | [diff] [blame] | 23 | << ", enable_post_decode_vad=" |
| 24 | << (enable_post_decode_vad ? "true" : "false") |
Henrik Lundin | 905495c | 2015-05-25 16:58:41 +0200 | [diff] [blame] | 25 | << ", max_packets_in_buffer=" << max_packets_in_buffer |
| 26 | << ", background_noise_mode=" << background_noise_mode |
Henrik Lundin | cf808d2 | 2015-05-27 14:33:29 +0200 | [diff] [blame] | 27 | << ", playout_mode=" << playout_mode |
henrik.lundin | 7a92681 | 2016-05-12 13:51:28 -0700 | [diff] [blame] | 28 | << ", enable_fast_accelerate=" |
| 29 | << (enable_fast_accelerate ? " true": "false") |
| 30 | << ", enable_muted_state=" << (enable_muted_state ? " true": "false"); |
Henrik Lundin | 905495c | 2015-05-25 16:58:41 +0200 | [diff] [blame] | 31 | return ss.str(); |
| 32 | } |
| 33 | |
henrik.lundin@webrtc.org | d94659d | 2013-01-29 12:09:21 +0000 | [diff] [blame] | 34 | // Creates all classes needed and inject them into a new NetEqImpl object. |
| 35 | // Return the new object. |
ossu | e352578 | 2016-05-25 07:37:43 -0700 | [diff] [blame] | 36 | NetEq* NetEq::Create( |
| 37 | const NetEq::Config& config, |
| 38 | const rtc::scoped_refptr<AudioDecoderFactory>& decoder_factory) { |
| 39 | return new NetEqImpl(config, |
| 40 | NetEqImpl::Dependencies(config, decoder_factory)); |
henrik.lundin@webrtc.org | d94659d | 2013-01-29 12:09:21 +0000 | [diff] [blame] | 41 | } |
| 42 | |
| 43 | } // namespace webrtc |