blob: 346ed5db1a28c892891f9c39a4562b1362e6fac3 [file] [log] [blame]
minyue7610f852016-09-07 13:51:51 -07001/*
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 Bonadei92ea95e2017-09-15 06:47:31 +020011#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_
minyue7610f852016-09-07 13:51:51 -070013
Danil Chapovalovb6021232018-06-19 13:26:36 +020014#include "absl/types/optional.h"
Mirko Bonadei92ea95e2017-09-15 06:47:31 +020015#include "api/audio_codecs/audio_encoder.h"
Mirko Bonadei92ea95e2017-09-15 06:47:31 +020016#include "modules/audio_coding/audio_network_adaptor/include/audio_network_adaptor_config.h"
minyue7610f852016-09-07 13:51:51 -070017
18namespace 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.
23class AudioNetworkAdaptor {
24 public:
minyue7610f852016-09-07 13:51:51 -070025 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
minyue25f6a392016-09-22 22:23:20 -070032 virtual void SetRtt(int rtt_ms) = 0;
33
minyuee5e632f2016-09-27 12:54:19 -070034 virtual void SetTargetAudioBitrate(int target_audio_bitrate_bps) = 0;
35
minyuec9e80ee2016-11-29 13:00:28 -080036 virtual void SetOverhead(size_t overhead_bytes_per_packet) = 0;
37
michaeltcde46b72017-04-06 05:59:10 -070038 virtual AudioEncoderRuntimeConfig GetEncoderRuntimeConfig() = 0;
minyue7610f852016-09-07 13:51:51 -070039
40 virtual void StartDebugDump(FILE* file_handle) = 0;
minyue25f6a392016-09-22 22:23:20 -070041
42 virtual void StopDebugDump() = 0;
ivoce1198e02017-09-08 08:13:19 -070043
44 virtual ANAStats GetStats() const = 0;
minyue7610f852016-09-07 13:51:51 -070045};
46
47} // namespace webrtc
48
Mirko Bonadei92ea95e2017-09-15 06:47:31 +020049#endif // MODULES_AUDIO_CODING_AUDIO_NETWORK_ADAPTOR_INCLUDE_AUDIO_NETWORK_ADAPTOR_H_