Bug 1903098 - Vendor libwebrtc from 2ee83c1784

Upstream commit: https://webrtc.googlesource.com/src/+/2ee83c17844b302a1b54a27c6340adea723a4ed9
    Provide Environment for ReceiveSideConfestionController construction

    Environment includes propagated field trials that can be later passed to
    RemoteBitrateEstimators member, and would allow not to rely on the global field trial string

    Bug: webrtc:42220378
    Change-Id: Icf75a433c20352b2c22829c2148c92f69a2517aa
    Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/349645
    Commit-Queue: Danil Chapovalov <danilchap@webrtc.org>
    Reviewed-by: Mirko Bonadei <mbonadei@webrtc.org>
    Cr-Commit-Position: refs/heads/main@{#42242}
This commit is contained in:
Michael Froman 2024-06-24 09:28:09 -05:00
Родитель 6ec7fffd68
Коммит cc0ce3692b
12 изменённых файлов: 53 добавлений и 13 удалений

3
third_party/libwebrtc/README.moz-ff-commit поставляемый
Просмотреть файл

@ -30495,3 +30495,6 @@ da648b5960
# MOZ_LIBWEBRTC_SRC=/home/mfroman/mozilla/elm/.moz-fast-forward/moz-libwebrtc MOZ_LIBWEBRTC_BRANCH=mozpatches bash dom/media/webrtc/third_party_build/fast-forward-libwebrtc.sh # MOZ_LIBWEBRTC_SRC=/home/mfroman/mozilla/elm/.moz-fast-forward/moz-libwebrtc MOZ_LIBWEBRTC_BRANCH=mozpatches bash dom/media/webrtc/third_party_build/fast-forward-libwebrtc.sh
# base of lastest vendoring # base of lastest vendoring
f5e9f11994 f5e9f11994
# MOZ_LIBWEBRTC_SRC=/home/mfroman/mozilla/elm/.moz-fast-forward/moz-libwebrtc MOZ_LIBWEBRTC_BRANCH=mozpatches bash dom/media/webrtc/third_party_build/fast-forward-libwebrtc.sh
# base of lastest vendoring
2ee83c1784

2
third_party/libwebrtc/README.mozilla поставляемый
Просмотреть файл

@ -20354,3 +20354,5 @@ libwebrtc updated from /home/mfroman/mozilla/elm/.moz-fast-forward/moz-libwebrtc
libwebrtc updated from /home/mfroman/mozilla/elm/.moz-fast-forward/moz-libwebrtc commit mozpatches on 2024-06-24T14:26:11.321020. libwebrtc updated from /home/mfroman/mozilla/elm/.moz-fast-forward/moz-libwebrtc commit mozpatches on 2024-06-24T14:26:11.321020.
# ./mach python dom/media/webrtc/third_party_build/vendor-libwebrtc.py --from-local /home/mfroman/mozilla/elm/.moz-fast-forward/moz-libwebrtc --commit mozpatches libwebrtc # ./mach python dom/media/webrtc/third_party_build/vendor-libwebrtc.py --from-local /home/mfroman/mozilla/elm/.moz-fast-forward/moz-libwebrtc --commit mozpatches libwebrtc
libwebrtc updated from /home/mfroman/mozilla/elm/.moz-fast-forward/moz-libwebrtc commit mozpatches on 2024-06-24T14:27:07.122535. libwebrtc updated from /home/mfroman/mozilla/elm/.moz-fast-forward/moz-libwebrtc commit mozpatches on 2024-06-24T14:27:07.122535.
# ./mach python dom/media/webrtc/third_party_build/vendor-libwebrtc.py --from-local /home/mfroman/mozilla/elm/.moz-fast-forward/moz-libwebrtc --commit mozpatches libwebrtc
libwebrtc updated from /home/mfroman/mozilla/elm/.moz-fast-forward/moz-libwebrtc commit mozpatches on 2024-06-24T14:27:59.352988.

2
third_party/libwebrtc/call/call.cc поставляемый
Просмотреть файл

@ -653,7 +653,7 @@ Call::Call(const CallConfig& config,
aggregate_network_up_(false), aggregate_network_up_(false),
receive_stats_(&env_.clock()), receive_stats_(&env_.clock()),
send_stats_(&env_.clock()), send_stats_(&env_.clock()),
receive_side_cc_(&env_.clock(), receive_side_cc_(env_,
absl::bind_front(&PacketRouter::SendCombinedRtcpPacket, absl::bind_front(&PacketRouter::SendCombinedRtcpPacket,
transport_send->packet_router()), transport_send->packet_router()),
absl::bind_front(&PacketRouter::SendRemb, absl::bind_front(&PacketRouter::SendRemb,

Просмотреть файл

@ -28,6 +28,7 @@ rtc_library("congestion_controller") {
deps = [ deps = [
"../../api:rtp_parameters", "../../api:rtp_parameters",
"../../api/environment",
"../../api/transport:network_control", "../../api/transport:network_control",
"../../api/units:data_rate", "../../api/units:data_rate",
"../../api/units:time_delta", "../../api/units:time_delta",
@ -39,6 +40,7 @@ rtc_library("congestion_controller") {
"../remote_bitrate_estimator", "../remote_bitrate_estimator",
"../rtp_rtcp:rtp_rtcp_format", "../rtp_rtcp:rtp_rtcp_format",
] ]
absl_deps = [ "//third_party/abseil-cpp/absl/base:nullability" ]
} }
if (rtc_include_tests && !build_with_chromium) { if (rtc_include_tests && !build_with_chromium) {
@ -51,6 +53,7 @@ if (rtc_include_tests && !build_with_chromium) {
] ]
deps = [ deps = [
":congestion_controller", ":congestion_controller",
"../../api/environment:environment_factory",
"../../api/test/network_emulation", "../../api/test/network_emulation",
"../../api/test/network_emulation:create_cross_traffic", "../../api/test/network_emulation:create_cross_traffic",
"../../api/units:data_rate", "../../api/units:data_rate",

Просмотреть файл

@ -14,6 +14,8 @@
#include <memory> #include <memory>
#include <vector> #include <vector>
#include "absl/base/nullability.h"
#include "api/environment/environment.h"
#include "api/transport/network_control.h" #include "api/transport/network_control.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"
@ -35,12 +37,18 @@ class RemoteBitrateEstimator;
class ReceiveSideCongestionController : public CallStatsObserver { class ReceiveSideCongestionController : public CallStatsObserver {
public: public:
ReceiveSideCongestionController( ReceiveSideCongestionController(
const Environment& env,
RemoteEstimatorProxy::TransportFeedbackSender feedback_sender,
RembThrottler::RembSender remb_sender,
absl::Nullable<NetworkStateEstimator*> network_state_estimator);
[[deprecated]] ReceiveSideCongestionController(
Clock* clock, Clock* clock,
RemoteEstimatorProxy::TransportFeedbackSender feedback_sender, RemoteEstimatorProxy::TransportFeedbackSender feedback_sender,
RembThrottler::RembSender remb_sender, RembThrottler::RembSender remb_sender,
NetworkStateEstimator* network_state_estimator); NetworkStateEstimator* network_state_estimator);
~ReceiveSideCongestionController() override {} ~ReceiveSideCongestionController() override = default;
void OnReceivedPacket(const RtpPacketReceived& packet, MediaType media_type); void OnReceivedPacket(const RtpPacketReceived& packet, MediaType media_type);

Просмотреть файл

@ -10,6 +10,8 @@
#include "modules/congestion_controller/include/receive_side_congestion_controller.h" #include "modules/congestion_controller/include/receive_side_congestion_controller.h"
#include "absl/base/nullability.h"
#include "api/environment/environment.h"
#include "api/media_types.h" #include "api/media_types.h"
#include "api/units/data_rate.h" #include "api/units/data_rate.h"
#include "modules/pacing/packet_router.h" #include "modules/pacing/packet_router.h"
@ -68,6 +70,21 @@ void ReceiveSideCongestionController::PickEstimator(
} }
} }
ReceiveSideCongestionController::ReceiveSideCongestionController(
const Environment& env,
RemoteEstimatorProxy::TransportFeedbackSender feedback_sender,
RembThrottler::RembSender remb_sender,
absl::Nullable<NetworkStateEstimator*> network_state_estimator)
: clock_(env.clock()),
remb_throttler_(std::move(remb_sender), &clock_),
remote_estimator_proxy_(std::move(feedback_sender),
network_state_estimator),
rbe_(
std::make_unique<RemoteBitrateEstimatorSingleStream>(&remb_throttler_,
&clock_)),
using_absolute_send_time_(false),
packets_since_absolute_send_time_(0) {}
ReceiveSideCongestionController::ReceiveSideCongestionController( ReceiveSideCongestionController::ReceiveSideCongestionController(
Clock* clock, Clock* clock,
RemoteEstimatorProxy::TransportFeedbackSender feedback_sender, RemoteEstimatorProxy::TransportFeedbackSender feedback_sender,

Просмотреть файл

@ -10,6 +10,7 @@
#include "modules/congestion_controller/include/receive_side_congestion_controller.h" #include "modules/congestion_controller/include/receive_side_congestion_controller.h"
#include "api/environment/environment_factory.h"
#include "api/test/network_emulation/create_cross_traffic.h" #include "api/test/network_emulation/create_cross_traffic.h"
#include "api/test/network_emulation/cross_traffic.h" #include "api/test/network_emulation/cross_traffic.h"
#include "api/units/data_rate.h" #include "api/units/data_rate.h"
@ -41,11 +42,11 @@ TEST(ReceiveSideCongestionControllerTest, SendsRembWithAbsSendTime) {
MockFunction<void(std::vector<std::unique_ptr<rtcp::RtcpPacket>>)> MockFunction<void(std::vector<std::unique_ptr<rtcp::RtcpPacket>>)>
feedback_sender; feedback_sender;
MockFunction<void(uint64_t, std::vector<uint32_t>)> remb_sender; MockFunction<void(uint64_t, std::vector<uint32_t>)> remb_sender;
SimulatedClock clock_(123456); SimulatedClock clock(123456);
ReceiveSideCongestionController controller( ReceiveSideCongestionController controller(
&clock_, feedback_sender.AsStdFunction(), remb_sender.AsStdFunction(), CreateEnvironment(&clock), feedback_sender.AsStdFunction(),
nullptr); remb_sender.AsStdFunction(), nullptr);
RtpHeaderExtensionMap extensions; RtpHeaderExtensionMap extensions;
extensions.Register<AbsoluteSendTime>(1); extensions.Register<AbsoluteSendTime>(1);
@ -58,8 +59,8 @@ TEST(ReceiveSideCongestionControllerTest, SendsRembWithAbsSendTime) {
.Times(AtLeast(1)); .Times(AtLeast(1));
for (int i = 0; i < 10; ++i) { for (int i = 0; i < 10; ++i) {
clock_.AdvanceTime(kPayloadSize / kInitialBitrate); clock.AdvanceTime(kPayloadSize / kInitialBitrate);
Timestamp now = clock_.CurrentTime(); Timestamp now = clock.CurrentTime();
packet.SetExtension<AbsoluteSendTime>(AbsoluteSendTime::To24Bits(now)); packet.SetExtension<AbsoluteSendTime>(AbsoluteSendTime::To24Bits(now));
packet.set_arrival_time(now); packet.set_arrival_time(now);
controller.OnReceivedPacket(packet, MediaType::VIDEO); controller.OnReceivedPacket(packet, MediaType::VIDEO);
@ -71,11 +72,11 @@ TEST(ReceiveSideCongestionControllerTest,
MockFunction<void(std::vector<std::unique_ptr<rtcp::RtcpPacket>>)> MockFunction<void(std::vector<std::unique_ptr<rtcp::RtcpPacket>>)>
feedback_sender; feedback_sender;
MockFunction<void(uint64_t, std::vector<uint32_t>)> remb_sender; MockFunction<void(uint64_t, std::vector<uint32_t>)> remb_sender;
SimulatedClock clock_(123456); SimulatedClock clock(123456);
ReceiveSideCongestionController controller( ReceiveSideCongestionController controller(
&clock_, feedback_sender.AsStdFunction(), remb_sender.AsStdFunction(), CreateEnvironment(&clock), feedback_sender.AsStdFunction(),
nullptr); remb_sender.AsStdFunction(), nullptr);
EXPECT_CALL(remb_sender, Call(123, _)); EXPECT_CALL(remb_sender, Call(123, _));
controller.SetMaxDesiredReceiveBitrate(DataRate::BitsPerSec(123)); controller.SetMaxDesiredReceiveBitrate(DataRate::BitsPerSec(123));
} }

Просмотреть файл

@ -31,7 +31,7 @@ index 0a4df24f3e..d73920546f 100644
deps = [ deps = [
":audio_sender_interface", ":audio_sender_interface",
diff --git a/call/call.cc b/call/call.cc diff --git a/call/call.cc b/call/call.cc
index cca344a5a8..1e76571bfe 100644 index a6385a5170..e92e89e87a 100644
--- a/call/call.cc --- a/call/call.cc
+++ b/call/call.cc +++ b/call/call.cc
@@ -454,19 +454,6 @@ class Call final : public webrtc::Call, @@ -454,19 +454,6 @@ class Call final : public webrtc::Call,

3
third_party/libwebrtc/rtc_tools/BUILD.gn поставляемый
Просмотреть файл

@ -359,6 +359,7 @@ if (!build_with_chromium) {
rtc_library("event_log_visualizer_utils") { rtc_library("event_log_visualizer_utils") {
visibility = [ "*" ] visibility = [ "*" ]
allow_poison = [ "environment_construction" ]
sources = [ sources = [
"rtc_event_log_visualizer/alerts.cc", "rtc_event_log_visualizer/alerts.cc",
"rtc_event_log_visualizer/alerts.h", "rtc_event_log_visualizer/alerts.h",
@ -384,6 +385,7 @@ if (!build_with_chromium) {
"../api:scoped_refptr", "../api:scoped_refptr",
"../api/audio_codecs:audio_codecs_api", # TODO(kwiberg): Remove this "../api/audio_codecs:audio_codecs_api", # TODO(kwiberg): Remove this
# dependency. # dependency.
"../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:field_trial_based_config", "../api/transport:field_trial_based_config",
@ -437,6 +439,7 @@ if (!build_with_chromium) {
rtc_library("event_log_visualizer_bindings") { rtc_library("event_log_visualizer_bindings") {
visibility = [ "*" ] visibility = [ "*" ]
allow_poison = [ "environment_construction" ]
sources = [ sources = [
"rtc_event_log_visualizer/analyzer_bindings.cc", "rtc_event_log_visualizer/analyzer_bindings.cc",
"rtc_event_log_visualizer/analyzer_bindings.h", "rtc_event_log_visualizer/analyzer_bindings.h",

Просмотреть файл

@ -28,6 +28,7 @@
#include "absl/strings/string_view.h" #include "absl/strings/string_view.h"
#include "absl/types/optional.h" #include "absl/types/optional.h"
#include "api/dtls_transport_interface.h" #include "api/dtls_transport_interface.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/network_state_predictor.h"
@ -1851,7 +1852,7 @@ void EventLogAnalyzer::CreateReceiveSideBweSimulationGraph(Plot* plot) {
SimulatedClock clock(0); SimulatedClock clock(0);
RembInterceptor remb_interceptor; RembInterceptor remb_interceptor;
ReceiveSideCongestionController rscc( ReceiveSideCongestionController rscc(
&clock, [](auto...) {}, CreateEnvironment(&clock), [](auto...) {},
absl::bind_front(&RembInterceptor::SendRemb, &remb_interceptor), nullptr); absl::bind_front(&RembInterceptor::SendRemb, &remb_interceptor), nullptr);
// TODO(holmer): Log the call config and use that here instead. // TODO(holmer): Log the call config and use that here instead.
// static const uint32_t kDefaultStartBitrateBps = 300000; // static const uint32_t kDefaultStartBitrateBps = 300000;

1
third_party/libwebrtc/test/fuzzers/BUILD.gn поставляемый
Просмотреть файл

@ -278,6 +278,7 @@ webrtc_fuzzer_test("receive_side_congestion_controller_fuzzer") {
sources = [ "receive_side_congestion_controller_fuzzer.cc" ] sources = [ "receive_side_congestion_controller_fuzzer.cc" ]
deps = [ deps = [
"../../api:array_view", "../../api:array_view",
"../../api/environment:environment_factory",
"../../api/units:time_delta", "../../api/units:time_delta",
"../../api/units:timestamp", "../../api/units:timestamp",
"../../modules/congestion_controller", "../../modules/congestion_controller",

Просмотреть файл

@ -13,6 +13,7 @@
#include <cstdint> #include <cstdint>
#include "api/array_view.h" #include "api/array_view.h"
#include "api/environment/environment_factory.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/congestion_controller/include/receive_side_congestion_controller.h" #include "modules/congestion_controller/include/receive_side_congestion_controller.h"
@ -28,7 +29,7 @@ void FuzzOneInput(const uint8_t* data, size_t size) {
Timestamp arrival_time = Timestamp::Micros(123'456'789); Timestamp arrival_time = Timestamp::Micros(123'456'789);
SimulatedClock clock(arrival_time); SimulatedClock clock(arrival_time);
ReceiveSideCongestionController cc( ReceiveSideCongestionController cc(
&clock, CreateEnvironment(&clock),
/*feedback_sender=*/[](auto...) {}, /*feedback_sender=*/[](auto...) {},
/*remb_sender=*/[](auto...) {}, /*remb_sender=*/[](auto...) {},
/*network_state_estimator=*/nullptr); /*network_state_estimator=*/nullptr);