From 738bfa7baba500e9dadc42239ef6a7fd4b266e5e Mon Sep 17 00:00:00 2001 From: Mirko Bonadei Date: Tue, 17 Sep 2019 14:47:38 +0200 Subject: [PATCH] Remove api/bitrate_constraints.h. Bug: webrtc:8733 Change-Id: Iaeb26e07d399f25dc18b0c4af38ed400577a5d3a Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/153220 Reviewed-by: Karl Wiberg Reviewed-by: Niels Moller Commit-Queue: Mirko Bonadei Cr-Commit-Position: refs/heads/master@{#29217} --- api/BUILD.gn | 2 +- api/bitrate_constraints.h | 41 ------------------- api/test/video_quality_test_fixture.h | 2 +- api/transport/bitrate_settings.h | 26 ++++++++++++ call/BUILD.gn | 4 +- call/call_config.h | 2 +- call/rtp_bitrate_configurator.h | 1 - .../rtp_transport_controller_send_interface.h | 1 - .../test/mock_rtp_transport_controller_send.h | 2 +- media/BUILD.gn | 1 + media/engine/webrtc_media_engine.h | 2 +- video/BUILD.gn | 3 ++ video/screenshare_loopback.cc | 2 +- video/sv_loopback.cc | 2 +- video/video_loopback.cc | 2 +- 15 files changed, 40 insertions(+), 53 deletions(-) delete mode 100644 api/bitrate_constraints.h diff --git a/api/BUILD.gn b/api/BUILD.gn index f6885f2df1..512c686f1b 100644 --- a/api/BUILD.gn +++ b/api/BUILD.gn @@ -108,7 +108,6 @@ rtc_static_library("libjingle_peerconnection_api") { visibility = [ "*" ] cflags = [] sources = [ - "bitrate_constraints.h", "candidate.cc", "candidate.h", "congestion_control_interface.h", @@ -255,6 +254,7 @@ rtc_source_set("video_quality_test_fixture_api") { "../call:rtp_interfaces", "../test:test_common", "../test:video_test_common", + "transport:bitrate_settings", "transport:network_control", "transport/media:media_transport_interface", "video_codecs:video_codecs_api", diff --git a/api/bitrate_constraints.h b/api/bitrate_constraints.h deleted file mode 100644 index 98e89c0858..0000000000 --- a/api/bitrate_constraints.h +++ /dev/null @@ -1,41 +0,0 @@ -/* - * Copyright (c) 2018 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_BITRATE_CONSTRAINTS_H_ -#define API_BITRATE_CONSTRAINTS_H_ - -#include - -namespace webrtc { -// TODO(srte): BitrateConstraints and BitrateSettings should be merged. -// Both represent the same kind data, but are using different default -// initializer and representation of unset values. -struct BitrateConstraints { - int min_bitrate_bps = 0; - int start_bitrate_bps = kDefaultStartBitrateBps; - int max_bitrate_bps = -1; - - private: - static constexpr int kDefaultStartBitrateBps = 300000; -}; - -// Like std::min, but considers non-positive values to be unset. -template -static T MinPositive(T a, T b) { - if (a <= 0) { - return b; - } - if (b <= 0) { - return a; - } - return std::min(a, b); -} -} // namespace webrtc -#endif // API_BITRATE_CONSTRAINTS_H_ diff --git a/api/test/video_quality_test_fixture.h b/api/test/video_quality_test_fixture.h index 9bfa711c59..ec07c23cd4 100644 --- a/api/test/video_quality_test_fixture.h +++ b/api/test/video_quality_test_fixture.h @@ -16,11 +16,11 @@ #include #include -#include "api/bitrate_constraints.h" #include "api/fec_controller.h" #include "api/media_types.h" #include "api/network_state_predictor.h" #include "api/test/simulated_network.h" +#include "api/transport/bitrate_settings.h" #include "api/transport/network_control.h" #include "api/video_codecs/video_decoder_factory.h" #include "api/video_codecs/video_encoder_config.h" diff --git a/api/transport/bitrate_settings.h b/api/transport/bitrate_settings.h index f95ab7cb6e..888e2b9901 100644 --- a/api/transport/bitrate_settings.h +++ b/api/transport/bitrate_settings.h @@ -11,6 +11,8 @@ #ifndef API_TRANSPORT_BITRATE_SETTINGS_H_ #define API_TRANSPORT_BITRATE_SETTINGS_H_ +#include + #include "absl/types/optional.h" #include "rtc_base/system/rtc_export.h" @@ -31,6 +33,30 @@ struct RTC_EXPORT BitrateSettings { absl::optional max_bitrate_bps; }; +// TODO(srte): BitrateConstraints and BitrateSettings should be merged. +// Both represent the same kind data, but are using different default +// initializer and representation of unset values. +struct BitrateConstraints { + int min_bitrate_bps = 0; + int start_bitrate_bps = kDefaultStartBitrateBps; + int max_bitrate_bps = -1; + + private: + static constexpr int kDefaultStartBitrateBps = 300000; +}; + +// Like std::min, but considers non-positive values to be unset. +template +static T MinPositive(T a, T b) { + if (a <= 0) { + return b; + } + if (b <= 0) { + return a; + } + return std::min(a, b); +} + } // namespace webrtc #endif // API_TRANSPORT_BITRATE_SETTINGS_H_ diff --git a/call/BUILD.gn b/call/BUILD.gn index c35b54b882..61034d26b8 100644 --- a/call/BUILD.gn +++ b/call/BUILD.gn @@ -31,7 +31,6 @@ rtc_source_set("call_interfaces") { ":rtp_interfaces", ":video_stream_api", "../api:fec_controller_api", - "../api:libjingle_peerconnection_api", # For api/bitrate_constraints.h "../api:network_state_predictor_api", "../api:rtc_error", "../api:rtp_headers", @@ -44,6 +43,7 @@ rtc_source_set("call_interfaces") { "../api/crypto:frame_encryptor_interface", "../api/crypto:options", "../api/task_queue", + "../api/transport:bitrate_settings", "../api/transport:network_control", "../api/transport/media:media_transport_interface", "../api/transport/rtp:rtp_source", @@ -81,7 +81,6 @@ rtc_source_set("rtp_interfaces") { deps = [ "../api:array_view", "../api:fec_controller_api", - "../api:libjingle_peerconnection_api", # For api/bitrate_constraints.h "../api:rtp_headers", "../api:rtp_parameters", "../api/crypto:options", @@ -487,6 +486,7 @@ if (rtc_include_tests) { "../api:libjingle_peerconnection_api", "../api/crypto:frame_encryptor_interface", "../api/crypto:options", + "../api/transport:bitrate_settings", "../modules/pacing", "../rtc_base", "../rtc_base:rate_limiter", diff --git a/call/call_config.h b/call/call_config.h index a6f7a9614f..3129530be1 100644 --- a/call/call_config.h +++ b/call/call_config.h @@ -10,11 +10,11 @@ #ifndef CALL_CALL_CONFIG_H_ #define CALL_CALL_CONFIG_H_ -#include "api/bitrate_constraints.h" #include "api/fec_controller.h" #include "api/network_state_predictor.h" #include "api/rtc_error.h" #include "api/task_queue/task_queue_factory.h" +#include "api/transport/bitrate_settings.h" #include "api/transport/network_control.h" #include "call/audio_state.h" diff --git a/call/rtp_bitrate_configurator.h b/call/rtp_bitrate_configurator.h index a16dda8c10..480ed9ee7c 100644 --- a/call/rtp_bitrate_configurator.h +++ b/call/rtp_bitrate_configurator.h @@ -12,7 +12,6 @@ #define CALL_RTP_BITRATE_CONFIGURATOR_H_ #include "absl/types/optional.h" -#include "api/bitrate_constraints.h" #include "api/transport/bitrate_settings.h" #include "rtc_base/constructor_magic.h" diff --git a/call/rtp_transport_controller_send_interface.h b/call/rtp_transport_controller_send_interface.h index c86719a2b7..1ad2b639fa 100644 --- a/call/rtp_transport_controller_send_interface.h +++ b/call/rtp_transport_controller_send_interface.h @@ -19,7 +19,6 @@ #include #include "absl/types/optional.h" -#include "api/bitrate_constraints.h" #include "api/crypto/crypto_options.h" #include "api/fec_controller.h" #include "api/rtc_event_log/rtc_event_log.h" diff --git a/call/test/mock_rtp_transport_controller_send.h b/call/test/mock_rtp_transport_controller_send.h index eb3ad5cbf8..a418ad9e4a 100644 --- a/call/test/mock_rtp_transport_controller_send.h +++ b/call/test/mock_rtp_transport_controller_send.h @@ -16,9 +16,9 @@ #include #include -#include "api/bitrate_constraints.h" #include "api/crypto/crypto_options.h" #include "api/crypto/frame_encryptor_interface.h" +#include "api/transport/bitrate_settings.h" #include "call/rtp_transport_controller_send_interface.h" #include "modules/pacing/packet_router.h" #include "rtc_base/network/sent_packet.h" diff --git a/media/BUILD.gn b/media/BUILD.gn index 1a25a84b22..7986a63f2d 100644 --- a/media/BUILD.gn +++ b/media/BUILD.gn @@ -269,6 +269,7 @@ rtc_static_library("rtc_audio_video") { "../api/audio:audio_mixer_api", "../api/audio_codecs:audio_codecs_api", "../api/task_queue", + "../api/transport:bitrate_settings", "../api/transport:datagram_transport_interface", "../api/transport/media:media_transport_interface", "../api/transport/rtp:rtp_source", diff --git a/media/engine/webrtc_media_engine.h b/media/engine/webrtc_media_engine.h index 454d927e4c..40dbb90df8 100644 --- a/media/engine/webrtc_media_engine.h +++ b/media/engine/webrtc_media_engine.h @@ -18,9 +18,9 @@ #include "api/audio/audio_mixer.h" #include "api/audio_codecs/audio_decoder_factory.h" #include "api/audio_codecs/audio_encoder_factory.h" -#include "api/bitrate_constraints.h" #include "api/rtp_parameters.h" #include "api/task_queue/task_queue_factory.h" +#include "api/transport/bitrate_settings.h" #include "api/video_codecs/video_decoder_factory.h" #include "api/video_codecs/video_encoder_factory.h" #include "media/base/codec.h" diff --git a/video/BUILD.gn b/video/BUILD.gn index 48d67f7d67..b84d5596c5 100644 --- a/video/BUILD.gn +++ b/video/BUILD.gn @@ -375,6 +375,7 @@ if (rtc_include_tests) { "../api:libjingle_peerconnection_api", "../api:simulated_network_api", "../api:video_quality_test_fixture_api", + "../api/transport:bitrate_settings", "../api/video_codecs:video_codecs_api", "../rtc_base:checks", "../rtc_base:logging", @@ -425,6 +426,7 @@ if (rtc_include_tests) { "../api:libjingle_peerconnection_api", "../api:simulated_network_api", "../api:video_quality_test_fixture_api", + "../api/transport:bitrate_settings", "../api/video_codecs:video_codecs_api", "../rtc_base:checks", "../rtc_base:logging", @@ -452,6 +454,7 @@ if (rtc_include_tests) { "../api:libjingle_peerconnection_api", "../api:simulated_network_api", "../api:video_quality_test_fixture_api", + "../api/transport:bitrate_settings", "../api/video_codecs:video_codecs_api", "../rtc_base:checks", "../rtc_base:logging", diff --git a/video/screenshare_loopback.cc b/video/screenshare_loopback.cc index e5625a9aa2..b8121dc85c 100644 --- a/video/screenshare_loopback.cc +++ b/video/screenshare_loopback.cc @@ -17,9 +17,9 @@ #include "absl/flags/flag.h" #include "absl/flags/parse.h" #include "absl/types/optional.h" -#include "api/bitrate_constraints.h" #include "api/test/simulated_network.h" #include "api/test/video_quality_test_fixture.h" +#include "api/transport/bitrate_settings.h" #include "api/video_codecs/video_codec.h" #include "rtc_base/checks.h" #include "rtc_base/logging.h" diff --git a/video/sv_loopback.cc b/video/sv_loopback.cc index c13a958a4b..ec236d6e62 100644 --- a/video/sv_loopback.cc +++ b/video/sv_loopback.cc @@ -17,9 +17,9 @@ #include "absl/flags/flag.h" #include "absl/flags/parse.h" #include "absl/types/optional.h" -#include "api/bitrate_constraints.h" #include "api/test/simulated_network.h" #include "api/test/video_quality_test_fixture.h" +#include "api/transport/bitrate_settings.h" #include "api/video_codecs/video_codec.h" #include "rtc_base/checks.h" #include "rtc_base/logging.h" diff --git a/video/video_loopback.cc b/video/video_loopback.cc index 7d6f5358e1..99ff4493bd 100644 --- a/video/video_loopback.cc +++ b/video/video_loopback.cc @@ -18,9 +18,9 @@ #include "absl/flags/flag.h" #include "absl/flags/parse.h" #include "absl/types/optional.h" -#include "api/bitrate_constraints.h" #include "api/test/simulated_network.h" #include "api/test/video_quality_test_fixture.h" +#include "api/transport/bitrate_settings.h" #include "api/video_codecs/video_codec.h" #include "rtc_base/checks.h" #include "rtc_base/logging.h"