1 /* 2 * Copyright (c) 2020 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 11 #ifndef MODULES_AUDIO_CODING_AUDIO_NETWORK_ADAPTOR_FRAME_LENGTH_CONTROLLER_V2_H_ 12 #define MODULES_AUDIO_CODING_AUDIO_NETWORK_ADAPTOR_FRAME_LENGTH_CONTROLLER_V2_H_ 13 14 #include <vector> 15 16 #include "absl/types/optional.h" 17 #include "modules/audio_coding/audio_network_adaptor/controller.h" 18 #include "modules/audio_coding/audio_network_adaptor/include/audio_network_adaptor.h" 19 20 namespace webrtc { 21 22 class FrameLengthControllerV2 final : public Controller { 23 public: 24 FrameLengthControllerV2(rtc::ArrayView<const int> encoder_frame_lengths_ms, 25 int min_payload_bitrate_bps, 26 bool use_slow_adaptation); 27 28 void UpdateNetworkMetrics(const NetworkMetrics& network_metrics) override; 29 30 void MakeDecision(AudioEncoderRuntimeConfig* config) override; 31 32 private: 33 std::vector<int> encoder_frame_lengths_ms_; 34 const int min_payload_bitrate_bps_; 35 const bool use_slow_adaptation_; 36 37 absl::optional<int> uplink_bandwidth_bps_; 38 absl::optional<int> target_bitrate_bps_; 39 absl::optional<int> overhead_bytes_per_packet_; 40 }; 41 42 } // namespace webrtc 43 44 #endif // MODULES_AUDIO_CODING_AUDIO_NETWORK_ADAPTOR_FRAME_LENGTH_CONTROLLER_V2_H_ 45