Split BandwidthUsage from network_state_predictor.h

Bug: None
Change-Id: Ie1d0c1fd4b32fc5f9e4252bfe0fd2ca1412bd594
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/351002
Reviewed-by: Per Kjellander <perkj@webrtc.org>
Commit-Queue: Björn Terelius <terelius@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#42376}
This commit is contained in:
Björn Terelius 2024-05-24 11:40:52 +02:00 committed by WebRTC LUCI CQ
parent 783587e415
commit 0596503938
23 changed files with 57 additions and 29 deletions

View File

@ -897,6 +897,7 @@ rtc_source_set("fec_controller_api") {
rtc_source_set("network_state_predictor_api") { rtc_source_set("network_state_predictor_api") {
visibility = [ "*" ] visibility = [ "*" ]
sources = [ "network_state_predictor.h" ] sources = [ "network_state_predictor.h" ]
deps = [ "transport:bandwidth_usage" ]
} }
rtc_source_set("array_view") { rtc_source_set("array_view") {

View File

@ -14,14 +14,9 @@
#include <memory> #include <memory>
#include <vector> #include <vector>
namespace webrtc { #include "api/transport/bandwidth_usage.h"
enum class BandwidthUsage { namespace webrtc {
kBwNormal = 0,
kBwUnderusing = 1,
kBwOverusing = 2,
kLast
};
// TODO(yinwa): work in progress. API in class NetworkStatePredictor should not // TODO(yinwa): work in progress. API in class NetworkStatePredictor should not
// be used by other users until this comment is removed. // be used by other users until this comment is removed.

View File

@ -20,6 +20,11 @@ rtc_library("bitrate_settings") {
] ]
} }
rtc_source_set("bandwidth_usage") {
visibility = [ "*" ]
sources = [ "bandwidth_usage.h" ]
}
rtc_library("bandwidth_estimation_settings") { rtc_library("bandwidth_estimation_settings") {
visibility = [ "*" ] visibility = [ "*" ]
sources = [ "bandwidth_estimation_settings.h" ] sources = [ "bandwidth_estimation_settings.h" ]

View File

@ -0,0 +1,25 @@
/*
* Copyright (c) 2024 The WebRTC project authors. All Rights Reserved.
*
* Use of this source code is governed by a BSD-style license
* that can be found in the LICENSE file in the root of the source
* tree. An additional intellectual property rights grant can be found
* in the file PATENTS. All contributing project authors may
* be found in the AUTHORS file in the root of the source tree.
*/
#ifndef API_TRANSPORT_BANDWIDTH_USAGE_H_
#define API_TRANSPORT_BANDWIDTH_USAGE_H_
namespace webrtc {
enum class BandwidthUsage {
kBwNormal = 0,
kBwUnderusing = 1,
kBwOverusing = 2,
kLast
};
} // namespace webrtc
#endif // API_TRANSPORT_BANDWIDTH_USAGE_H_

View File

@ -160,8 +160,8 @@ rtc_library("rtc_event_bwe") {
deps = [ deps = [
":rtc_event_field", ":rtc_event_field",
"../api:network_state_predictor_api",
"../api/rtc_event_log", "../api/rtc_event_log",
"../api/transport:bandwidth_usage",
"../api/units:data_rate", "../api/units:data_rate",
"../api/units:timestamp", "../api/units:timestamp",
"//third_party/abseil-cpp/absl/memory", "//third_party/abseil-cpp/absl/memory",
@ -363,7 +363,7 @@ rtc_library("rtc_event_log_impl_encoder") {
":rtc_event_video", ":rtc_event_video",
":rtc_stream_config", ":rtc_stream_config",
"../api:array_view", "../api:array_view",
"../api:network_state_predictor_api", "../api/transport:bandwidth_usage",
"../modules/audio_coding:audio_network_adaptor", "../modules/audio_coding:audio_network_adaptor",
"../modules/rtp_rtcp:rtp_rtcp_format", "../modules/rtp_rtcp:rtp_rtcp_format",
] ]
@ -506,10 +506,10 @@ if (rtc_enable_protobuf) {
":rtc_event_video", ":rtc_event_video",
":rtc_stream_config", ":rtc_stream_config",
"../api:function_view", "../api:function_view",
"../api:network_state_predictor_api",
"../api:rtp_headers", "../api:rtp_headers",
"../api:rtp_parameters", "../api:rtp_parameters",
"../api/rtc_event_log", "../api/rtc_event_log",
"../api/transport:bandwidth_usage",
"../api/units:data_rate", "../api/units:data_rate",
"../api/units:time_delta", "../api/units:time_delta",
"../api/units:timestamp", "../api/units:timestamp",
@ -575,7 +575,6 @@ if (rtc_enable_protobuf) {
":rtc_stream_config", ":rtc_stream_config",
"../api:array_view", "../api:array_view",
"../api:field_trials_view", "../api:field_trials_view",
"../api:network_state_predictor_api",
"../api:rtc_event_log_output_file", "../api:rtc_event_log_output_file",
"../api:rtp_headers", "../api:rtp_headers",
"../api:rtp_parameters", "../api:rtp_parameters",
@ -583,6 +582,7 @@ if (rtc_enable_protobuf) {
"../api/environment:environment_factory", "../api/environment:environment_factory",
"../api/rtc_event_log", "../api/rtc_event_log",
"../api/rtc_event_log:rtc_event_log_factory", "../api/rtc_event_log:rtc_event_log_factory",
"../api/transport:bandwidth_usage",
"../api/units:time_delta", "../api/units:time_delta",
"../api/units:timestamp", "../api/units:timestamp",
"../call", "../call",

View File

@ -16,9 +16,9 @@
#include "absl/types/optional.h" #include "absl/types/optional.h"
#include "api/array_view.h" #include "api/array_view.h"
#include "api/network_state_predictor.h"
#include "api/rtp_headers.h" #include "api/rtp_headers.h"
#include "api/rtp_parameters.h" #include "api/rtp_parameters.h"
#include "api/transport/bandwidth_usage.h"
#include "api/transport/network_types.h" #include "api/transport/network_types.h"
#include "logging/rtc_event_log/events/rtc_event_alr_state.h" #include "logging/rtc_event_log/events/rtc_event_alr_state.h"
#include "logging/rtc_event_log/events/rtc_event_audio_network_adaptation.h" #include "logging/rtc_event_log/events/rtc_event_audio_network_adaptation.h"

View File

@ -15,7 +15,7 @@
#include "absl/types/optional.h" #include "absl/types/optional.h"
#include "api/array_view.h" #include "api/array_view.h"
#include "api/field_trials_view.h" #include "api/field_trials_view.h"
#include "api/network_state_predictor.h" #include "api/transport/bandwidth_usage.h"
#include "logging/rtc_event_log/dependency_descriptor_encoder_decoder.h" #include "logging/rtc_event_log/dependency_descriptor_encoder_decoder.h"
#include "logging/rtc_event_log/encoder/blob_encoding.h" #include "logging/rtc_event_log/encoder/blob_encoding.h"
#include "logging/rtc_event_log/encoder/delta_encoding.h" #include "logging/rtc_event_log/encoder/delta_encoding.h"

View File

@ -11,7 +11,7 @@
#include "logging/rtc_event_log/events/rtc_event_bwe_update_delay_based.h" #include "logging/rtc_event_log/events/rtc_event_bwe_update_delay_based.h"
#include "absl/memory/memory.h" #include "absl/memory/memory.h"
#include "api/network_state_predictor.h" #include "api/transport/bandwidth_usage.h"
namespace webrtc { namespace webrtc {

View File

@ -19,8 +19,8 @@
#include <vector> #include <vector>
#include "absl/strings/string_view.h" #include "absl/strings/string_view.h"
#include "api/network_state_predictor.h"
#include "api/rtc_event_log/rtc_event.h" #include "api/rtc_event_log/rtc_event.h"
#include "api/transport/bandwidth_usage.h"
#include "api/units/timestamp.h" #include "api/units/timestamp.h"
#include "logging/rtc_event_log/events/rtc_event_definition.h" #include "logging/rtc_event_log/events/rtc_event_definition.h"

View File

@ -21,10 +21,10 @@
#include "absl/memory/memory.h" #include "absl/memory/memory.h"
#include "absl/strings/string_view.h" #include "absl/strings/string_view.h"
#include "absl/types/optional.h" #include "absl/types/optional.h"
#include "api/network_state_predictor.h"
#include "api/rtc_event_log/rtc_event_log.h" #include "api/rtc_event_log/rtc_event_log.h"
#include "api/rtp_headers.h" #include "api/rtp_headers.h"
#include "api/rtp_parameters.h" #include "api/rtp_parameters.h"
#include "api/transport/bandwidth_usage.h"
#include "logging/rtc_event_log/dependency_descriptor_encoder_decoder.h" #include "logging/rtc_event_log/dependency_descriptor_encoder_decoder.h"
#include "logging/rtc_event_log/encoder/blob_encoding.h" #include "logging/rtc_event_log/encoder/blob_encoding.h"
#include "logging/rtc_event_log/encoder/delta_encoding.h" #include "logging/rtc_event_log/encoder/delta_encoding.h"

View File

@ -24,9 +24,9 @@
#include "absl/strings/string_view.h" #include "absl/strings/string_view.h"
#include "absl/types/optional.h" #include "absl/types/optional.h"
#include "api/array_view.h" #include "api/array_view.h"
#include "api/network_state_predictor.h"
#include "api/rtp_headers.h" #include "api/rtp_headers.h"
#include "api/rtp_parameters.h" #include "api/rtp_parameters.h"
#include "api/transport/bandwidth_usage.h"
#include "api/units/time_delta.h" #include "api/units/time_delta.h"
#include "api/units/timestamp.h" #include "api/units/timestamp.h"
#include "modules/audio_coding/audio_network_adaptor/include/audio_network_adaptor_config.h" #include "modules/audio_coding/audio_network_adaptor/include/audio_network_adaptor_config.h"

View File

@ -123,6 +123,7 @@ rtc_library("estimators") {
"../../../api:field_trials_view", "../../../api:field_trials_view",
"../../../api:network_state_predictor_api", "../../../api:network_state_predictor_api",
"../../../api/rtc_event_log", "../../../api/rtc_event_log",
"../../../api/transport:bandwidth_usage",
"../../../api/transport:network_control", "../../../api/transport:network_control",
"../../../api/units:data_rate", "../../../api/units:data_rate",
"../../../api/units:data_size", "../../../api/units:data_size",
@ -192,8 +193,8 @@ rtc_library("send_side_bwe") {
":loss_based_bwe_v1", ":loss_based_bwe_v1",
":loss_based_bwe_v2", ":loss_based_bwe_v2",
"../../../api:field_trials_view", "../../../api:field_trials_view",
"../../../api:network_state_predictor_api",
"../../../api/rtc_event_log", "../../../api/rtc_event_log",
"../../../api/transport:bandwidth_usage",
"../../../api/transport:network_control", "../../../api/transport:network_control",
"../../../api/units:data_rate", "../../../api/units:data_rate",
"../../../api/units:time_delta", "../../../api/units:time_delta",
@ -327,6 +328,7 @@ if (rtc_include_tests) {
"../../../api/rtc_event_log", "../../../api/rtc_event_log",
"../../../api/test/network_emulation", "../../../api/test/network_emulation",
"../../../api/test/network_emulation:create_cross_traffic", "../../../api/test/network_emulation:create_cross_traffic",
"../../../api/transport:bandwidth_usage",
"../../../api/transport:field_trial_based_config", "../../../api/transport:field_trial_based_config",
"../../../api/transport:goog_cc", "../../../api/transport:goog_cc",
"../../../api/transport:network_control", "../../../api/transport:network_control",

View File

@ -14,7 +14,7 @@
#include <cstddef> #include <cstddef>
#include "api/network_state_predictor.h" #include "api/transport/bandwidth_usage.h"
namespace webrtc { namespace webrtc {

View File

@ -21,8 +21,8 @@
#include "absl/strings/match.h" #include "absl/strings/match.h"
#include "absl/types/optional.h" #include "absl/types/optional.h"
#include "api/field_trials_view.h" #include "api/field_trials_view.h"
#include "api/network_state_predictor.h"
#include "api/rtc_event_log/rtc_event_log.h" #include "api/rtc_event_log/rtc_event_log.h"
#include "api/transport/bandwidth_usage.h"
#include "api/transport/network_types.h" #include "api/transport/network_types.h"
#include "api/units/data_rate.h" #include "api/units/data_rate.h"
#include "api/units/time_delta.h" #include "api/units/time_delta.h"

View File

@ -22,7 +22,7 @@
#include "absl/types/optional.h" #include "absl/types/optional.h"
#include "api/field_trials_view.h" #include "api/field_trials_view.h"
#include "api/network_state_predictor.h" #include "api/transport/bandwidth_usage.h"
#include "api/transport/network_types.h" #include "api/transport/network_types.h"
#include "api/units/data_rate.h" #include "api/units/data_rate.h"
#include "api/units/time_delta.h" #include "api/units/time_delta.h"

View File

@ -15,7 +15,7 @@
#include <cstdint> #include <cstdint>
#include <vector> #include <vector>
#include "api/network_state_predictor.h" #include "api/transport/bandwidth_usage.h"
#include "api/transport/field_trial_based_config.h" #include "api/transport/field_trial_based_config.h"
#include "rtc_base/checks.h" #include "rtc_base/checks.h"
#include "test/gtest.h" #include "test/gtest.h"

View File

@ -35,9 +35,9 @@ rtc_library("remote_bitrate_estimator") {
deps = [ deps = [
"../../api:field_trials_view", "../../api:field_trials_view",
"../../api:network_state_predictor_api",
"../../api:rtp_headers", "../../api:rtp_headers",
"../../api/environment", "../../api/environment",
"../../api/transport:bandwidth_usage",
"../../api/transport:network_control", "../../api/transport:network_control",
"../../api/units:data_rate", "../../api/units:data_rate",
"../../api/units:data_size", "../../api/units:data_size",

View File

@ -14,7 +14,7 @@
#include <stdint.h> #include <stdint.h>
#include "absl/types/optional.h" #include "absl/types/optional.h"
#include "api/network_state_predictor.h" #include "api/transport/bandwidth_usage.h"
#include "api/units/data_rate.h" #include "api/units/data_rate.h"
#include "api/units/time_delta.h" #include "api/units/time_delta.h"

View File

@ -12,7 +12,7 @@
#include <stdint.h> #include <stdint.h>
#include "api/network_state_predictor.h" #include "api/transport/bandwidth_usage.h"
namespace webrtc { namespace webrtc {

View File

@ -15,7 +15,7 @@
#include <algorithm> #include <algorithm>
#include "api/network_state_predictor.h" #include "api/transport/bandwidth_usage.h"
#include "modules/remote_bitrate_estimator/test/bwe_test_logging.h" #include "modules/remote_bitrate_estimator/test/bwe_test_logging.h"
#include "rtc_base/logging.h" #include "rtc_base/logging.h"

View File

@ -14,7 +14,7 @@
#include <deque> #include <deque>
#include "api/network_state_predictor.h" #include "api/transport/bandwidth_usage.h"
namespace webrtc { namespace webrtc {

View File

@ -374,7 +374,6 @@ if (!build_with_chromium) {
"../api:dtls_transport_interface", "../api:dtls_transport_interface",
"../api:function_view", "../api:function_view",
"../api:make_ref_counted", "../api:make_ref_counted",
"../api:network_state_predictor_api",
"../api:rtp_headers", "../api:rtp_headers",
"../api:rtp_parameters", "../api:rtp_parameters",
"../api:scoped_refptr", "../api:scoped_refptr",
@ -383,6 +382,7 @@ if (!build_with_chromium) {
"../api/environment:environment_factory", "../api/environment:environment_factory",
"../api/neteq:neteq_api", "../api/neteq:neteq_api",
"../api/rtc_event_log:rtc_event_log", "../api/rtc_event_log:rtc_event_log",
"../api/transport:bandwidth_usage",
"../api/transport:field_trial_based_config", "../api/transport:field_trial_based_config",
"../api/transport:goog_cc", "../api/transport:goog_cc",
"../api/transport:network_control", "../api/transport:network_control",

View File

@ -31,9 +31,9 @@
#include "api/environment/environment_factory.h" #include "api/environment/environment_factory.h"
#include "api/function_view.h" #include "api/function_view.h"
#include "api/media_types.h" #include "api/media_types.h"
#include "api/network_state_predictor.h"
#include "api/rtc_event_log/rtc_event_log.h" #include "api/rtc_event_log/rtc_event_log.h"
#include "api/rtp_headers.h" #include "api/rtp_headers.h"
#include "api/transport/bandwidth_usage.h"
#include "api/transport/goog_cc_factory.h" #include "api/transport/goog_cc_factory.h"
#include "api/transport/network_control.h" #include "api/transport/network_control.h"
#include "api/transport/network_types.h" #include "api/transport/network_types.h"