Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1)

Side by Side Diff: webrtc/modules/audio_coding/audio_network_adaptor/include/audio_network_adaptor.h

Issue 3011623002: Add new ANA stats to GetStats() to count the number of actions taken by each controller. (Closed)
Patch Set: Addressed review comments. Created 3 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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/common_types.h"
14 #include "webrtc/rtc_base/optional.h" 15 #include "webrtc/rtc_base/optional.h"
15 16
16 namespace webrtc { 17 namespace webrtc {
17 18
18 struct AudioEncoderRuntimeConfig { 19 struct AudioEncoderRuntimeConfig {
19 AudioEncoderRuntimeConfig(); 20 AudioEncoderRuntimeConfig();
20 AudioEncoderRuntimeConfig(const AudioEncoderRuntimeConfig& other); 21 AudioEncoderRuntimeConfig(const AudioEncoderRuntimeConfig& other);
21 ~AudioEncoderRuntimeConfig(); 22 ~AudioEncoderRuntimeConfig();
22 rtc::Optional<int> bitrate_bps; 23 rtc::Optional<int> bitrate_bps;
23 rtc::Optional<int> frame_length_ms; 24 rtc::Optional<int> frame_length_ms;
24 // Note: This is what we tell the encoder. It doesn't have to reflect 25 // Note: This is what we tell the encoder. It doesn't have to reflect
25 // the actual NetworkMetrics; it's subject to our decision. 26 // the actual NetworkMetrics; it's subject to our decision.
26 rtc::Optional<float> uplink_packet_loss_fraction; 27 rtc::Optional<float> uplink_packet_loss_fraction;
27 rtc::Optional<bool> enable_fec; 28 rtc::Optional<bool> enable_fec;
28 rtc::Optional<bool> enable_dtx; 29 rtc::Optional<bool> enable_dtx;
29 30
30 // Some encoders can encode fewer channels than the actual input to make 31 // Some encoders can encode fewer channels than the actual input to make
31 // better use of the bandwidth. |num_channels| sets the number of channels 32 // better use of the bandwidth. |num_channels| sets the number of channels
32 // to encode. 33 // to encode.
33 rtc::Optional<size_t> num_channels; 34 rtc::Optional<size_t> num_channels;
34 }; 35 };
35 36
36 // An AudioNetworkAdaptor optimizes the audio experience by suggesting a 37 // An AudioNetworkAdaptor optimizes the audio experience by suggesting a
37 // suitable runtime configuration (bit rate, frame length, FEC, etc.) to the 38 // suitable runtime configuration (bit rate, frame length, FEC, etc.) to the
38 // encoder based on network metrics. 39 // encoder based on network metrics.
39 class AudioNetworkAdaptor { 40 class AudioNetworkAdaptor {
40 public: 41 public:
42 struct AudioNetworkAdaptorStats {
43 AudioNetworkAdaptorStats();
44 AudioNetworkAdaptorStats(const AudioNetworkAdaptorStats&);
45 ~AudioNetworkAdaptorStats();
hbos 2017/09/04 08:49:54 Style-guide thing or can we remove these default c
ivoc 2017/09/04 15:48:03 The optionals made the class "too complex" not to
46 rtc::Optional<int> ana_bitrate_action_counter;
47 rtc::Optional<int> ana_channel_action_counter;
48 rtc::Optional<int> ana_dtx_action_counter;
49 rtc::Optional<int> ana_fec_action_counter;
50 rtc::Optional<int> ana_frame_length_action_counter;
hbos 2017/09/04 08:49:54 Is there a reason for not reusing ANAStats, either
ossu 2017/09/04 11:23:02 I agree we should try to reuse the ANAStats struct
ivoc 2017/09/04 15:48:05 Agreed, removed.
51 };
41 52
42 virtual ~AudioNetworkAdaptor() = default; 53 virtual ~AudioNetworkAdaptor() = default;
43 54
44 virtual void SetUplinkBandwidth(int uplink_bandwidth_bps) = 0; 55 virtual void SetUplinkBandwidth(int uplink_bandwidth_bps) = 0;
45 56
46 virtual void SetUplinkPacketLossFraction( 57 virtual void SetUplinkPacketLossFraction(
47 float uplink_packet_loss_fraction) = 0; 58 float uplink_packet_loss_fraction) = 0;
48 59
49 virtual void SetUplinkRecoverablePacketLossFraction( 60 virtual void SetUplinkRecoverablePacketLossFraction(
50 float uplink_recoverable_packet_loss_fraction) = 0; 61 float uplink_recoverable_packet_loss_fraction) = 0;
51 62
52 virtual void SetRtt(int rtt_ms) = 0; 63 virtual void SetRtt(int rtt_ms) = 0;
53 64
54 virtual void SetTargetAudioBitrate(int target_audio_bitrate_bps) = 0; 65 virtual void SetTargetAudioBitrate(int target_audio_bitrate_bps) = 0;
55 66
56 virtual void SetOverhead(size_t overhead_bytes_per_packet) = 0; 67 virtual void SetOverhead(size_t overhead_bytes_per_packet) = 0;
57 68
58 virtual AudioEncoderRuntimeConfig GetEncoderRuntimeConfig() = 0; 69 virtual AudioEncoderRuntimeConfig GetEncoderRuntimeConfig() = 0;
59 70
60 virtual void StartDebugDump(FILE* file_handle) = 0; 71 virtual void StartDebugDump(FILE* file_handle) = 0;
61 72
62 virtual void StopDebugDump() = 0; 73 virtual void StopDebugDump() = 0;
74
75 virtual ANAStats GetStats() const = 0;
63 }; 76 };
64 77
65 } // namespace webrtc 78 } // namespace webrtc
66 79
67 #endif // WEBRTC_MODULES_AUDIO_CODING_AUDIO_NETWORK_ADAPTOR_INCLUDE_AUDIO_NETWO RK_ADAPTOR_H_ 80 #endif // WEBRTC_MODULES_AUDIO_CODING_AUDIO_NETWORK_ADAPTOR_INCLUDE_AUDIO_NETWO RK_ADAPTOR_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698