Remove REMB throttling funcionality from PacketRouter
This removes PacketRouter inheritance from RemoteBitrateObserver and TransportFeedbackSenderInterface.
Call binds methods for sending REMB and transport feedback messages from RemoteCongestionController to PacketRouter.
This is needed until the RTCPTranseiver is used instead of the RTP modules.
Bug: webrtc:12693
Change-Id: I7088de497cd6d1e15c98788ff3e6b0a2c8897ea8
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/215965
Reviewed-by: Harald Alvestrand <hta@webrtc.org>
Reviewed-by: Mirko Bonadei <mbonadei@webrtc.org>
Reviewed-by: Danil Chapovalov <danilchap@webrtc.org>
Commit-Queue: Per Kjellander <perkj@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#33993}
diff --git a/rtc_tools/rtc_event_log_visualizer/analyzer.cc b/rtc_tools/rtc_event_log_visualizer/analyzer.cc
index d6acda9..7690d7d 100644
--- a/rtc_tools/rtc_event_log_visualizer/analyzer.cc
+++ b/rtc_tools/rtc_event_log_visualizer/analyzer.cc
@@ -19,6 +19,7 @@
#include <utility>
#include "absl/algorithm/container.h"
+#include "absl/functional/bind_front.h"
#include "absl/strings/string_view.h"
#include "api/function_view.h"
#include "api/network_state_predictor.h"
@@ -1367,13 +1368,11 @@
void EventLogAnalyzer::CreateReceiveSideBweSimulationGraph(Plot* plot) {
using RtpPacketType = LoggedRtpPacketIncoming;
- class RembInterceptingPacketRouter : public PacketRouter {
+ class RembInterceptor {
public:
- void OnReceiveBitrateChanged(const std::vector<uint32_t>& ssrcs,
- uint32_t bitrate_bps) override {
+ void SendRemb(uint32_t bitrate_bps, std::vector<uint32_t> ssrcs) {
last_bitrate_bps_ = bitrate_bps;
bitrate_updated_ = true;
- PacketRouter::OnReceiveBitrateChanged(ssrcs, bitrate_bps);
}
uint32_t last_bitrate_bps() const { return last_bitrate_bps_; }
bool GetAndResetBitrateUpdated() {
@@ -1400,10 +1399,10 @@
}
SimulatedClock clock(0);
- RembInterceptingPacketRouter packet_router;
- // TODO(terelius): The PacketRouter is used as the RemoteBitrateObserver.
- // Is this intentional?
- ReceiveSideCongestionController rscc(&clock, &packet_router);
+ RembInterceptor remb_interceptor;
+ ReceiveSideCongestionController rscc(
+ &clock, [](auto...) {},
+ absl::bind_front(&RembInterceptor::SendRemb, &remb_interceptor), nullptr);
// TODO(holmer): Log the call config and use that here instead.
// static const uint32_t kDefaultStartBitrateBps = 300000;
// rscc.SetBweBitrates(0, kDefaultStartBitrateBps, -1);
@@ -1428,9 +1427,9 @@
float x = config_.GetCallTimeSec(clock.TimeInMicroseconds());
acked_time_series.points.emplace_back(x, y);
}
- if (packet_router.GetAndResetBitrateUpdated() ||
+ if (remb_interceptor.GetAndResetBitrateUpdated() ||
clock.TimeInMicroseconds() - last_update_us >= 1e6) {
- uint32_t y = packet_router.last_bitrate_bps() / 1000;
+ uint32_t y = remb_interceptor.last_bitrate_bps() / 1000;
float x = config_.GetCallTimeSec(clock.TimeInMicroseconds());
time_series.points.emplace_back(x, y);
last_update_us = clock.TimeInMicroseconds();