Chromium Code Reviews| 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 #include "webrtc/modules/audio_coding/audio_network_adaptor/controller_manager.h " | 11 #include "webrtc/modules/audio_coding/audio_network_adaptor/controller_manager.h " |
| 12 | 12 |
| 13 #include <cmath> | 13 #include <cmath> |
| 14 #include <string> | |
| 14 #include <utility> | 15 #include <utility> |
| 15 | 16 |
| 16 #include "webrtc/base/ignore_wundef.h" | 17 #include "webrtc/base/ignore_wundef.h" |
| 17 #include "webrtc/modules/audio_coding/audio_network_adaptor/bitrate_controller.h " | 18 #include "webrtc/modules/audio_coding/audio_network_adaptor/bitrate_controller.h " |
| 18 #include "webrtc/modules/audio_coding/audio_network_adaptor/channel_controller.h " | 19 #include "webrtc/modules/audio_coding/audio_network_adaptor/channel_controller.h " |
| 19 #include "webrtc/modules/audio_coding/audio_network_adaptor/dtx_controller.h" | 20 #include "webrtc/modules/audio_coding/audio_network_adaptor/dtx_controller.h" |
| 20 #include "webrtc/modules/audio_coding/audio_network_adaptor/fec_controller.h" | 21 #include "webrtc/modules/audio_coding/audio_network_adaptor/fec_controller.h" |
| 21 #include "webrtc/modules/audio_coding/audio_network_adaptor/frame_length_control ler.h" | 22 #include "webrtc/modules/audio_coding/audio_network_adaptor/frame_length_control ler.h" |
| 22 #include "webrtc/system_wrappers/include/clock.h" | 23 #include "webrtc/system_wrappers/include/clock.h" |
| 23 | 24 |
| (...skipping 126 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 150 ControllerManagerImpl::Config::Config(int min_reordering_time_ms, | 151 ControllerManagerImpl::Config::Config(int min_reordering_time_ms, |
| 151 float min_reordering_squared_distance, | 152 float min_reordering_squared_distance, |
| 152 const Clock* clock) | 153 const Clock* clock) |
| 153 : min_reordering_time_ms(min_reordering_time_ms), | 154 : min_reordering_time_ms(min_reordering_time_ms), |
| 154 min_reordering_squared_distance(min_reordering_squared_distance), | 155 min_reordering_squared_distance(min_reordering_squared_distance), |
| 155 clock(clock) {} | 156 clock(clock) {} |
| 156 | 157 |
| 157 ControllerManagerImpl::Config::~Config() = default; | 158 ControllerManagerImpl::Config::~Config() = default; |
| 158 | 159 |
| 159 std::unique_ptr<ControllerManager> ControllerManagerImpl::Create( | 160 std::unique_ptr<ControllerManager> ControllerManagerImpl::Create( |
| 161 #ifdef WEBRTC_AUDIO_NETWORK_ADAPTOR_DEBUG_DUMP | |
| 162 const ProtoString& config_string, | |
|
michaelt
2017/03/16 08:16:25
ProtoString is a very good idea. I would like to u
| |
| 163 #else | |
| 160 const std::string& config_string, | 164 const std::string& config_string, |
| 165 #endif | |
| 161 size_t num_encoder_channels, | 166 size_t num_encoder_channels, |
| 162 rtc::ArrayView<const int> encoder_frame_lengths_ms, | 167 rtc::ArrayView<const int> encoder_frame_lengths_ms, |
| 163 int min_encoder_bitrate_bps, | 168 int min_encoder_bitrate_bps, |
| 164 size_t intial_channels_to_encode, | 169 size_t intial_channels_to_encode, |
| 165 int initial_frame_length_ms, | 170 int initial_frame_length_ms, |
| 166 int initial_bitrate_bps, | 171 int initial_bitrate_bps, |
| 167 bool initial_fec_enabled, | 172 bool initial_fec_enabled, |
| 168 bool initial_dtx_enabled, | 173 bool initial_dtx_enabled, |
| 169 const Clock* clock) { | 174 const Clock* clock) { |
| 170 #ifdef WEBRTC_AUDIO_NETWORK_ADAPTOR_DEBUG_DUMP | 175 #ifdef WEBRTC_AUDIO_NETWORK_ADAPTOR_DEBUG_DUMP |
| (...skipping 173 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 344 NormalizeUplinkBandwidth(scoring_point.uplink_bandwidth_bps) - | 349 NormalizeUplinkBandwidth(scoring_point.uplink_bandwidth_bps) - |
| 345 NormalizeUplinkBandwidth(uplink_bandwidth_bps); | 350 NormalizeUplinkBandwidth(uplink_bandwidth_bps); |
| 346 float diff_normalized_packet_loss = | 351 float diff_normalized_packet_loss = |
| 347 NormalizePacketLossFraction(scoring_point.uplink_packet_loss_fraction) - | 352 NormalizePacketLossFraction(scoring_point.uplink_packet_loss_fraction) - |
| 348 NormalizePacketLossFraction(uplink_packet_loss_fraction); | 353 NormalizePacketLossFraction(uplink_packet_loss_fraction); |
| 349 return std::pow(diff_normalized_bitrate_bps, 2) + | 354 return std::pow(diff_normalized_bitrate_bps, 2) + |
| 350 std::pow(diff_normalized_packet_loss, 2); | 355 std::pow(diff_normalized_packet_loss, 2); |
| 351 } | 356 } |
| 352 | 357 |
| 353 } // namespace webrtc | 358 } // namespace webrtc |
| OLD | NEW |