Removes analyzer dependency on legacy congestion controller.
Bug: webrtc:9586 Change-Id: Ic1f2445d6432202aeba9164acd49b75261e91aa0 Reviewed-on: https://webrtc-review.googlesource.com/c/105107 Commit-Queue: Sebastian Jansson <srte@webrtc.org> Reviewed-by: Mirko Bonadei <mbonadei@webrtc.org> Reviewed-by: Björn Terelius <terelius@webrtc.org> Cr-Commit-Position: refs/heads/master@{#25183}
This commit is contained in:

committed by
Commit Bot

parent
82c71af262
commit
5c94f55a8f
@ -255,10 +255,13 @@ if (!build_with_chromium) {
|
|||||||
|
|
||||||
# TODO(kwiberg): Remove this dependency.
|
# TODO(kwiberg): Remove this dependency.
|
||||||
"../api/audio_codecs:audio_codecs_api",
|
"../api/audio_codecs:audio_codecs_api",
|
||||||
|
"../api/transport:goog_cc",
|
||||||
"../modules/congestion_controller",
|
"../modules/congestion_controller",
|
||||||
"../modules/congestion_controller/goog_cc:delay_based_bwe",
|
"../modules/congestion_controller/goog_cc:delay_based_bwe",
|
||||||
"../modules/congestion_controller/goog_cc:estimators",
|
"../modules/congestion_controller/goog_cc:estimators",
|
||||||
|
"../modules/congestion_controller/rtp:transport_feedback",
|
||||||
"../modules/pacing",
|
"../modules/pacing",
|
||||||
|
"../modules/remote_bitrate_estimator",
|
||||||
"../modules/rtp_rtcp",
|
"../modules/rtp_rtcp",
|
||||||
"//third_party/abseil-cpp/absl/memory",
|
"//third_party/abseil-cpp/absl/memory",
|
||||||
]
|
]
|
||||||
|
@ -7,6 +7,7 @@ include_rules = [
|
|||||||
"+modules/audio_coding/neteq/tools",
|
"+modules/audio_coding/neteq/tools",
|
||||||
"+modules/audio_processing",
|
"+modules/audio_processing",
|
||||||
"+modules/bitrate_controller",
|
"+modules/bitrate_controller",
|
||||||
|
"+modules/remote_bitrate_estimator",
|
||||||
"+modules/congestion_controller",
|
"+modules/congestion_controller",
|
||||||
"+modules/pacing",
|
"+modules/pacing",
|
||||||
"+modules/rtp_rtcp",
|
"+modules/rtp_rtcp",
|
||||||
|
@ -18,6 +18,7 @@
|
|||||||
#include <utility>
|
#include <utility>
|
||||||
|
|
||||||
#include "absl/memory/memory.h"
|
#include "absl/memory/memory.h"
|
||||||
|
#include "api/transport/goog_cc_factory.h"
|
||||||
#include "call/audio_receive_stream.h"
|
#include "call/audio_receive_stream.h"
|
||||||
#include "call/audio_send_stream.h"
|
#include "call/audio_send_stream.h"
|
||||||
#include "call/call.h"
|
#include "call/call.h"
|
||||||
@ -36,8 +37,9 @@
|
|||||||
#include "modules/congestion_controller/goog_cc/bitrate_estimator.h"
|
#include "modules/congestion_controller/goog_cc/bitrate_estimator.h"
|
||||||
#include "modules/congestion_controller/goog_cc/delay_based_bwe.h"
|
#include "modules/congestion_controller/goog_cc/delay_based_bwe.h"
|
||||||
#include "modules/congestion_controller/include/receive_side_congestion_controller.h"
|
#include "modules/congestion_controller/include/receive_side_congestion_controller.h"
|
||||||
#include "modules/congestion_controller/include/send_side_congestion_controller.h"
|
#include "modules/congestion_controller/rtp/transport_feedback_adapter.h"
|
||||||
#include "modules/pacing/packet_router.h"
|
#include "modules/pacing/packet_router.h"
|
||||||
|
#include "modules/remote_bitrate_estimator/include/bwe_defines.h"
|
||||||
#include "modules/rtp_rtcp/include/rtp_rtcp.h"
|
#include "modules/rtp_rtcp/include/rtp_rtcp.h"
|
||||||
#include "modules/rtp_rtcp/include/rtp_rtcp_defines.h"
|
#include "modules/rtp_rtcp/include/rtp_rtcp_defines.h"
|
||||||
#include "modules/rtp_rtcp/source/rtcp_packet.h"
|
#include "modules/rtp_rtcp/source/rtcp_packet.h"
|
||||||
@ -486,17 +488,15 @@ EventLogAnalyzer::EventLogAnalyzer(const ParsedRtcEventLogNew& log,
|
|||||||
<< " (LOG_START, LOG_END) segments in log.";
|
<< " (LOG_START, LOG_END) segments in log.";
|
||||||
}
|
}
|
||||||
|
|
||||||
class BitrateObserver : public NetworkChangedObserver,
|
class BitrateObserver : public RemoteBitrateObserver {
|
||||||
public RemoteBitrateObserver {
|
|
||||||
public:
|
public:
|
||||||
BitrateObserver() : last_bitrate_bps_(0), bitrate_updated_(false) {}
|
BitrateObserver() : last_bitrate_bps_(0), bitrate_updated_(false) {}
|
||||||
|
|
||||||
void OnNetworkChanged(uint32_t bitrate_bps,
|
void Update(NetworkControlUpdate update) {
|
||||||
uint8_t fraction_lost,
|
if (update.target_rate) {
|
||||||
int64_t rtt_ms,
|
last_bitrate_bps_ = update.target_rate->target_rate.bps();
|
||||||
int64_t probing_interval_ms) override {
|
bitrate_updated_ = true;
|
||||||
last_bitrate_bps_ = bitrate_bps;
|
}
|
||||||
bitrate_updated_ = true;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void OnReceiveBitrateChanged(const std::vector<uint32_t>& ssrcs,
|
void OnReceiveBitrateChanged(const std::vector<uint32_t>& ssrcs,
|
||||||
@ -1081,10 +1081,14 @@ void EventLogAnalyzer::CreateSendSideBweSimulationGraph(Plot* plot) {
|
|||||||
RtcEventLogNullImpl null_event_log;
|
RtcEventLogNullImpl null_event_log;
|
||||||
PacketRouter packet_router;
|
PacketRouter packet_router;
|
||||||
PacedSender pacer(&clock, &packet_router, &null_event_log);
|
PacedSender pacer(&clock, &packet_router, &null_event_log);
|
||||||
SendSideCongestionController cc(&clock, &observer, &null_event_log, &pacer);
|
webrtc_cc::TransportFeedbackAdapter transport_feedback(&clock);
|
||||||
|
auto factory = GoogCcNetworkControllerFactory(&null_event_log);
|
||||||
|
TimeDelta process_interval = factory.GetProcessInterval();
|
||||||
// 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;
|
||||||
cc.SetBweBitrates(0, kDefaultStartBitrateBps, -1);
|
NetworkControllerConfig cc_config;
|
||||||
|
cc_config.constraints.starting_rate = DataRate::bps(kDefaultStartBitrateBps);
|
||||||
|
auto goog_cc = factory.Create(cc_config);
|
||||||
|
|
||||||
TimeSeries time_series("Delay-based estimate", LineStyle::kStep,
|
TimeSeries time_series("Delay-based estimate", LineStyle::kStep,
|
||||||
PointStyle::kHighlight);
|
PointStyle::kHighlight);
|
||||||
@ -1107,12 +1111,12 @@ void EventLogAnalyzer::CreateSendSideBweSimulationGraph(Plot* plot) {
|
|||||||
return static_cast<int64_t>(rtcp_iterator->log_time_us());
|
return static_cast<int64_t>(rtcp_iterator->log_time_us());
|
||||||
return std::numeric_limits<int64_t>::max();
|
return std::numeric_limits<int64_t>::max();
|
||||||
};
|
};
|
||||||
|
int64_t next_process_time_us_ = clock.TimeInMicroseconds();
|
||||||
|
|
||||||
auto NextProcessTime = [&]() {
|
auto NextProcessTime = [&]() {
|
||||||
if (rtcp_iterator != incoming_rtcp.end() ||
|
if (rtcp_iterator != incoming_rtcp.end() ||
|
||||||
rtp_iterator != outgoing_rtp.end()) {
|
rtp_iterator != outgoing_rtp.end()) {
|
||||||
return clock.TimeInMicroseconds() +
|
return next_process_time_us_;
|
||||||
std::max<int64_t>(cc.TimeUntilNextProcess() * 1000, 0);
|
|
||||||
}
|
}
|
||||||
return std::numeric_limits<int64_t>::max();
|
return std::numeric_limits<int64_t>::max();
|
||||||
};
|
};
|
||||||
@ -1129,24 +1133,32 @@ void EventLogAnalyzer::CreateSendSideBweSimulationGraph(Plot* plot) {
|
|||||||
AcknowledgedBitrateEstimator acknowledged_bitrate_estimator(
|
AcknowledgedBitrateEstimator acknowledged_bitrate_estimator(
|
||||||
absl::make_unique<BitrateEstimator>());
|
absl::make_unique<BitrateEstimator>());
|
||||||
#endif // !(BWE_TEST_LOGGING_COMPILE_TIME_ENABLE)
|
#endif // !(BWE_TEST_LOGGING_COMPILE_TIME_ENABLE)
|
||||||
int64_t time_us = std::min(NextRtpTime(), NextRtcpTime());
|
int64_t time_us =
|
||||||
|
std::min({NextRtpTime(), NextRtcpTime(), NextProcessTime()});
|
||||||
int64_t last_update_us = 0;
|
int64_t last_update_us = 0;
|
||||||
while (time_us != std::numeric_limits<int64_t>::max()) {
|
while (time_us != std::numeric_limits<int64_t>::max()) {
|
||||||
clock.AdvanceTimeMicroseconds(time_us - clock.TimeInMicroseconds());
|
clock.AdvanceTimeMicroseconds(time_us - clock.TimeInMicroseconds());
|
||||||
if (clock.TimeInMicroseconds() >= NextRtcpTime()) {
|
if (clock.TimeInMicroseconds() >= NextRtcpTime()) {
|
||||||
RTC_DCHECK_EQ(clock.TimeInMicroseconds(), NextRtcpTime());
|
RTC_DCHECK_EQ(clock.TimeInMicroseconds(), NextRtcpTime());
|
||||||
cc.OnTransportFeedback(rtcp_iterator->transport_feedback);
|
|
||||||
std::vector<PacketFeedback> feedback = cc.GetTransportFeedbackVector();
|
auto feedback_msg = transport_feedback.ProcessTransportFeedback(
|
||||||
SortPacketFeedbackVector(&feedback);
|
rtcp_iterator->transport_feedback);
|
||||||
absl::optional<uint32_t> bitrate_bps;
|
absl::optional<uint32_t> bitrate_bps;
|
||||||
if (!feedback.empty()) {
|
if (feedback_msg) {
|
||||||
|
observer.Update(goog_cc->OnTransportPacketsFeedback(*feedback_msg));
|
||||||
|
std::vector<PacketFeedback> feedback =
|
||||||
|
transport_feedback.GetTransportFeedbackVector();
|
||||||
|
SortPacketFeedbackVector(&feedback);
|
||||||
|
if (!feedback.empty()) {
|
||||||
#if !(BWE_TEST_LOGGING_COMPILE_TIME_ENABLE)
|
#if !(BWE_TEST_LOGGING_COMPILE_TIME_ENABLE)
|
||||||
acknowledged_bitrate_estimator.IncomingPacketFeedbackVector(feedback);
|
acknowledged_bitrate_estimator.IncomingPacketFeedbackVector(feedback);
|
||||||
#endif // !(BWE_TEST_LOGGING_COMPILE_TIME_ENABLE)
|
#endif // !(BWE_TEST_LOGGING_COMPILE_TIME_ENABLE)
|
||||||
for (const PacketFeedback& packet : feedback)
|
for (const PacketFeedback& packet : feedback)
|
||||||
acked_bitrate.Update(packet.payload_size, packet.arrival_time_ms);
|
acked_bitrate.Update(packet.payload_size, packet.arrival_time_ms);
|
||||||
bitrate_bps = acked_bitrate.Rate(feedback.back().arrival_time_ms);
|
bitrate_bps = acked_bitrate.Rate(feedback.back().arrival_time_ms);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
float x = ToCallTimeSec(clock.TimeInMicroseconds());
|
float x = ToCallTimeSec(clock.TimeInMicroseconds());
|
||||||
float y = bitrate_bps.value_or(0) / 1000;
|
float y = bitrate_bps.value_or(0) / 1000;
|
||||||
acked_time_series.points.emplace_back(x, y);
|
acked_time_series.points.emplace_back(x, y);
|
||||||
@ -1161,19 +1173,25 @@ void EventLogAnalyzer::CreateSendSideBweSimulationGraph(Plot* plot) {
|
|||||||
const RtpPacketType& rtp_packet = *rtp_iterator->second;
|
const RtpPacketType& rtp_packet = *rtp_iterator->second;
|
||||||
if (rtp_packet.rtp.header.extension.hasTransportSequenceNumber) {
|
if (rtp_packet.rtp.header.extension.hasTransportSequenceNumber) {
|
||||||
RTC_DCHECK(rtp_packet.rtp.header.extension.hasTransportSequenceNumber);
|
RTC_DCHECK(rtp_packet.rtp.header.extension.hasTransportSequenceNumber);
|
||||||
cc.AddPacket(rtp_packet.rtp.header.ssrc,
|
transport_feedback.AddPacket(
|
||||||
rtp_packet.rtp.header.extension.transportSequenceNumber,
|
rtp_packet.rtp.header.ssrc,
|
||||||
rtp_packet.rtp.total_length, PacedPacketInfo());
|
rtp_packet.rtp.header.extension.transportSequenceNumber,
|
||||||
|
rtp_packet.rtp.total_length, PacedPacketInfo());
|
||||||
rtc::SentPacket sent_packet(
|
rtc::SentPacket sent_packet(
|
||||||
rtp_packet.rtp.header.extension.transportSequenceNumber,
|
rtp_packet.rtp.header.extension.transportSequenceNumber,
|
||||||
rtp_packet.rtp.log_time_us() / 1000);
|
rtp_packet.rtp.log_time_us() / 1000);
|
||||||
cc.OnSentPacket(sent_packet);
|
auto sent_msg = transport_feedback.ProcessSentPacket(sent_packet);
|
||||||
|
if (sent_msg)
|
||||||
|
observer.Update(goog_cc->OnSentPacket(*sent_msg));
|
||||||
}
|
}
|
||||||
++rtp_iterator;
|
++rtp_iterator;
|
||||||
}
|
}
|
||||||
if (clock.TimeInMicroseconds() >= NextProcessTime()) {
|
if (clock.TimeInMicroseconds() >= NextProcessTime()) {
|
||||||
RTC_DCHECK_EQ(clock.TimeInMicroseconds(), NextProcessTime());
|
RTC_DCHECK_EQ(clock.TimeInMicroseconds(), NextProcessTime());
|
||||||
cc.Process();
|
ProcessInterval msg;
|
||||||
|
msg.at_time = Timestamp::us(clock.TimeInMicroseconds());
|
||||||
|
observer.Update(goog_cc->OnProcessInterval(msg));
|
||||||
|
next_process_time_us_ += process_interval.us();
|
||||||
}
|
}
|
||||||
if (observer.GetAndResetBitrateUpdated() ||
|
if (observer.GetAndResetBitrateUpdated() ||
|
||||||
time_us - last_update_us >= 1e6) {
|
time_us - last_update_us >= 1e6) {
|
||||||
|
Reference in New Issue
Block a user