OLD | NEW |
1 /* | 1 /* |
2 * Copyright (c) 2016 The WebRTC project authors. All Rights Reserved. | 2 * Copyright (c) 2016 The WebRTC project authors. All Rights Reserved. |
3 * | 3 * |
4 * Use of this source code is governed by a BSD-style license | 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 | 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 | 6 * tree. An additional intellectual property rights grant can be found |
7 * in the file PATENTS. All contributing project authors may | 7 * in the file PATENTS. All contributing project authors may |
8 * be found in the AUTHORS file in the root of the source tree. | 8 * be found in the AUTHORS file in the root of the source tree. |
9 */ | 9 */ |
10 | 10 |
11 #ifndef WEBRTC_MODULES_AUDIO_CODING_AUDIO_NETWORK_ADAPTOR_INCLUDE_AUDIO_NETWORK_
ADAPTOR_H_ | 11 #ifndef WEBRTC_MODULES_AUDIO_CODING_AUDIO_NETWORK_ADAPTOR_INCLUDE_AUDIO_NETWORK_
ADAPTOR_H_ |
12 #define WEBRTC_MODULES_AUDIO_CODING_AUDIO_NETWORK_ADAPTOR_INCLUDE_AUDIO_NETWORK_
ADAPTOR_H_ | 12 #define WEBRTC_MODULES_AUDIO_CODING_AUDIO_NETWORK_ADAPTOR_INCLUDE_AUDIO_NETWORK_
ADAPTOR_H_ |
13 | 13 |
14 #include "webrtc/api/audio_codecs/audio_encoder.h" | 14 #include "webrtc/api/audio_codecs/audio_encoder.h" |
15 #include "webrtc/api/optional.h" | 15 #include "webrtc/api/optional.h" |
| 16 #include "webrtc/modules/audio_coding/audio_network_adaptor/include/audio_networ
k_adaptor_config.h" |
16 | 17 |
17 namespace webrtc { | 18 namespace webrtc { |
18 | 19 |
19 struct AudioEncoderRuntimeConfig { | |
20 AudioEncoderRuntimeConfig(); | |
21 AudioEncoderRuntimeConfig(const AudioEncoderRuntimeConfig& other); | |
22 ~AudioEncoderRuntimeConfig(); | |
23 rtc::Optional<int> bitrate_bps; | |
24 rtc::Optional<int> frame_length_ms; | |
25 // Note: This is what we tell the encoder. It doesn't have to reflect | |
26 // the actual NetworkMetrics; it's subject to our decision. | |
27 rtc::Optional<float> uplink_packet_loss_fraction; | |
28 rtc::Optional<bool> enable_fec; | |
29 rtc::Optional<bool> enable_dtx; | |
30 | |
31 // Some encoders can encode fewer channels than the actual input to make | |
32 // better use of the bandwidth. |num_channels| sets the number of channels | |
33 // to encode. | |
34 rtc::Optional<size_t> num_channels; | |
35 }; | |
36 | |
37 // An AudioNetworkAdaptor optimizes the audio experience by suggesting a | 20 // An AudioNetworkAdaptor optimizes the audio experience by suggesting a |
38 // suitable runtime configuration (bit rate, frame length, FEC, etc.) to the | 21 // suitable runtime configuration (bit rate, frame length, FEC, etc.) to the |
39 // encoder based on network metrics. | 22 // encoder based on network metrics. |
40 class AudioNetworkAdaptor { | 23 class AudioNetworkAdaptor { |
41 public: | 24 public: |
42 virtual ~AudioNetworkAdaptor() = default; | 25 virtual ~AudioNetworkAdaptor() = default; |
43 | 26 |
44 virtual void SetUplinkBandwidth(int uplink_bandwidth_bps) = 0; | 27 virtual void SetUplinkBandwidth(int uplink_bandwidth_bps) = 0; |
45 | 28 |
46 virtual void SetUplinkPacketLossFraction( | 29 virtual void SetUplinkPacketLossFraction( |
(...skipping 13 matching lines...) Expand all Loading... |
60 virtual void StartDebugDump(FILE* file_handle) = 0; | 43 virtual void StartDebugDump(FILE* file_handle) = 0; |
61 | 44 |
62 virtual void StopDebugDump() = 0; | 45 virtual void StopDebugDump() = 0; |
63 | 46 |
64 virtual ANAStats GetStats() const = 0; | 47 virtual ANAStats GetStats() const = 0; |
65 }; | 48 }; |
66 | 49 |
67 } // namespace webrtc | 50 } // namespace webrtc |
68 | 51 |
69 #endif // WEBRTC_MODULES_AUDIO_CODING_AUDIO_NETWORK_ADAPTOR_INCLUDE_AUDIO_NETWO
RK_ADAPTOR_H_ | 52 #endif // WEBRTC_MODULES_AUDIO_CODING_AUDIO_NETWORK_ADAPTOR_INCLUDE_AUDIO_NETWO
RK_ADAPTOR_H_ |
OLD | NEW |