minyue | 7610f85 | 2016-09-07 13:51:51 -0700 | [diff] [blame] | 1 | /* |
| 2 | * Copyright (c) 2016 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 | #ifndef MODULES_AUDIO_CODING_AUDIO_NETWORK_ADAPTOR_INCLUDE_AUDIO_NETWORK_ADAPTOR_H_ |
| 12 | #define MODULES_AUDIO_CODING_AUDIO_NETWORK_ADAPTOR_INCLUDE_AUDIO_NETWORK_ADAPTOR_H_ |
minyue | 7610f85 | 2016-09-07 13:51:51 -0700 | [diff] [blame] | 13 | |
Danil Chapovalov | b602123 | 2018-06-19 13:26:36 +0200 | [diff] [blame] | 14 | #include "absl/types/optional.h" |
Mirko Bonadei | 92ea95e | 2017-09-15 06:47:31 +0200 | [diff] [blame] | 15 | #include "api/audio_codecs/audio_encoder.h" |
Mirko Bonadei | 92ea95e | 2017-09-15 06:47:31 +0200 | [diff] [blame] | 16 | #include "modules/audio_coding/audio_network_adaptor/include/audio_network_adaptor_config.h" |
minyue | 7610f85 | 2016-09-07 13:51:51 -0700 | [diff] [blame] | 17 | |
| 18 | namespace webrtc { |
| 19 | |
| 20 | // An AudioNetworkAdaptor optimizes the audio experience by suggesting a |
| 21 | // suitable runtime configuration (bit rate, frame length, FEC, etc.) to the |
| 22 | // encoder based on network metrics. |
| 23 | class AudioNetworkAdaptor { |
| 24 | public: |
minyue | 7610f85 | 2016-09-07 13:51:51 -0700 | [diff] [blame] | 25 | virtual ~AudioNetworkAdaptor() = default; |
| 26 | |
| 27 | virtual void SetUplinkBandwidth(int uplink_bandwidth_bps) = 0; |
| 28 | |
| 29 | virtual void SetUplinkPacketLossFraction( |
| 30 | float uplink_packet_loss_fraction) = 0; |
| 31 | |
minyue | 25f6a39 | 2016-09-22 22:23:20 -0700 | [diff] [blame] | 32 | virtual void SetRtt(int rtt_ms) = 0; |
| 33 | |
minyue | e5e632f | 2016-09-27 12:54:19 -0700 | [diff] [blame] | 34 | virtual void SetTargetAudioBitrate(int target_audio_bitrate_bps) = 0; |
| 35 | |
minyue | c9e80ee | 2016-11-29 13:00:28 -0800 | [diff] [blame] | 36 | virtual void SetOverhead(size_t overhead_bytes_per_packet) = 0; |
| 37 | |
michaelt | cde46b7 | 2017-04-06 05:59:10 -0700 | [diff] [blame] | 38 | virtual AudioEncoderRuntimeConfig GetEncoderRuntimeConfig() = 0; |
minyue | 7610f85 | 2016-09-07 13:51:51 -0700 | [diff] [blame] | 39 | |
| 40 | virtual void StartDebugDump(FILE* file_handle) = 0; |
minyue | 25f6a39 | 2016-09-22 22:23:20 -0700 | [diff] [blame] | 41 | |
| 42 | virtual void StopDebugDump() = 0; |
ivoc | e1198e0 | 2017-09-08 08:13:19 -0700 | [diff] [blame] | 43 | |
| 44 | virtual ANAStats GetStats() const = 0; |
minyue | 7610f85 | 2016-09-07 13:51:51 -0700 | [diff] [blame] | 45 | }; |
| 46 | |
| 47 | } // namespace webrtc |
| 48 | |
Mirko Bonadei | 92ea95e | 2017-09-15 06:47:31 +0200 | [diff] [blame] | 49 | #endif // MODULES_AUDIO_CODING_AUDIO_NETWORK_ADAPTOR_INCLUDE_AUDIO_NETWORK_ADAPTOR_H_ |