Reland "Create new API for RtcEventLogParser."
The new API stores events gathered by event type. For example, it is possible to ask for a list of all incoming RTCP messages or all audio playout events. The new API is experimental and may change over next few weeks. Once it has stabilized and all unit tests and existing tools have been ported to the new API, the old one will be removed. This CL also updates the event_log_visualizer tool to use the new parser API. This is not a funcional change except for: - Incoming and outgoing audio level are now drawn in two separate plots. - Incoming and outgoing timstamps are now drawn in two separate plots. - RTCP count is no longer split into Video and Audio. It also counts all RTCP packets rather than only specific message types. - Slight timing difference in sendside BWE simulation due to only iterating over transport feedbacks and not over all RTCP packets. This timing changes are not visible in the plots. Media type for RTCP messages might not be identified correctly by rtc_event_log2text anymore. On the other hand, assigning a specific media type to an RTCP packet was a bit hacky to begin with. Bug: webrtc:8111 Change-Id: Ib244338c86a2c1a010c668a7aba440482023b512 Reviewed-on: https://webrtc-review.googlesource.com/73140 Reviewed-by: Sebastian Jansson <srte@webrtc.org> Reviewed-by: Minyue Li <minyue@webrtc.org> Commit-Queue: Björn Terelius <terelius@webrtc.org> Cr-Commit-Position: refs/heads/master@{#23056}
This commit is contained in:

committed by
Commit Bot

parent
ebd9abc1a2
commit
c4ca1d3f37
@ -26,10 +26,6 @@ group("logging") {
|
||||
":rtc_event_rtp_rtcp",
|
||||
":rtc_event_video",
|
||||
]
|
||||
|
||||
if (rtc_enable_protobuf) {
|
||||
deps += [ ":rtc_event_log_parser" ]
|
||||
}
|
||||
}
|
||||
|
||||
rtc_source_set("rtc_event_log_api") {
|
||||
@ -256,6 +252,8 @@ if (rtc_enable_protobuf) {
|
||||
sources = [
|
||||
"rtc_event_log/rtc_event_log_parser.cc",
|
||||
"rtc_event_log/rtc_event_log_parser.h",
|
||||
"rtc_event_log/rtc_event_log_parser_new.cc",
|
||||
"rtc_event_log/rtc_event_log_parser_new.h",
|
||||
]
|
||||
|
||||
deps = [
|
||||
@ -266,6 +264,7 @@ if (rtc_enable_protobuf) {
|
||||
":rtc_event_log_proto",
|
||||
":rtc_stream_config",
|
||||
"..:webrtc_common",
|
||||
"../api:libjingle_peerconnection_api",
|
||||
"../call:video_stream_api",
|
||||
"../modules/audio_coding:audio_network_adaptor",
|
||||
"../modules/remote_bitrate_estimator:remote_bitrate_estimator",
|
||||
@ -366,6 +365,7 @@ if (rtc_enable_protobuf) {
|
||||
"../rtc_base:checks",
|
||||
"../rtc_base:protobuf_utils",
|
||||
"../rtc_base:rtc_base_approved",
|
||||
"../rtc_base:stringutils",
|
||||
|
||||
# TODO(kwiberg): Remove this dependency.
|
||||
"../api/audio_codecs:audio_codecs_api",
|
||||
|
@ -32,7 +32,7 @@
|
||||
#include "logging/rtc_event_log/events/rtc_event_rtp_packet_outgoing.h"
|
||||
#include "logging/rtc_event_log/events/rtc_event_video_receive_stream_config.h"
|
||||
#include "logging/rtc_event_log/events/rtc_event_video_send_stream_config.h"
|
||||
#include "logging/rtc_event_log/rtc_event_log_parser.h"
|
||||
#include "logging/rtc_event_log/rtc_event_log_parser_new.h"
|
||||
#include "modules/audio_coding/audio_network_adaptor/include/audio_network_adaptor_config.h"
|
||||
#include "modules/remote_bitrate_estimator/include/bwe_defines.h"
|
||||
#include "modules/rtp_rtcp/source/rtcp_packet/bye.h" // Arbitrary RTCP message.
|
||||
@ -122,7 +122,7 @@ class RtcEventLogEncoderTest : public testing::TestWithParam<int> {
|
||||
// TODO(eladalon): Once we have more than once possible encoder, parameterize
|
||||
// encoder selection.
|
||||
std::unique_ptr<RtcEventLogEncoder> encoder_;
|
||||
ParsedRtcEventLog parsed_log_;
|
||||
ParsedRtcEventLogNew parsed_log_;
|
||||
Random prng_;
|
||||
};
|
||||
|
||||
@ -140,13 +140,13 @@ void RtcEventLogEncoderTest::TestRtcEventAudioNetworkAdaptation(
|
||||
ASSERT_TRUE(parsed_log_.ParseString(encoded));
|
||||
ASSERT_EQ(parsed_log_.GetNumberOfEvents(), 1u);
|
||||
ASSERT_EQ(parsed_log_.GetEventType(0),
|
||||
ParsedRtcEventLog::AUDIO_NETWORK_ADAPTATION_EVENT);
|
||||
ParsedRtcEventLogNew::AUDIO_NETWORK_ADAPTATION_EVENT);
|
||||
|
||||
AudioEncoderRuntimeConfig parsed_runtime_config;
|
||||
parsed_log_.GetAudioNetworkAdaptation(0, &parsed_runtime_config);
|
||||
LoggedAudioNetworkAdaptationEvent parsed_event =
|
||||
parsed_log_.GetAudioNetworkAdaptation(0);
|
||||
|
||||
EXPECT_EQ(parsed_log_.GetTimestamp(0), timestamp_us);
|
||||
EXPECT_EQ(parsed_runtime_config, original_runtime_config);
|
||||
EXPECT_EQ(parsed_event.timestamp_us, timestamp_us);
|
||||
EXPECT_EQ(parsed_event.config, original_runtime_config);
|
||||
}
|
||||
|
||||
TEST_P(RtcEventLogEncoderTest, RtcEventAudioNetworkAdaptationBitrate) {
|
||||
@ -232,13 +232,12 @@ TEST_P(RtcEventLogEncoderTest, RtcEventAudioPlayout) {
|
||||
ASSERT_TRUE(parsed_log_.ParseString(encoded));
|
||||
ASSERT_EQ(parsed_log_.GetNumberOfEvents(), 1u);
|
||||
ASSERT_EQ(parsed_log_.GetEventType(0),
|
||||
ParsedRtcEventLog::AUDIO_PLAYOUT_EVENT);
|
||||
ParsedRtcEventLogNew::AUDIO_PLAYOUT_EVENT);
|
||||
|
||||
uint32_t parsed_ssrc;
|
||||
parsed_log_.GetAudioPlayout(0, &parsed_ssrc);
|
||||
LoggedAudioPlayoutEvent playout_event = parsed_log_.GetAudioPlayout(0);
|
||||
|
||||
EXPECT_EQ(parsed_log_.GetTimestamp(0), timestamp_us);
|
||||
EXPECT_EQ(parsed_ssrc, ssrc);
|
||||
EXPECT_EQ(playout_event.timestamp_us, timestamp_us);
|
||||
EXPECT_EQ(playout_event.ssrc, ssrc);
|
||||
}
|
||||
|
||||
TEST_P(RtcEventLogEncoderTest, RtcEventAudioReceiveStreamConfig) {
|
||||
@ -262,7 +261,7 @@ TEST_P(RtcEventLogEncoderTest, RtcEventAudioReceiveStreamConfig) {
|
||||
ASSERT_TRUE(parsed_log_.ParseString(encoded));
|
||||
ASSERT_EQ(parsed_log_.GetNumberOfEvents(), 1u);
|
||||
ASSERT_EQ(parsed_log_.GetEventType(0),
|
||||
ParsedRtcEventLog::AUDIO_RECEIVER_CONFIG_EVENT);
|
||||
ParsedRtcEventLogNew::AUDIO_RECEIVER_CONFIG_EVENT);
|
||||
|
||||
auto parsed_event = parsed_log_.GetAudioReceiveConfig(0);
|
||||
EXPECT_EQ(parsed_log_.GetTimestamp(0), timestamp_us);
|
||||
@ -287,7 +286,7 @@ TEST_P(RtcEventLogEncoderTest, RtcEventAudioSendStreamConfig) {
|
||||
ASSERT_TRUE(parsed_log_.ParseString(encoded));
|
||||
ASSERT_EQ(parsed_log_.GetNumberOfEvents(), 1u);
|
||||
ASSERT_EQ(parsed_log_.GetEventType(0),
|
||||
ParsedRtcEventLog::AUDIO_SENDER_CONFIG_EVENT);
|
||||
ParsedRtcEventLogNew::AUDIO_SENDER_CONFIG_EVENT);
|
||||
|
||||
auto parsed_event = parsed_log_.GetAudioSendConfig(0);
|
||||
EXPECT_EQ(parsed_log_.GetTimestamp(0), timestamp_us);
|
||||
@ -307,7 +306,7 @@ TEST_P(RtcEventLogEncoderTest, RtcEventBweUpdateDelayBased) {
|
||||
ASSERT_TRUE(parsed_log_.ParseString(encoded));
|
||||
ASSERT_EQ(parsed_log_.GetNumberOfEvents(), 1u);
|
||||
ASSERT_EQ(parsed_log_.GetEventType(0),
|
||||
ParsedRtcEventLog::DELAY_BASED_BWE_UPDATE);
|
||||
ParsedRtcEventLogNew::DELAY_BASED_BWE_UPDATE);
|
||||
|
||||
auto parsed_event = parsed_log_.GetDelayBasedBweUpdate(0);
|
||||
|
||||
@ -331,18 +330,14 @@ TEST_P(RtcEventLogEncoderTest, RtcEventBweUpdateLossBased) {
|
||||
ASSERT_TRUE(parsed_log_.ParseString(encoded));
|
||||
ASSERT_EQ(parsed_log_.GetNumberOfEvents(), 1u);
|
||||
ASSERT_EQ(parsed_log_.GetEventType(0),
|
||||
ParsedRtcEventLog::LOSS_BASED_BWE_UPDATE);
|
||||
ParsedRtcEventLogNew::LOSS_BASED_BWE_UPDATE);
|
||||
|
||||
int32_t parsed_bitrate_bps;
|
||||
uint8_t parsed_fraction_loss;
|
||||
int32_t parsed_total_packets;
|
||||
parsed_log_.GetLossBasedBweUpdate(
|
||||
0, &parsed_bitrate_bps, &parsed_fraction_loss, &parsed_total_packets);
|
||||
LoggedBweLossBasedUpdate bwe_update = parsed_log_.GetLossBasedBweUpdate(0);
|
||||
|
||||
EXPECT_EQ(parsed_log_.GetTimestamp(0), timestamp_us);
|
||||
EXPECT_EQ(parsed_bitrate_bps, bitrate_bps);
|
||||
EXPECT_EQ(parsed_fraction_loss, fraction_loss);
|
||||
EXPECT_EQ(parsed_total_packets, total_packets);
|
||||
EXPECT_EQ(bwe_update.timestamp_us, timestamp_us);
|
||||
EXPECT_EQ(bwe_update.bitrate_bps, bitrate_bps);
|
||||
EXPECT_EQ(bwe_update.fraction_lost, fraction_loss);
|
||||
EXPECT_EQ(bwe_update.expected_packets, total_packets);
|
||||
}
|
||||
|
||||
TEST_P(RtcEventLogEncoderTest, RtcEventLoggingStarted) {
|
||||
@ -350,7 +345,7 @@ TEST_P(RtcEventLogEncoderTest, RtcEventLoggingStarted) {
|
||||
|
||||
ASSERT_TRUE(parsed_log_.ParseString(encoder_->EncodeLogStart(timestamp_us)));
|
||||
ASSERT_EQ(parsed_log_.GetNumberOfEvents(), 1u);
|
||||
ASSERT_EQ(parsed_log_.GetEventType(0), ParsedRtcEventLog::LOG_START);
|
||||
ASSERT_EQ(parsed_log_.GetEventType(0), ParsedRtcEventLogNew::LOG_START);
|
||||
|
||||
EXPECT_EQ(parsed_log_.GetTimestamp(0), timestamp_us);
|
||||
}
|
||||
@ -360,7 +355,7 @@ TEST_P(RtcEventLogEncoderTest, RtcEventLoggingStopped) {
|
||||
|
||||
ASSERT_TRUE(parsed_log_.ParseString(encoder_->EncodeLogEnd(timestamp_us)));
|
||||
ASSERT_EQ(parsed_log_.GetNumberOfEvents(), 1u);
|
||||
ASSERT_EQ(parsed_log_.GetEventType(0), ParsedRtcEventLog::LOG_END);
|
||||
ASSERT_EQ(parsed_log_.GetEventType(0), ParsedRtcEventLogNew::LOG_END);
|
||||
|
||||
EXPECT_EQ(parsed_log_.GetTimestamp(0), timestamp_us);
|
||||
}
|
||||
@ -380,7 +375,7 @@ TEST_P(RtcEventLogEncoderTest, RtcEventProbeClusterCreated) {
|
||||
ASSERT_TRUE(parsed_log_.ParseString(encoded));
|
||||
ASSERT_EQ(parsed_log_.GetNumberOfEvents(), 1u);
|
||||
ASSERT_EQ(parsed_log_.GetEventType(0),
|
||||
ParsedRtcEventLog::BWE_PROBE_CLUSTER_CREATED_EVENT);
|
||||
ParsedRtcEventLogNew::BWE_PROBE_CLUSTER_CREATED_EVENT);
|
||||
|
||||
auto parsed_event = parsed_log_.GetBweProbeClusterCreated(0);
|
||||
|
||||
@ -404,7 +399,7 @@ TEST_P(RtcEventLogEncoderTest, RtcEventProbeResultFailure) {
|
||||
ASSERT_TRUE(parsed_log_.ParseString(encoded));
|
||||
ASSERT_EQ(parsed_log_.GetNumberOfEvents(), 1u);
|
||||
ASSERT_EQ(parsed_log_.GetEventType(0),
|
||||
ParsedRtcEventLog::BWE_PROBE_RESULT_EVENT);
|
||||
ParsedRtcEventLogNew::BWE_PROBE_RESULT_EVENT);
|
||||
|
||||
auto parsed_event = parsed_log_.GetBweProbeResult(0);
|
||||
|
||||
@ -427,7 +422,7 @@ TEST_P(RtcEventLogEncoderTest, RtcEventProbeResultSuccess) {
|
||||
ASSERT_TRUE(parsed_log_.ParseString(encoded));
|
||||
ASSERT_EQ(parsed_log_.GetNumberOfEvents(), 1u);
|
||||
ASSERT_EQ(parsed_log_.GetEventType(0),
|
||||
ParsedRtcEventLog::BWE_PROBE_RESULT_EVENT);
|
||||
ParsedRtcEventLogNew::BWE_PROBE_RESULT_EVENT);
|
||||
|
||||
auto parsed_event = parsed_log_.GetBweProbeResult(0);
|
||||
|
||||
@ -454,7 +449,7 @@ void RtcEventLogEncoderTest::TestRtcEventRtcpPacket(PacketDirection direction) {
|
||||
std::string encoded = encoder_->EncodeBatch(history_.begin(), history_.end());
|
||||
ASSERT_TRUE(parsed_log_.ParseString(encoded));
|
||||
ASSERT_EQ(parsed_log_.GetNumberOfEvents(), 1u);
|
||||
ASSERT_EQ(parsed_log_.GetEventType(0), ParsedRtcEventLog::RTCP_EVENT);
|
||||
ASSERT_EQ(parsed_log_.GetEventType(0), ParsedRtcEventLogNew::RTCP_EVENT);
|
||||
|
||||
PacketDirection parsed_direction;
|
||||
uint8_t parsed_packet[IP_PACKET_SIZE]; // "Parsed" = after event-encoding.
|
||||
@ -508,7 +503,7 @@ void RtcEventLogEncoderTest::TestRtcEventRtpPacket(PacketDirection direction) {
|
||||
std::string encoded = encoder_->EncodeBatch(history_.begin(), history_.end());
|
||||
ASSERT_TRUE(parsed_log_.ParseString(encoded));
|
||||
ASSERT_EQ(parsed_log_.GetNumberOfEvents(), 1u);
|
||||
ASSERT_EQ(parsed_log_.GetEventType(0), ParsedRtcEventLog::RTP_EVENT);
|
||||
ASSERT_EQ(parsed_log_.GetEventType(0), ParsedRtcEventLogNew::RTP_EVENT);
|
||||
|
||||
PacketDirection parsed_direction;
|
||||
uint8_t parsed_rtp_header[IP_PACKET_SIZE];
|
||||
@ -559,7 +554,7 @@ TEST_P(RtcEventLogEncoderTest, RtcEventVideoReceiveStreamConfig) {
|
||||
ASSERT_TRUE(parsed_log_.ParseString(encoded));
|
||||
ASSERT_EQ(parsed_log_.GetNumberOfEvents(), 1u);
|
||||
ASSERT_EQ(parsed_log_.GetEventType(0),
|
||||
ParsedRtcEventLog::VIDEO_RECEIVER_CONFIG_EVENT);
|
||||
ParsedRtcEventLogNew::VIDEO_RECEIVER_CONFIG_EVENT);
|
||||
|
||||
auto parsed_event = parsed_log_.GetVideoReceiveConfig(0);
|
||||
EXPECT_EQ(parsed_log_.GetTimestamp(0), timestamp_us);
|
||||
@ -585,7 +580,7 @@ TEST_P(RtcEventLogEncoderTest, RtcEventVideoSendStreamConfig) {
|
||||
ASSERT_TRUE(parsed_log_.ParseString(encoded));
|
||||
ASSERT_EQ(parsed_log_.GetNumberOfEvents(), 1u);
|
||||
ASSERT_EQ(parsed_log_.GetEventType(0),
|
||||
ParsedRtcEventLog::VIDEO_SENDER_CONFIG_EVENT);
|
||||
ParsedRtcEventLogNew::VIDEO_SENDER_CONFIG_EVENT);
|
||||
|
||||
auto parsed_event = parsed_log_.GetVideoSendConfig(0)[0];
|
||||
EXPECT_EQ(parsed_log_.GetTimestamp(0), timestamp_us);
|
||||
|
@ -21,6 +21,7 @@
|
||||
|
||||
namespace webrtc {
|
||||
|
||||
// TODO(terelius): Move this to the parser.
|
||||
enum PacketDirection { kIncomingPacket = 0, kOutgoingPacket };
|
||||
|
||||
class RtcEventLog {
|
||||
|
@ -16,7 +16,7 @@
|
||||
#include <string>
|
||||
|
||||
#include "logging/rtc_event_log/rtc_event_log.h"
|
||||
#include "logging/rtc_event_log/rtc_event_log_parser.h"
|
||||
#include "logging/rtc_event_log/rtc_event_log_parser_new.h"
|
||||
#include "modules/rtp_rtcp/source/byte_io.h"
|
||||
#include "modules/rtp_rtcp/source/rtp_utility.h"
|
||||
#include "rtc_base/checks.h"
|
||||
@ -25,7 +25,7 @@
|
||||
|
||||
namespace {
|
||||
|
||||
using MediaType = webrtc::ParsedRtcEventLog::MediaType;
|
||||
using MediaType = webrtc::ParsedRtcEventLogNew::MediaType;
|
||||
|
||||
DEFINE_bool(
|
||||
audio,
|
||||
@ -102,7 +102,7 @@ int main(int argc, char* argv[]) {
|
||||
RTC_CHECK(ParseSsrc(FLAG_ssrc, &ssrc_filter))
|
||||
<< "Flag verification has failed.";
|
||||
|
||||
webrtc::ParsedRtcEventLog parsed_stream;
|
||||
webrtc::ParsedRtcEventLogNew parsed_stream;
|
||||
if (!parsed_stream.ParseFile(input_file)) {
|
||||
std::cerr << "Error while parsing input file: " << input_file << std::endl;
|
||||
return -1;
|
||||
@ -127,8 +127,8 @@ int main(int argc, char* argv[]) {
|
||||
// some required fields and we attempt to access them. We could consider
|
||||
// a softer failure option, but it does not seem useful to generate
|
||||
// RTP dumps based on broken event logs.
|
||||
if (FLAG_rtp &&
|
||||
parsed_stream.GetEventType(i) == webrtc::ParsedRtcEventLog::RTP_EVENT) {
|
||||
if (FLAG_rtp && parsed_stream.GetEventType(i) ==
|
||||
webrtc::ParsedRtcEventLogNew::RTP_EVENT) {
|
||||
webrtc::test::RtpPacket packet;
|
||||
webrtc::PacketDirection direction;
|
||||
parsed_stream.GetRtpHeader(i, &direction, packet.data, &packet.length,
|
||||
@ -166,7 +166,7 @@ int main(int argc, char* argv[]) {
|
||||
rtp_counter++;
|
||||
}
|
||||
if (FLAG_rtcp && parsed_stream.GetEventType(i) ==
|
||||
webrtc::ParsedRtcEventLog::RTCP_EVENT) {
|
||||
webrtc::ParsedRtcEventLogNew::RTCP_EVENT) {
|
||||
webrtc::test::RtpPacket packet;
|
||||
webrtc::PacketDirection direction;
|
||||
parsed_stream.GetRtcpPacket(i, &direction, packet.data, &packet.length);
|
||||
|
@ -13,13 +13,12 @@
|
||||
#include <iomanip> // setfill, setw
|
||||
#include <iostream>
|
||||
#include <map>
|
||||
#include <sstream>
|
||||
#include <string>
|
||||
#include <utility> // pair
|
||||
|
||||
#include "call/video_config.h"
|
||||
#include "common_types.h" // NOLINT(build/include)
|
||||
#include "logging/rtc_event_log/rtc_event_log_parser.h"
|
||||
#include "logging/rtc_event_log/rtc_event_log_parser_new.h"
|
||||
#include "modules/audio_coding/audio_network_adaptor/include/audio_network_adaptor_config.h"
|
||||
#include "modules/rtp_rtcp/source/rtcp_packet/bye.h"
|
||||
#include "modules/rtp_rtcp/source/rtcp_packet/common_header.h"
|
||||
@ -40,6 +39,7 @@
|
||||
#include "rtc_base/checks.h"
|
||||
#include "rtc_base/flags.h"
|
||||
#include "rtc_base/logging.h"
|
||||
#include "rtc_base/strings/string_builder.h"
|
||||
|
||||
namespace {
|
||||
|
||||
@ -73,7 +73,7 @@ DEFINE_string(ssrc,
|
||||
"starting with 0x).");
|
||||
DEFINE_bool(help, false, "Prints this message.");
|
||||
|
||||
using MediaType = webrtc::ParsedRtcEventLog::MediaType;
|
||||
using MediaType = webrtc::ParsedRtcEventLogNew::MediaType;
|
||||
|
||||
static uint32_t filtered_ssrc = 0;
|
||||
|
||||
@ -165,7 +165,7 @@ webrtc::RtpHeaderExtensionMap GetDefaultHeaderExtensionMap() {
|
||||
return default_map;
|
||||
}
|
||||
|
||||
void PrintSenderReport(const webrtc::ParsedRtcEventLog& parsed_stream,
|
||||
void PrintSenderReport(const webrtc::ParsedRtcEventLogNew& parsed_stream,
|
||||
const webrtc::rtcp::CommonHeader& rtcp_block,
|
||||
uint64_t log_timestamp,
|
||||
webrtc::PacketDirection direction) {
|
||||
@ -182,7 +182,7 @@ void PrintSenderReport(const webrtc::ParsedRtcEventLog& parsed_stream,
|
||||
<< "\ttimestamp=" << sr.rtp_timestamp() << std::endl;
|
||||
}
|
||||
|
||||
void PrintReceiverReport(const webrtc::ParsedRtcEventLog& parsed_stream,
|
||||
void PrintReceiverReport(const webrtc::ParsedRtcEventLogNew& parsed_stream,
|
||||
const webrtc::rtcp::CommonHeader& rtcp_block,
|
||||
uint64_t log_timestamp,
|
||||
webrtc::PacketDirection direction) {
|
||||
@ -198,7 +198,7 @@ void PrintReceiverReport(const webrtc::ParsedRtcEventLog& parsed_stream,
|
||||
<< "\tssrc=" << rr.sender_ssrc() << std::endl;
|
||||
}
|
||||
|
||||
void PrintXr(const webrtc::ParsedRtcEventLog& parsed_stream,
|
||||
void PrintXr(const webrtc::ParsedRtcEventLogNew& parsed_stream,
|
||||
const webrtc::rtcp::CommonHeader& rtcp_block,
|
||||
uint64_t log_timestamp,
|
||||
webrtc::PacketDirection direction) {
|
||||
@ -223,7 +223,7 @@ void PrintSdes(const webrtc::rtcp::CommonHeader& rtcp_block,
|
||||
RTC_NOTREACHED() << "SDES should have been redacted when writing the log";
|
||||
}
|
||||
|
||||
void PrintBye(const webrtc::ParsedRtcEventLog& parsed_stream,
|
||||
void PrintBye(const webrtc::ParsedRtcEventLogNew& parsed_stream,
|
||||
const webrtc::rtcp::CommonHeader& rtcp_block,
|
||||
uint64_t log_timestamp,
|
||||
webrtc::PacketDirection direction) {
|
||||
@ -239,7 +239,7 @@ void PrintBye(const webrtc::ParsedRtcEventLog& parsed_stream,
|
||||
<< "\tssrc=" << bye.sender_ssrc() << std::endl;
|
||||
}
|
||||
|
||||
void PrintRtpFeedback(const webrtc::ParsedRtcEventLog& parsed_stream,
|
||||
void PrintRtpFeedback(const webrtc::ParsedRtcEventLogNew& parsed_stream,
|
||||
const webrtc::rtcp::CommonHeader& rtcp_block,
|
||||
uint64_t log_timestamp,
|
||||
webrtc::PacketDirection direction) {
|
||||
@ -319,7 +319,7 @@ void PrintRtpFeedback(const webrtc::ParsedRtcEventLog& parsed_stream,
|
||||
}
|
||||
}
|
||||
|
||||
void PrintPsFeedback(const webrtc::ParsedRtcEventLog& parsed_stream,
|
||||
void PrintPsFeedback(const webrtc::ParsedRtcEventLogNew& parsed_stream,
|
||||
const webrtc::rtcp::CommonHeader& rtcp_block,
|
||||
uint64_t log_timestamp,
|
||||
webrtc::PacketDirection direction) {
|
||||
@ -401,7 +401,7 @@ int main(int argc, char* argv[]) {
|
||||
webrtc::RtpHeaderExtensionMap default_map = GetDefaultHeaderExtensionMap();
|
||||
bool default_map_used = false;
|
||||
|
||||
webrtc::ParsedRtcEventLog parsed_stream;
|
||||
webrtc::ParsedRtcEventLogNew parsed_stream;
|
||||
if (!parsed_stream.ParseFile(input_file)) {
|
||||
std::cerr << "Error while parsing input file: " << input_file << std::endl;
|
||||
return -1;
|
||||
@ -410,7 +410,7 @@ int main(int argc, char* argv[]) {
|
||||
for (size_t i = 0; i < parsed_stream.GetNumberOfEvents(); i++) {
|
||||
bool event_recognized = false;
|
||||
switch (parsed_stream.GetEventType(i)) {
|
||||
case webrtc::ParsedRtcEventLog::UNKNOWN_EVENT: {
|
||||
case webrtc::ParsedRtcEventLogNew::UNKNOWN_EVENT: {
|
||||
if (FLAG_unknown) {
|
||||
std::cout << parsed_stream.GetTimestamp(i) << "\tUNKNOWN_EVENT"
|
||||
<< std::endl;
|
||||
@ -419,7 +419,7 @@ int main(int argc, char* argv[]) {
|
||||
break;
|
||||
}
|
||||
|
||||
case webrtc::ParsedRtcEventLog::LOG_START: {
|
||||
case webrtc::ParsedRtcEventLogNew::LOG_START: {
|
||||
if (FLAG_startstop) {
|
||||
std::cout << parsed_stream.GetTimestamp(i) << "\tLOG_START"
|
||||
<< std::endl;
|
||||
@ -428,7 +428,7 @@ int main(int argc, char* argv[]) {
|
||||
break;
|
||||
}
|
||||
|
||||
case webrtc::ParsedRtcEventLog::LOG_END: {
|
||||
case webrtc::ParsedRtcEventLogNew::LOG_END: {
|
||||
if (FLAG_startstop) {
|
||||
std::cout << parsed_stream.GetTimestamp(i) << "\tLOG_END"
|
||||
<< std::endl;
|
||||
@ -437,13 +437,13 @@ int main(int argc, char* argv[]) {
|
||||
break;
|
||||
}
|
||||
|
||||
case webrtc::ParsedRtcEventLog::RTP_EVENT: {
|
||||
case webrtc::ParsedRtcEventLogNew::RTP_EVENT: {
|
||||
if (FLAG_rtp) {
|
||||
size_t header_length;
|
||||
size_t total_length;
|
||||
uint8_t header[IP_PACKET_SIZE];
|
||||
webrtc::PacketDirection direction;
|
||||
webrtc::RtpHeaderExtensionMap* extension_map =
|
||||
const webrtc::RtpHeaderExtensionMap* extension_map =
|
||||
parsed_stream.GetRtpHeader(i, &direction, header, &header_length,
|
||||
&total_length, nullptr);
|
||||
|
||||
@ -514,7 +514,7 @@ int main(int argc, char* argv[]) {
|
||||
break;
|
||||
}
|
||||
|
||||
case webrtc::ParsedRtcEventLog::RTCP_EVENT: {
|
||||
case webrtc::ParsedRtcEventLogNew::RTCP_EVENT: {
|
||||
if (FLAG_rtcp) {
|
||||
size_t length;
|
||||
uint8_t packet[IP_PACKET_SIZE];
|
||||
@ -581,37 +581,34 @@ int main(int argc, char* argv[]) {
|
||||
break;
|
||||
}
|
||||
|
||||
case webrtc::ParsedRtcEventLog::AUDIO_PLAYOUT_EVENT: {
|
||||
case webrtc::ParsedRtcEventLogNew::AUDIO_PLAYOUT_EVENT: {
|
||||
if (FLAG_playout) {
|
||||
uint32_t ssrc;
|
||||
parsed_stream.GetAudioPlayout(i, &ssrc);
|
||||
std::cout << parsed_stream.GetTimestamp(i) << "\tAUDIO_PLAYOUT"
|
||||
<< "\tssrc=" << ssrc << std::endl;
|
||||
auto audio_playout = parsed_stream.GetAudioPlayout(i);
|
||||
std::cout << audio_playout.log_time_us() << "\tAUDIO_PLAYOUT"
|
||||
<< "\tssrc=" << audio_playout.ssrc << std::endl;
|
||||
}
|
||||
event_recognized = true;
|
||||
break;
|
||||
}
|
||||
|
||||
case webrtc::ParsedRtcEventLog::LOSS_BASED_BWE_UPDATE: {
|
||||
case webrtc::ParsedRtcEventLogNew::LOSS_BASED_BWE_UPDATE: {
|
||||
if (FLAG_bwe) {
|
||||
int32_t bitrate_bps;
|
||||
uint8_t fraction_loss;
|
||||
int32_t total_packets;
|
||||
parsed_stream.GetLossBasedBweUpdate(i, &bitrate_bps, &fraction_loss,
|
||||
&total_packets);
|
||||
std::cout << parsed_stream.GetTimestamp(i) << "\tBWE(LOSS_BASED)"
|
||||
<< "\tbitrate_bps=" << bitrate_bps << "\tfraction_loss="
|
||||
<< static_cast<unsigned>(fraction_loss)
|
||||
<< "\ttotal_packets=" << total_packets << std::endl;
|
||||
auto bwe_update = parsed_stream.GetLossBasedBweUpdate(i);
|
||||
std::cout << bwe_update.log_time_us() << "\tBWE(LOSS_BASED)"
|
||||
<< "\tbitrate_bps=" << bwe_update.bitrate_bps
|
||||
<< "\tfraction_lost="
|
||||
<< static_cast<unsigned>(bwe_update.fraction_lost)
|
||||
<< "\texpected_packets=" << bwe_update.expected_packets
|
||||
<< std::endl;
|
||||
}
|
||||
event_recognized = true;
|
||||
break;
|
||||
}
|
||||
|
||||
case webrtc::ParsedRtcEventLog::DELAY_BASED_BWE_UPDATE: {
|
||||
case webrtc::ParsedRtcEventLogNew::DELAY_BASED_BWE_UPDATE: {
|
||||
if (FLAG_bwe) {
|
||||
auto bwe_update = parsed_stream.GetDelayBasedBweUpdate(i);
|
||||
std::cout << parsed_stream.GetTimestamp(i) << "\tBWE(DELAY_BASED)"
|
||||
std::cout << bwe_update.log_time_us() << "\tBWE(DELAY_BASED)"
|
||||
<< "\tbitrate_bps=" << bwe_update.bitrate_bps
|
||||
<< "\tdetector_state="
|
||||
<< static_cast<int>(bwe_update.detector_state) << std::endl;
|
||||
@ -620,7 +617,7 @@ int main(int argc, char* argv[]) {
|
||||
break;
|
||||
}
|
||||
|
||||
case webrtc::ParsedRtcEventLog::VIDEO_RECEIVER_CONFIG_EVENT: {
|
||||
case webrtc::ParsedRtcEventLogNew::VIDEO_RECEIVER_CONFIG_EVENT: {
|
||||
if (FLAG_config && FLAG_video && FLAG_incoming) {
|
||||
webrtc::rtclog::StreamConfig config =
|
||||
parsed_stream.GetVideoReceiveConfig(i);
|
||||
@ -645,7 +642,7 @@ int main(int argc, char* argv[]) {
|
||||
break;
|
||||
}
|
||||
|
||||
case webrtc::ParsedRtcEventLog::VIDEO_SENDER_CONFIG_EVENT: {
|
||||
case webrtc::ParsedRtcEventLogNew::VIDEO_SENDER_CONFIG_EVENT: {
|
||||
if (FLAG_config && FLAG_video && FLAG_outgoing) {
|
||||
std::vector<webrtc::rtclog::StreamConfig> configs =
|
||||
parsed_stream.GetVideoSendConfig(i);
|
||||
@ -672,7 +669,7 @@ int main(int argc, char* argv[]) {
|
||||
break;
|
||||
}
|
||||
|
||||
case webrtc::ParsedRtcEventLog::AUDIO_RECEIVER_CONFIG_EVENT: {
|
||||
case webrtc::ParsedRtcEventLogNew::AUDIO_RECEIVER_CONFIG_EVENT: {
|
||||
if (FLAG_config && FLAG_audio && FLAG_incoming) {
|
||||
webrtc::rtclog::StreamConfig config =
|
||||
parsed_stream.GetAudioReceiveConfig(i);
|
||||
@ -697,7 +694,7 @@ int main(int argc, char* argv[]) {
|
||||
break;
|
||||
}
|
||||
|
||||
case webrtc::ParsedRtcEventLog::AUDIO_SENDER_CONFIG_EVENT: {
|
||||
case webrtc::ParsedRtcEventLogNew::AUDIO_SENDER_CONFIG_EVENT: {
|
||||
if (FLAG_config && FLAG_audio && FLAG_outgoing) {
|
||||
webrtc::rtclog::StreamConfig config =
|
||||
parsed_stream.GetAudioSendConfig(i);
|
||||
@ -721,41 +718,41 @@ int main(int argc, char* argv[]) {
|
||||
break;
|
||||
}
|
||||
|
||||
case webrtc::ParsedRtcEventLog::AUDIO_NETWORK_ADAPTATION_EVENT: {
|
||||
case webrtc::ParsedRtcEventLogNew::AUDIO_NETWORK_ADAPTATION_EVENT: {
|
||||
if (FLAG_ana) {
|
||||
webrtc::AudioEncoderRuntimeConfig ana_config;
|
||||
parsed_stream.GetAudioNetworkAdaptation(i, &ana_config);
|
||||
std::stringstream ss;
|
||||
ss << parsed_stream.GetTimestamp(i) << "\tANA_UPDATE";
|
||||
if (ana_config.bitrate_bps) {
|
||||
ss << "\tbitrate_bps=" << *ana_config.bitrate_bps;
|
||||
auto ana_event = parsed_stream.GetAudioNetworkAdaptation(i);
|
||||
char buffer[300];
|
||||
rtc::SimpleStringBuilder builder(buffer);
|
||||
builder << parsed_stream.GetTimestamp(i) << "\tANA_UPDATE";
|
||||
if (ana_event.config.bitrate_bps) {
|
||||
builder << "\tbitrate_bps=" << *ana_event.config.bitrate_bps;
|
||||
}
|
||||
if (ana_config.frame_length_ms) {
|
||||
ss << "\tframe_length_ms=" << *ana_config.frame_length_ms;
|
||||
if (ana_event.config.frame_length_ms) {
|
||||
builder << "\tframe_length_ms="
|
||||
<< *ana_event.config.frame_length_ms;
|
||||
}
|
||||
if (ana_config.uplink_packet_loss_fraction) {
|
||||
ss << "\tuplink_packet_loss_fraction="
|
||||
<< *ana_config.uplink_packet_loss_fraction;
|
||||
if (ana_event.config.uplink_packet_loss_fraction) {
|
||||
builder << "\tuplink_packet_loss_fraction="
|
||||
<< *ana_event.config.uplink_packet_loss_fraction;
|
||||
}
|
||||
if (ana_config.enable_fec) {
|
||||
ss << "\tenable_fec=" << *ana_config.enable_fec;
|
||||
if (ana_event.config.enable_fec) {
|
||||
builder << "\tenable_fec=" << *ana_event.config.enable_fec;
|
||||
}
|
||||
if (ana_config.enable_dtx) {
|
||||
ss << "\tenable_dtx=" << *ana_config.enable_dtx;
|
||||
if (ana_event.config.enable_dtx) {
|
||||
builder << "\tenable_dtx=" << *ana_event.config.enable_dtx;
|
||||
}
|
||||
if (ana_config.num_channels) {
|
||||
ss << "\tnum_channels=" << *ana_config.num_channels;
|
||||
if (ana_event.config.num_channels) {
|
||||
builder << "\tnum_channels=" << *ana_event.config.num_channels;
|
||||
}
|
||||
std::cout << ss.str() << std::endl;
|
||||
std::cout << builder.str() << std::endl;
|
||||
}
|
||||
event_recognized = true;
|
||||
break;
|
||||
}
|
||||
|
||||
case webrtc::ParsedRtcEventLog::BWE_PROBE_CLUSTER_CREATED_EVENT: {
|
||||
case webrtc::ParsedRtcEventLogNew::BWE_PROBE_CLUSTER_CREATED_EVENT: {
|
||||
if (FLAG_probe) {
|
||||
webrtc::ParsedRtcEventLog::BweProbeClusterCreatedEvent probe_event =
|
||||
parsed_stream.GetBweProbeClusterCreated(i);
|
||||
auto probe_event = parsed_stream.GetBweProbeClusterCreated(i);
|
||||
std::cout << parsed_stream.GetTimestamp(i) << "\tPROBE_CREATED("
|
||||
<< probe_event.id << ")"
|
||||
<< "\tbitrate_bps=" << probe_event.bitrate_bps
|
||||
@ -766,9 +763,9 @@ int main(int argc, char* argv[]) {
|
||||
break;
|
||||
}
|
||||
|
||||
case webrtc::ParsedRtcEventLog::BWE_PROBE_RESULT_EVENT: {
|
||||
case webrtc::ParsedRtcEventLogNew::BWE_PROBE_RESULT_EVENT: {
|
||||
if (FLAG_probe) {
|
||||
webrtc::ParsedRtcEventLog::BweProbeResultEvent probe_result =
|
||||
webrtc::LoggedBweProbeResultEvent probe_result =
|
||||
parsed_stream.GetBweProbeResult(i);
|
||||
if (probe_result.failure_reason) {
|
||||
std::cout << parsed_stream.GetTimestamp(i) << "\tPROBE_SUCCESS("
|
||||
@ -787,10 +784,9 @@ int main(int argc, char* argv[]) {
|
||||
break;
|
||||
}
|
||||
|
||||
case webrtc::ParsedRtcEventLog::ALR_STATE_EVENT: {
|
||||
case webrtc::ParsedRtcEventLogNew::ALR_STATE_EVENT: {
|
||||
if (FLAG_bwe) {
|
||||
webrtc::ParsedRtcEventLog::AlrStateEvent alr_state =
|
||||
parsed_stream.GetAlrState(i);
|
||||
webrtc::LoggedAlrStateEvent alr_state = parsed_stream.GetAlrState(i);
|
||||
std::cout << parsed_stream.GetTimestamp(i) << "\tALR_STATE"
|
||||
<< "\tin_alr=" << alr_state.in_alr << std::endl;
|
||||
}
|
||||
@ -798,9 +794,9 @@ int main(int argc, char* argv[]) {
|
||||
break;
|
||||
}
|
||||
|
||||
case webrtc::ParsedRtcEventLog::ICE_CANDIDATE_PAIR_CONFIG: {
|
||||
case webrtc::ParsedRtcEventLogNew::ICE_CANDIDATE_PAIR_CONFIG: {
|
||||
if (FLAG_ice) {
|
||||
webrtc::ParsedRtcEventLog::IceCandidatePairConfig ice_cp_config =
|
||||
webrtc::LoggedIceCandidatePairConfig ice_cp_config =
|
||||
parsed_stream.GetIceCandidatePairConfig(i);
|
||||
// TODO(qingsi): convert the numeric representation of states to text
|
||||
std::cout << parsed_stream.GetTimestamp(i)
|
||||
@ -812,9 +808,9 @@ int main(int argc, char* argv[]) {
|
||||
break;
|
||||
}
|
||||
|
||||
case webrtc::ParsedRtcEventLog::ICE_CANDIDATE_PAIR_EVENT: {
|
||||
case webrtc::ParsedRtcEventLogNew::ICE_CANDIDATE_PAIR_EVENT: {
|
||||
if (FLAG_ice) {
|
||||
webrtc::ParsedRtcEventLog::IceCandidatePairEvent ice_cp_event =
|
||||
webrtc::LoggedIceCandidatePairEvent ice_cp_event =
|
||||
parsed_stream.GetIceCandidatePairEvent(i);
|
||||
// TODO(qingsi): convert the numeric representation of states to text
|
||||
std::cout << parsed_stream.GetTimestamp(i)
|
||||
|
1252
logging/rtc_event_log/rtc_event_log_parser_new.cc
Normal file
1252
logging/rtc_event_log/rtc_event_log_parser_new.cc
Normal file
File diff suppressed because it is too large
Load Diff
920
logging/rtc_event_log/rtc_event_log_parser_new.h
Normal file
920
logging/rtc_event_log/rtc_event_log_parser_new.h
Normal file
@ -0,0 +1,920 @@
|
||||
/*
|
||||
* Copyright (c) 2016 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 LOGGING_RTC_EVENT_LOG_RTC_EVENT_LOG_PARSER_NEW_H_
|
||||
#define LOGGING_RTC_EVENT_LOG_RTC_EVENT_LOG_PARSER_NEW_H_
|
||||
|
||||
#include <iterator>
|
||||
#include <map>
|
||||
#include <set>
|
||||
#include <string>
|
||||
#include <utility> // pair
|
||||
#include <vector>
|
||||
|
||||
#include "call/video_receive_stream.h"
|
||||
#include "call/video_send_stream.h"
|
||||
#include "logging/rtc_event_log/events/rtc_event_ice_candidate_pair.h"
|
||||
#include "logging/rtc_event_log/events/rtc_event_ice_candidate_pair_config.h"
|
||||
#include "logging/rtc_event_log/events/rtc_event_probe_result_failure.h"
|
||||
#include "logging/rtc_event_log/rtc_event_log.h"
|
||||
#include "logging/rtc_event_log/rtc_stream_config.h"
|
||||
#include "modules/audio_coding/audio_network_adaptor/include/audio_network_adaptor.h"
|
||||
#include "modules/rtp_rtcp/include/rtp_header_extension_map.h"
|
||||
#include "modules/rtp_rtcp/source/rtcp_packet/common_header.h"
|
||||
#include "modules/rtp_rtcp/source/rtcp_packet/nack.h"
|
||||
#include "modules/rtp_rtcp/source/rtcp_packet/receiver_report.h"
|
||||
#include "modules/rtp_rtcp/source/rtcp_packet/remb.h"
|
||||
#include "modules/rtp_rtcp/source/rtcp_packet/sender_report.h"
|
||||
#include "modules/rtp_rtcp/source/rtcp_packet/transport_feedback.h"
|
||||
#include "rtc_base/ignore_wundef.h"
|
||||
|
||||
// Files generated at build-time by the protobuf compiler.
|
||||
RTC_PUSH_IGNORING_WUNDEF()
|
||||
#ifdef WEBRTC_ANDROID_PLATFORM_BUILD
|
||||
#include "external/webrtc/webrtc/logging/rtc_event_log/rtc_event_log.pb.h"
|
||||
#else
|
||||
#include "logging/rtc_event_log/rtc_event_log.pb.h"
|
||||
#endif
|
||||
RTC_POP_IGNORING_WUNDEF()
|
||||
|
||||
namespace webrtc {
|
||||
|
||||
enum class BandwidthUsage;
|
||||
struct AudioEncoderRuntimeConfig;
|
||||
|
||||
struct LoggedAlrStateEvent {
|
||||
int64_t timestamp_us;
|
||||
bool in_alr;
|
||||
int64_t log_time_us() const { return timestamp_us; }
|
||||
int64_t log_time_ms() const { return timestamp_us / 1000; }
|
||||
};
|
||||
|
||||
struct LoggedAudioPlayoutEvent {
|
||||
int64_t timestamp_us;
|
||||
uint32_t ssrc;
|
||||
int64_t log_time_us() const { return timestamp_us; }
|
||||
int64_t log_time_ms() const { return timestamp_us / 1000; }
|
||||
};
|
||||
|
||||
struct LoggedAudioNetworkAdaptationEvent {
|
||||
int64_t timestamp_us;
|
||||
AudioEncoderRuntimeConfig config;
|
||||
int64_t log_time_us() const { return timestamp_us; }
|
||||
int64_t log_time_ms() const { return timestamp_us / 1000; }
|
||||
};
|
||||
|
||||
struct LoggedBweDelayBasedUpdate {
|
||||
int64_t timestamp_us;
|
||||
int32_t bitrate_bps;
|
||||
BandwidthUsage detector_state;
|
||||
int64_t log_time_us() const { return timestamp_us; }
|
||||
int64_t log_time_ms() const { return timestamp_us / 1000; }
|
||||
};
|
||||
|
||||
struct LoggedBweLossBasedUpdate {
|
||||
int64_t timestamp_us;
|
||||
int32_t bitrate_bps;
|
||||
uint8_t fraction_lost;
|
||||
int32_t expected_packets;
|
||||
int64_t log_time_us() const { return timestamp_us; }
|
||||
int64_t log_time_ms() const { return timestamp_us / 1000; }
|
||||
};
|
||||
|
||||
struct LoggedBweProbeClusterCreatedEvent {
|
||||
int64_t timestamp_us;
|
||||
uint32_t id;
|
||||
uint64_t bitrate_bps;
|
||||
uint32_t min_packets;
|
||||
uint32_t min_bytes;
|
||||
int64_t log_time_us() const { return timestamp_us; }
|
||||
int64_t log_time_ms() const { return timestamp_us / 1000; }
|
||||
};
|
||||
|
||||
struct LoggedBweProbeResultEvent {
|
||||
int64_t timestamp_us;
|
||||
uint32_t id;
|
||||
rtc::Optional<uint64_t> bitrate_bps;
|
||||
rtc::Optional<ProbeFailureReason> failure_reason;
|
||||
int64_t log_time_us() const { return timestamp_us; }
|
||||
int64_t log_time_ms() const { return timestamp_us / 1000; }
|
||||
};
|
||||
|
||||
struct LoggedIceCandidatePairConfig {
|
||||
int64_t timestamp_us;
|
||||
IceCandidatePairEventType type;
|
||||
uint32_t candidate_pair_id;
|
||||
IceCandidateType local_candidate_type;
|
||||
IceCandidatePairProtocol local_relay_protocol;
|
||||
IceCandidateNetworkType local_network_type;
|
||||
IceCandidatePairAddressFamily local_address_family;
|
||||
IceCandidateType remote_candidate_type;
|
||||
IceCandidatePairAddressFamily remote_address_family;
|
||||
IceCandidatePairProtocol candidate_pair_protocol;
|
||||
int64_t log_time_us() const { return timestamp_us; }
|
||||
int64_t log_time_ms() const { return timestamp_us / 1000; }
|
||||
};
|
||||
|
||||
struct LoggedIceCandidatePairEvent {
|
||||
int64_t timestamp_us;
|
||||
IceCandidatePairEventType type;
|
||||
uint32_t candidate_pair_id;
|
||||
int64_t log_time_us() const { return timestamp_us; }
|
||||
int64_t log_time_ms() const { return timestamp_us / 1000; }
|
||||
};
|
||||
|
||||
struct LoggedRtpPacket {
|
||||
LoggedRtpPacket(uint64_t timestamp_us,
|
||||
RTPHeader header,
|
||||
size_t header_length,
|
||||
size_t total_length)
|
||||
: timestamp_us(timestamp_us),
|
||||
header(header),
|
||||
header_length(header_length),
|
||||
total_length(total_length) {}
|
||||
int64_t timestamp_us;
|
||||
// TODO(terelius): This allocates space for 15 CSRCs even if none are used.
|
||||
RTPHeader header;
|
||||
size_t header_length;
|
||||
size_t total_length;
|
||||
int64_t log_time_us() const { return timestamp_us; }
|
||||
int64_t log_time_ms() const { return timestamp_us / 1000; }
|
||||
};
|
||||
|
||||
struct LoggedRtpPacketIncoming {
|
||||
LoggedRtpPacketIncoming(uint64_t timestamp_us,
|
||||
RTPHeader header,
|
||||
size_t header_length,
|
||||
size_t total_length)
|
||||
: rtp(timestamp_us, header, header_length, total_length) {}
|
||||
LoggedRtpPacket rtp;
|
||||
int64_t log_time_us() const { return rtp.timestamp_us; }
|
||||
int64_t log_time_ms() const { return rtp.timestamp_us / 1000; }
|
||||
};
|
||||
|
||||
struct LoggedRtpPacketOutgoing {
|
||||
LoggedRtpPacketOutgoing(uint64_t timestamp_us,
|
||||
RTPHeader header,
|
||||
size_t header_length,
|
||||
size_t total_length)
|
||||
: rtp(timestamp_us, header, header_length, total_length) {}
|
||||
LoggedRtpPacket rtp;
|
||||
int64_t log_time_us() const { return rtp.timestamp_us; }
|
||||
int64_t log_time_ms() const { return rtp.timestamp_us / 1000; }
|
||||
};
|
||||
|
||||
struct LoggedRtcpPacket {
|
||||
LoggedRtcpPacket(uint64_t timestamp_us,
|
||||
const uint8_t* packet,
|
||||
size_t total_length)
|
||||
: timestamp_us(timestamp_us), raw_data(packet, packet + total_length) {}
|
||||
int64_t timestamp_us;
|
||||
std::vector<uint8_t> raw_data;
|
||||
int64_t log_time_us() const { return timestamp_us; }
|
||||
int64_t log_time_ms() const { return timestamp_us / 1000; }
|
||||
};
|
||||
|
||||
struct LoggedRtcpPacketIncoming {
|
||||
LoggedRtcpPacketIncoming(uint64_t timestamp_us,
|
||||
const uint8_t* packet,
|
||||
size_t total_length)
|
||||
: rtcp(timestamp_us, packet, total_length) {}
|
||||
LoggedRtcpPacket rtcp;
|
||||
int64_t log_time_us() const { return rtcp.timestamp_us; }
|
||||
int64_t log_time_ms() const { return rtcp.timestamp_us / 1000; }
|
||||
};
|
||||
|
||||
struct LoggedRtcpPacketOutgoing {
|
||||
LoggedRtcpPacketOutgoing(uint64_t timestamp_us,
|
||||
const uint8_t* packet,
|
||||
size_t total_length)
|
||||
: rtcp(timestamp_us, packet, total_length) {}
|
||||
LoggedRtcpPacket rtcp;
|
||||
int64_t log_time_us() const { return rtcp.timestamp_us; }
|
||||
int64_t log_time_ms() const { return rtcp.timestamp_us / 1000; }
|
||||
};
|
||||
|
||||
struct LoggedRtcpPacketReceiverReport {
|
||||
int64_t timestamp_us;
|
||||
rtcp::ReceiverReport rr;
|
||||
int64_t log_time_us() const { return timestamp_us; }
|
||||
int64_t log_time_ms() const { return timestamp_us / 1000; }
|
||||
};
|
||||
|
||||
struct LoggedRtcpPacketSenderReport {
|
||||
int64_t timestamp_us;
|
||||
rtcp::SenderReport sr;
|
||||
int64_t log_time_us() const { return timestamp_us; }
|
||||
int64_t log_time_ms() const { return timestamp_us / 1000; }
|
||||
};
|
||||
|
||||
struct LoggedRtcpPacketRemb {
|
||||
int64_t timestamp_us;
|
||||
rtcp::Remb remb;
|
||||
int64_t log_time_us() const { return timestamp_us; }
|
||||
int64_t log_time_ms() const { return timestamp_us / 1000; }
|
||||
};
|
||||
|
||||
struct LoggedRtcpPacketNack {
|
||||
int64_t timestamp_us;
|
||||
rtcp::Nack nack;
|
||||
int64_t log_time_us() const { return timestamp_us; }
|
||||
int64_t log_time_ms() const { return timestamp_us / 1000; }
|
||||
};
|
||||
|
||||
struct LoggedRtcpPacketTransportFeedback {
|
||||
int64_t timestamp_us;
|
||||
rtcp::TransportFeedback transport_feedback;
|
||||
int64_t log_time_us() const { return timestamp_us; }
|
||||
int64_t log_time_ms() const { return timestamp_us / 1000; }
|
||||
};
|
||||
|
||||
struct LoggedStartEvent {
|
||||
explicit LoggedStartEvent(uint64_t timestamp_us)
|
||||
: timestamp_us(timestamp_us) {}
|
||||
int64_t timestamp_us;
|
||||
int64_t log_time_us() const { return timestamp_us; }
|
||||
int64_t log_time_ms() const { return timestamp_us / 1000; }
|
||||
};
|
||||
|
||||
struct LoggedStopEvent {
|
||||
explicit LoggedStopEvent(uint64_t timestamp_us)
|
||||
: timestamp_us(timestamp_us) {}
|
||||
int64_t timestamp_us;
|
||||
int64_t log_time_us() const { return timestamp_us; }
|
||||
int64_t log_time_ms() const { return timestamp_us / 1000; }
|
||||
};
|
||||
|
||||
struct LoggedAudioRecvConfig {
|
||||
LoggedAudioRecvConfig(int64_t timestamp_us, const rtclog::StreamConfig config)
|
||||
: timestamp_us(timestamp_us), config(config) {}
|
||||
int64_t timestamp_us;
|
||||
rtclog::StreamConfig config;
|
||||
int64_t log_time_us() const { return timestamp_us; }
|
||||
int64_t log_time_ms() const { return timestamp_us / 1000; }
|
||||
};
|
||||
|
||||
struct LoggedAudioSendConfig {
|
||||
LoggedAudioSendConfig(int64_t timestamp_us, const rtclog::StreamConfig config)
|
||||
: timestamp_us(timestamp_us), config(config) {}
|
||||
int64_t timestamp_us;
|
||||
rtclog::StreamConfig config;
|
||||
int64_t log_time_us() const { return timestamp_us; }
|
||||
int64_t log_time_ms() const { return timestamp_us / 1000; }
|
||||
};
|
||||
|
||||
struct LoggedVideoRecvConfig {
|
||||
LoggedVideoRecvConfig(int64_t timestamp_us, const rtclog::StreamConfig config)
|
||||
: timestamp_us(timestamp_us), config(config) {}
|
||||
int64_t timestamp_us;
|
||||
rtclog::StreamConfig config;
|
||||
int64_t log_time_us() const { return timestamp_us; }
|
||||
int64_t log_time_ms() const { return timestamp_us / 1000; }
|
||||
};
|
||||
|
||||
struct LoggedVideoSendConfig {
|
||||
LoggedVideoSendConfig(int64_t timestamp_us,
|
||||
const std::vector<rtclog::StreamConfig> configs)
|
||||
: timestamp_us(timestamp_us), configs(configs) {}
|
||||
int64_t timestamp_us;
|
||||
std::vector<rtclog::StreamConfig> configs;
|
||||
int64_t log_time_us() const { return timestamp_us; }
|
||||
int64_t log_time_ms() const { return timestamp_us / 1000; }
|
||||
};
|
||||
|
||||
template <typename T>
|
||||
class PacketView;
|
||||
|
||||
template <typename T>
|
||||
class PacketIterator {
|
||||
friend class PacketView<T>;
|
||||
|
||||
public:
|
||||
// Standard iterator traits.
|
||||
using difference_type = std::ptrdiff_t;
|
||||
using value_type = T;
|
||||
using pointer = T*;
|
||||
using reference = T&;
|
||||
using iterator_category = std::bidirectional_iterator_tag;
|
||||
|
||||
// The default-contructed iterator is meaningless, but is required by the
|
||||
// ForwardIterator concept.
|
||||
PacketIterator() : ptr_(nullptr), element_size_(0) {}
|
||||
PacketIterator(const PacketIterator& other)
|
||||
: ptr_(other.ptr_), element_size_(other.element_size_) {}
|
||||
PacketIterator(const PacketIterator&& other)
|
||||
: ptr_(other.ptr_), element_size_(other.element_size_) {}
|
||||
~PacketIterator() = default;
|
||||
|
||||
PacketIterator& operator=(const PacketIterator& other) {
|
||||
ptr_ = other.ptr_;
|
||||
element_size_ = other.element_size_;
|
||||
return *this;
|
||||
}
|
||||
PacketIterator& operator=(const PacketIterator&& other) {
|
||||
ptr_ = other.ptr_;
|
||||
element_size_ = other.element_size_;
|
||||
return *this;
|
||||
}
|
||||
|
||||
bool operator==(const PacketIterator<T>& other) const {
|
||||
RTC_DCHECK_EQ(element_size_, other.element_size_);
|
||||
return ptr_ == other.ptr_;
|
||||
}
|
||||
bool operator!=(const PacketIterator<T>& other) const {
|
||||
RTC_DCHECK_EQ(element_size_, other.element_size_);
|
||||
return ptr_ != other.ptr_;
|
||||
}
|
||||
|
||||
PacketIterator& operator++() {
|
||||
ptr_ += element_size_;
|
||||
return *this;
|
||||
}
|
||||
PacketIterator& operator--() {
|
||||
ptr_ -= element_size_;
|
||||
return *this;
|
||||
}
|
||||
PacketIterator operator++(int) {
|
||||
PacketIterator iter_copy(ptr_, element_size_);
|
||||
ptr_ += element_size_;
|
||||
return iter_copy;
|
||||
}
|
||||
PacketIterator operator--(int) {
|
||||
PacketIterator iter_copy(ptr_, element_size_);
|
||||
ptr_ -= element_size_;
|
||||
return iter_copy;
|
||||
}
|
||||
|
||||
T& operator*() { return *reinterpret_cast<T*>(ptr_); }
|
||||
const T& operator*() const { return *reinterpret_cast<const T*>(ptr_); }
|
||||
|
||||
private:
|
||||
PacketIterator(typename std::conditional<std::is_const<T>::value,
|
||||
const void*,
|
||||
void*>::type p,
|
||||
size_t s)
|
||||
: ptr_(reinterpret_cast<decltype(ptr_)>(p)), element_size_(s) {}
|
||||
|
||||
typename std::conditional<std::is_const<T>::value, const char*, char*>::type
|
||||
ptr_;
|
||||
size_t element_size_;
|
||||
};
|
||||
|
||||
// Suppose that we have a struct S where we are only interested in a specific
|
||||
// member M. Given an array of S, PacketView can be used to treat the array
|
||||
// as an array of M, without exposing the type S to surrounding code and without
|
||||
// accessing the member through a virtual function. In this case, we want to
|
||||
// have a common view for incoming and outgoing RtpPackets, hence the PacketView
|
||||
// name.
|
||||
// Note that constructing a PacketView bypasses the typesystem, so the caller
|
||||
// has to take extra care when constructing these objects. The implementation
|
||||
// also requires that the containing struct is standard-layout (e.g. POD).
|
||||
//
|
||||
// Usage example:
|
||||
// struct A {...};
|
||||
// struct B { A a; ...};
|
||||
// struct C { A a; ...};
|
||||
// size_t len = 10;
|
||||
// B* array1 = new B[len];
|
||||
// C* array2 = new C[len];
|
||||
//
|
||||
// PacketView<A> view1 = PacketView<A>::Create<B>(array1, len, offsetof(B, a));
|
||||
// PacketView<A> view2 = PacketView<A>::Create<C>(array2, len, offsetof(C, a));
|
||||
//
|
||||
// The following code works with either view1 or view2.
|
||||
// void f(PacketView<A> view)
|
||||
// for (A& a : view) {
|
||||
// DoSomething(a);
|
||||
// }
|
||||
template <typename T>
|
||||
class PacketView {
|
||||
public:
|
||||
template <typename U>
|
||||
static PacketView Create(U* ptr, size_t num_elements, size_t offset) {
|
||||
static_assert(std::is_standard_layout<U>::value,
|
||||
"PacketView can only be created for standard layout types.");
|
||||
static_assert(std::is_standard_layout<T>::value,
|
||||
"PacketView can only be created for standard layout types.");
|
||||
return PacketView(ptr, num_elements, offset, sizeof(U));
|
||||
}
|
||||
|
||||
using iterator = PacketIterator<T>;
|
||||
using const_iterator = PacketIterator<const T>;
|
||||
using reverse_iterator = std::reverse_iterator<iterator>;
|
||||
using const_reverse_iterator = std::reverse_iterator<const_iterator>;
|
||||
|
||||
iterator begin() { return iterator(data_, element_size_); }
|
||||
iterator end() {
|
||||
auto end_ptr = data_ + num_elements_ * element_size_;
|
||||
return iterator(end_ptr, element_size_);
|
||||
}
|
||||
|
||||
const_iterator begin() const { return const_iterator(data_, element_size_); }
|
||||
const_iterator end() const {
|
||||
auto end_ptr = data_ + num_elements_ * element_size_;
|
||||
return const_iterator(end_ptr, element_size_);
|
||||
}
|
||||
|
||||
reverse_iterator rbegin() { return reverse_iterator(end()); }
|
||||
reverse_iterator rend() { return reverse_iterator(begin()); }
|
||||
|
||||
const_reverse_iterator rbegin() const {
|
||||
return const_reverse_iterator(end());
|
||||
}
|
||||
const_reverse_iterator rend() const {
|
||||
return const_reverse_iterator(begin());
|
||||
}
|
||||
|
||||
size_t size() const { return num_elements_; }
|
||||
|
||||
T& operator[](size_t i) {
|
||||
auto elem_ptr = data_ + i * element_size_;
|
||||
return *reinterpret_cast<T*>(elem_ptr);
|
||||
}
|
||||
|
||||
const T& operator[](size_t i) const {
|
||||
auto elem_ptr = data_ + i * element_size_;
|
||||
return *reinterpret_cast<const T*>(elem_ptr);
|
||||
}
|
||||
|
||||
private:
|
||||
PacketView(typename std::conditional<std::is_const<T>::value,
|
||||
const void*,
|
||||
void*>::type data,
|
||||
size_t num_elements,
|
||||
size_t offset,
|
||||
size_t element_size)
|
||||
: data_(reinterpret_cast<decltype(data_)>(data) + offset),
|
||||
num_elements_(num_elements),
|
||||
element_size_(element_size) {}
|
||||
|
||||
typename std::conditional<std::is_const<T>::value, const char*, char*>::type
|
||||
data_;
|
||||
size_t num_elements_;
|
||||
size_t element_size_;
|
||||
};
|
||||
|
||||
class ParsedRtcEventLogNew {
|
||||
friend class RtcEventLogTestHelper;
|
||||
|
||||
public:
|
||||
enum EventType {
|
||||
UNKNOWN_EVENT = 0,
|
||||
LOG_START = 1,
|
||||
LOG_END = 2,
|
||||
RTP_EVENT = 3,
|
||||
RTCP_EVENT = 4,
|
||||
AUDIO_PLAYOUT_EVENT = 5,
|
||||
LOSS_BASED_BWE_UPDATE = 6,
|
||||
DELAY_BASED_BWE_UPDATE = 7,
|
||||
VIDEO_RECEIVER_CONFIG_EVENT = 8,
|
||||
VIDEO_SENDER_CONFIG_EVENT = 9,
|
||||
AUDIO_RECEIVER_CONFIG_EVENT = 10,
|
||||
AUDIO_SENDER_CONFIG_EVENT = 11,
|
||||
AUDIO_NETWORK_ADAPTATION_EVENT = 16,
|
||||
BWE_PROBE_CLUSTER_CREATED_EVENT = 17,
|
||||
BWE_PROBE_RESULT_EVENT = 18,
|
||||
ALR_STATE_EVENT = 19,
|
||||
ICE_CANDIDATE_PAIR_CONFIG = 20,
|
||||
ICE_CANDIDATE_PAIR_EVENT = 21,
|
||||
};
|
||||
|
||||
enum class MediaType { ANY, AUDIO, VIDEO, DATA };
|
||||
enum class UnconfiguredHeaderExtensions {
|
||||
kDontParse,
|
||||
kAttemptWebrtcDefaultConfig
|
||||
};
|
||||
|
||||
explicit ParsedRtcEventLogNew(
|
||||
UnconfiguredHeaderExtensions parse_unconfigured_header_extensions =
|
||||
UnconfiguredHeaderExtensions::kDontParse);
|
||||
|
||||
// Clears previously parsed events and resets the ParsedRtcEventLogNew to an
|
||||
// empty state.
|
||||
void Clear();
|
||||
|
||||
// Reads an RtcEventLog file and returns true if parsing was successful.
|
||||
bool ParseFile(const std::string& file_name);
|
||||
|
||||
// Reads an RtcEventLog from a string and returns true if successful.
|
||||
bool ParseString(const std::string& s);
|
||||
|
||||
// Reads an RtcEventLog from an istream and returns true if successful.
|
||||
bool ParseStream(
|
||||
std::istream& stream); // no-presubmit-check TODO(webrtc:8982)
|
||||
|
||||
// Returns the number of events in an EventStream.
|
||||
size_t GetNumberOfEvents() const;
|
||||
|
||||
// Reads the arrival timestamp (in microseconds) from a rtclog::Event.
|
||||
int64_t GetTimestamp(size_t index) const;
|
||||
int64_t GetTimestamp(const rtclog::Event& event) const;
|
||||
|
||||
// Reads the event type of the rtclog::Event at |index|.
|
||||
EventType GetEventType(size_t index) const;
|
||||
|
||||
// Reads the header, direction, header length and packet length from the RTP
|
||||
// event at |index|, and stores the values in the corresponding output
|
||||
// parameters. Each output parameter can be set to nullptr if that value
|
||||
// isn't needed.
|
||||
// NB: The header must have space for at least IP_PACKET_SIZE bytes.
|
||||
// Returns: a pointer to a header extensions map acquired from parsing
|
||||
// corresponding Audio/Video Sender/Receiver config events.
|
||||
// Warning: if the same SSRC is reused by both video and audio streams during
|
||||
// call, extensions maps may be incorrect (the last one would be returned).
|
||||
const webrtc::RtpHeaderExtensionMap* GetRtpHeader(
|
||||
size_t index,
|
||||
PacketDirection* incoming,
|
||||
uint8_t* header,
|
||||
size_t* header_length,
|
||||
size_t* total_length,
|
||||
int* probe_cluster_id) const;
|
||||
const webrtc::RtpHeaderExtensionMap* GetRtpHeader(
|
||||
const rtclog::Event& event,
|
||||
PacketDirection* incoming,
|
||||
uint8_t* header,
|
||||
size_t* header_length,
|
||||
size_t* total_length,
|
||||
int* probe_cluster_id) const;
|
||||
|
||||
// Reads packet, direction and packet length from the RTCP event at |index|,
|
||||
// and stores the values in the corresponding output parameters.
|
||||
// Each output parameter can be set to nullptr if that value isn't needed.
|
||||
// NB: The packet must have space for at least IP_PACKET_SIZE bytes.
|
||||
void GetRtcpPacket(size_t index,
|
||||
PacketDirection* incoming,
|
||||
uint8_t* packet,
|
||||
size_t* length) const;
|
||||
void GetRtcpPacket(const rtclog::Event& event,
|
||||
PacketDirection* incoming,
|
||||
uint8_t* packet,
|
||||
size_t* length) const;
|
||||
|
||||
// Reads a video receive config event to a StreamConfig struct.
|
||||
// Only the fields that are stored in the protobuf will be written.
|
||||
rtclog::StreamConfig GetVideoReceiveConfig(size_t index) const;
|
||||
|
||||
// Reads a video send config event to a StreamConfig struct. If the proto
|
||||
// contains multiple SSRCs and RTX SSRCs (this used to be the case for
|
||||
// simulcast streams) then we return one StreamConfig per SSRC,RTX_SSRC pair.
|
||||
// Only the fields that are stored in the protobuf will be written.
|
||||
std::vector<rtclog::StreamConfig> GetVideoSendConfig(size_t index) const;
|
||||
|
||||
// Reads a audio receive config event to a StreamConfig struct.
|
||||
// Only the fields that are stored in the protobuf will be written.
|
||||
rtclog::StreamConfig GetAudioReceiveConfig(size_t index) const;
|
||||
|
||||
// Reads a config event to a StreamConfig struct.
|
||||
// Only the fields that are stored in the protobuf will be written.
|
||||
rtclog::StreamConfig GetAudioSendConfig(size_t index) const;
|
||||
|
||||
// Reads the SSRC from the audio playout event at |index|. The SSRC is stored
|
||||
// in the output parameter ssrc. The output parameter can be set to nullptr
|
||||
// and in that case the function only asserts that the event is well formed.
|
||||
LoggedAudioPlayoutEvent GetAudioPlayout(size_t index) const;
|
||||
|
||||
// Reads bitrate, fraction loss (as defined in RFC 1889) and total number of
|
||||
// expected packets from the loss based BWE event at |index| and stores the
|
||||
// values in
|
||||
// the corresponding output parameters. Each output parameter can be set to
|
||||
// nullptr if that
|
||||
// value isn't needed.
|
||||
LoggedBweLossBasedUpdate GetLossBasedBweUpdate(size_t index) const;
|
||||
|
||||
// Reads bitrate and detector_state from the delay based BWE event at |index|
|
||||
// and stores the values in the corresponding output parameters. Each output
|
||||
// parameter can be set to nullptr if that
|
||||
// value isn't needed.
|
||||
LoggedBweDelayBasedUpdate GetDelayBasedBweUpdate(size_t index) const;
|
||||
|
||||
// Reads a audio network adaptation event to a (non-NULL)
|
||||
// AudioEncoderRuntimeConfig struct. Only the fields that are
|
||||
// stored in the protobuf will be written.
|
||||
LoggedAudioNetworkAdaptationEvent GetAudioNetworkAdaptation(
|
||||
size_t index) const;
|
||||
|
||||
LoggedBweProbeClusterCreatedEvent GetBweProbeClusterCreated(
|
||||
size_t index) const;
|
||||
|
||||
LoggedBweProbeResultEvent GetBweProbeResult(size_t index) const;
|
||||
|
||||
MediaType GetMediaType(uint32_t ssrc, PacketDirection direction) const;
|
||||
|
||||
LoggedAlrStateEvent GetAlrState(size_t index) const;
|
||||
|
||||
LoggedIceCandidatePairConfig GetIceCandidatePairConfig(size_t index) const;
|
||||
|
||||
LoggedIceCandidatePairEvent GetIceCandidatePairEvent(size_t index) const;
|
||||
|
||||
const std::set<uint32_t>& incoming_rtx_ssrcs() const {
|
||||
return incoming_rtx_ssrcs_;
|
||||
}
|
||||
const std::set<uint32_t>& incoming_video_ssrcs() const {
|
||||
return incoming_video_ssrcs_;
|
||||
}
|
||||
const std::set<uint32_t>& incoming_audio_ssrcs() const {
|
||||
return incoming_audio_ssrcs_;
|
||||
}
|
||||
const std::set<uint32_t>& outgoing_rtx_ssrcs() const {
|
||||
return outgoing_rtx_ssrcs_;
|
||||
}
|
||||
const std::set<uint32_t>& outgoing_video_ssrcs() const {
|
||||
return outgoing_video_ssrcs_;
|
||||
}
|
||||
const std::set<uint32_t>& outgoing_audio_ssrcs() const {
|
||||
return outgoing_audio_ssrcs_;
|
||||
}
|
||||
|
||||
const std::vector<LoggedStartEvent>& start_log_events() const {
|
||||
return start_log_events_;
|
||||
}
|
||||
const std::vector<LoggedStopEvent>& stop_log_events() const {
|
||||
return stop_log_events_;
|
||||
}
|
||||
const std::map<uint32_t, std::vector<int64_t>>& audio_playout_events() const {
|
||||
return audio_playout_events_;
|
||||
}
|
||||
const std::vector<LoggedAudioNetworkAdaptationEvent>&
|
||||
audio_network_adaptation_events() const {
|
||||
return audio_network_adaptation_events_;
|
||||
}
|
||||
const std::vector<LoggedBweProbeClusterCreatedEvent>&
|
||||
bwe_probe_cluster_created_events() const {
|
||||
return bwe_probe_cluster_created_events_;
|
||||
}
|
||||
const std::vector<LoggedBweProbeResultEvent>& bwe_probe_result_events()
|
||||
const {
|
||||
return bwe_probe_result_events_;
|
||||
}
|
||||
const std::vector<LoggedBweDelayBasedUpdate>& bwe_delay_updates() const {
|
||||
return bwe_delay_updates_;
|
||||
}
|
||||
const std::vector<LoggedBweLossBasedUpdate>& bwe_loss_updates() const {
|
||||
return bwe_loss_updates_;
|
||||
}
|
||||
const std::vector<LoggedAlrStateEvent>& alr_state_events() const {
|
||||
return alr_state_events_;
|
||||
}
|
||||
const std::vector<LoggedIceCandidatePairConfig>& ice_candidate_pair_configs()
|
||||
const {
|
||||
return ice_candidate_pair_configs_;
|
||||
}
|
||||
const std::vector<LoggedIceCandidatePairEvent>& ice_candidate_pair_events()
|
||||
const {
|
||||
return ice_candidate_pair_events_;
|
||||
}
|
||||
|
||||
struct LoggedRtpStreamIncoming {
|
||||
uint32_t ssrc;
|
||||
std::vector<LoggedRtpPacketIncoming> incoming_packets;
|
||||
};
|
||||
|
||||
struct LoggedRtpStreamOutgoing {
|
||||
uint32_t ssrc;
|
||||
std::vector<LoggedRtpPacketOutgoing> outgoing_packets;
|
||||
};
|
||||
|
||||
struct LoggedRtpStreamView {
|
||||
LoggedRtpStreamView(uint32_t ssrc,
|
||||
const LoggedRtpPacketIncoming* ptr,
|
||||
size_t num_elements)
|
||||
: ssrc(ssrc),
|
||||
packet_view(PacketView<const LoggedRtpPacket>::Create(
|
||||
ptr,
|
||||
num_elements,
|
||||
offsetof(LoggedRtpPacketIncoming, rtp))) {}
|
||||
LoggedRtpStreamView(uint32_t ssrc,
|
||||
const LoggedRtpPacketOutgoing* ptr,
|
||||
size_t num_elements)
|
||||
: ssrc(ssrc),
|
||||
packet_view(PacketView<const LoggedRtpPacket>::Create(
|
||||
ptr,
|
||||
num_elements,
|
||||
offsetof(LoggedRtpPacketOutgoing, rtp))) {}
|
||||
uint32_t ssrc;
|
||||
PacketView<const LoggedRtpPacket> packet_view;
|
||||
};
|
||||
|
||||
const std::vector<LoggedRtpStreamIncoming>& incoming_rtp_packets_by_ssrc()
|
||||
const {
|
||||
return incoming_rtp_packets_by_ssrc_;
|
||||
}
|
||||
|
||||
const std::vector<LoggedRtpStreamOutgoing>& outgoing_rtp_packets_by_ssrc()
|
||||
const {
|
||||
return outgoing_rtp_packets_by_ssrc_;
|
||||
}
|
||||
|
||||
const std::vector<LoggedRtcpPacketIncoming>& incoming_rtcp_packets() const {
|
||||
return incoming_rtcp_packets_;
|
||||
}
|
||||
|
||||
const std::vector<LoggedRtcpPacketOutgoing>& outgoing_rtcp_packets() const {
|
||||
return outgoing_rtcp_packets_;
|
||||
}
|
||||
|
||||
const std::vector<LoggedRtpStreamView>& rtp_packets_by_ssrc(
|
||||
PacketDirection direction) const {
|
||||
if (direction == kIncomingPacket)
|
||||
return incoming_rtp_packet_views_by_ssrc_;
|
||||
else
|
||||
return outgoing_rtp_packet_views_by_ssrc_;
|
||||
}
|
||||
|
||||
const std::vector<LoggedRtcpPacketReceiverReport>& receiver_reports(
|
||||
PacketDirection direction) const {
|
||||
if (direction == kIncomingPacket) {
|
||||
return incoming_rr_;
|
||||
} else {
|
||||
return outgoing_rr_;
|
||||
}
|
||||
}
|
||||
|
||||
const std::vector<LoggedRtcpPacketSenderReport>& sender_reports(
|
||||
PacketDirection direction) const {
|
||||
if (direction == kIncomingPacket) {
|
||||
return incoming_sr_;
|
||||
} else {
|
||||
return outgoing_sr_;
|
||||
}
|
||||
}
|
||||
|
||||
const std::vector<LoggedRtcpPacketNack>& nacks(
|
||||
PacketDirection direction) const {
|
||||
if (direction == kIncomingPacket) {
|
||||
return incoming_nack_;
|
||||
} else {
|
||||
return outgoing_nack_;
|
||||
}
|
||||
}
|
||||
|
||||
const std::vector<LoggedRtcpPacketRemb>& rembs(
|
||||
PacketDirection direction) const {
|
||||
if (direction == kIncomingPacket) {
|
||||
return incoming_remb_;
|
||||
} else {
|
||||
return outgoing_remb_;
|
||||
}
|
||||
}
|
||||
|
||||
const std::vector<LoggedRtcpPacketTransportFeedback>& transport_feedbacks(
|
||||
PacketDirection direction) const {
|
||||
if (direction == kIncomingPacket) {
|
||||
return incoming_transport_feedback_;
|
||||
} else {
|
||||
return outgoing_transport_feedback_;
|
||||
}
|
||||
}
|
||||
|
||||
int64_t first_timestamp() const { return first_timestamp_; }
|
||||
int64_t last_timestamp() const { return last_timestamp_; }
|
||||
|
||||
private:
|
||||
void StoreParsedEvent(const rtclog::Event& event);
|
||||
|
||||
rtclog::StreamConfig GetVideoReceiveConfig(const rtclog::Event& event) const;
|
||||
std::vector<rtclog::StreamConfig> GetVideoSendConfig(
|
||||
const rtclog::Event& event) const;
|
||||
rtclog::StreamConfig GetAudioReceiveConfig(const rtclog::Event& event) const;
|
||||
rtclog::StreamConfig GetAudioSendConfig(const rtclog::Event& event) const;
|
||||
|
||||
LoggedAudioPlayoutEvent GetAudioPlayout(const rtclog::Event& event) const;
|
||||
|
||||
LoggedBweLossBasedUpdate GetLossBasedBweUpdate(
|
||||
const rtclog::Event& event) const;
|
||||
LoggedBweDelayBasedUpdate GetDelayBasedBweUpdate(
|
||||
const rtclog::Event& event) const;
|
||||
|
||||
LoggedAudioNetworkAdaptationEvent GetAudioNetworkAdaptation(
|
||||
const rtclog::Event& event) const;
|
||||
|
||||
LoggedBweProbeClusterCreatedEvent GetBweProbeClusterCreated(
|
||||
const rtclog::Event& event) const;
|
||||
LoggedBweProbeResultEvent GetBweProbeResult(const rtclog::Event& event) const;
|
||||
|
||||
LoggedAlrStateEvent GetAlrState(const rtclog::Event& event) const;
|
||||
|
||||
LoggedIceCandidatePairConfig GetIceCandidatePairConfig(
|
||||
const rtclog::Event& event) const;
|
||||
LoggedIceCandidatePairEvent GetIceCandidatePairEvent(
|
||||
const rtclog::Event& event) const;
|
||||
|
||||
std::vector<rtclog::Event> events_;
|
||||
|
||||
struct Stream {
|
||||
Stream(uint32_t ssrc,
|
||||
MediaType media_type,
|
||||
PacketDirection direction,
|
||||
webrtc::RtpHeaderExtensionMap map)
|
||||
: ssrc(ssrc),
|
||||
media_type(media_type),
|
||||
direction(direction),
|
||||
rtp_extensions_map(map) {}
|
||||
uint32_t ssrc;
|
||||
MediaType media_type;
|
||||
PacketDirection direction;
|
||||
webrtc::RtpHeaderExtensionMap rtp_extensions_map;
|
||||
};
|
||||
|
||||
const UnconfiguredHeaderExtensions parse_unconfigured_header_extensions_;
|
||||
|
||||
// Make a default extension map for streams without configuration information.
|
||||
// TODO(ivoc): Once configuration of audio streams is stored in the event log,
|
||||
// this can be removed. Tracking bug: webrtc:6399
|
||||
RtpHeaderExtensionMap default_extension_map_;
|
||||
|
||||
// Tracks what each stream is configured for. Note that a single SSRC can be
|
||||
// in several sets. For example, the SSRC used for sending video over RTX
|
||||
// will appear in both video_ssrcs_ and rtx_ssrcs_. In the unlikely case that
|
||||
// an SSRC is reconfigured to a different media type mid-call, it will also
|
||||
// appear in multiple sets.
|
||||
std::set<uint32_t> incoming_rtx_ssrcs_;
|
||||
std::set<uint32_t> incoming_video_ssrcs_;
|
||||
std::set<uint32_t> incoming_audio_ssrcs_;
|
||||
std::set<uint32_t> outgoing_rtx_ssrcs_;
|
||||
std::set<uint32_t> outgoing_video_ssrcs_;
|
||||
std::set<uint32_t> outgoing_audio_ssrcs_;
|
||||
|
||||
// Maps an SSRC to the parsed RTP headers in that stream. Header extensions
|
||||
// are parsed if the stream has been configured. This is only used for
|
||||
// grouping the events by SSRC during parsing; the events are moved to
|
||||
// incoming_rtp_packets_by_ssrc_ once the parsing is done.
|
||||
std::map<uint32_t, std::vector<LoggedRtpPacketIncoming>>
|
||||
incoming_rtp_packets_map_;
|
||||
std::map<uint32_t, std::vector<LoggedRtpPacketOutgoing>>
|
||||
outgoing_rtp_packets_map_;
|
||||
|
||||
// RTP headers.
|
||||
std::vector<LoggedRtpStreamIncoming> incoming_rtp_packets_by_ssrc_;
|
||||
std::vector<LoggedRtpStreamOutgoing> outgoing_rtp_packets_by_ssrc_;
|
||||
std::vector<LoggedRtpStreamView> incoming_rtp_packet_views_by_ssrc_;
|
||||
std::vector<LoggedRtpStreamView> outgoing_rtp_packet_views_by_ssrc_;
|
||||
|
||||
// Raw RTCP packets.
|
||||
std::vector<LoggedRtcpPacketIncoming> incoming_rtcp_packets_;
|
||||
std::vector<LoggedRtcpPacketOutgoing> outgoing_rtcp_packets_;
|
||||
|
||||
// Parsed RTCP messages. Currently not separated based on SSRC.
|
||||
std::vector<LoggedRtcpPacketReceiverReport> incoming_rr_;
|
||||
std::vector<LoggedRtcpPacketReceiverReport> outgoing_rr_;
|
||||
std::vector<LoggedRtcpPacketSenderReport> incoming_sr_;
|
||||
std::vector<LoggedRtcpPacketSenderReport> outgoing_sr_;
|
||||
std::vector<LoggedRtcpPacketNack> incoming_nack_;
|
||||
std::vector<LoggedRtcpPacketNack> outgoing_nack_;
|
||||
std::vector<LoggedRtcpPacketRemb> incoming_remb_;
|
||||
std::vector<LoggedRtcpPacketRemb> outgoing_remb_;
|
||||
std::vector<LoggedRtcpPacketTransportFeedback> incoming_transport_feedback_;
|
||||
std::vector<LoggedRtcpPacketTransportFeedback> outgoing_transport_feedback_;
|
||||
|
||||
std::vector<LoggedStartEvent> start_log_events_;
|
||||
std::vector<LoggedStopEvent> stop_log_events_;
|
||||
|
||||
// Maps an SSRC to the timestamps of parsed audio playout events.
|
||||
std::map<uint32_t, std::vector<int64_t>> audio_playout_events_;
|
||||
|
||||
std::vector<LoggedAudioNetworkAdaptationEvent>
|
||||
audio_network_adaptation_events_;
|
||||
|
||||
std::vector<LoggedBweProbeClusterCreatedEvent>
|
||||
bwe_probe_cluster_created_events_;
|
||||
|
||||
std::vector<LoggedBweProbeResultEvent> bwe_probe_result_events_;
|
||||
|
||||
std::vector<LoggedBweDelayBasedUpdate> bwe_delay_updates_;
|
||||
|
||||
// A list of all updates from the send-side loss-based bandwidth estimator.
|
||||
std::vector<LoggedBweLossBasedUpdate> bwe_loss_updates_;
|
||||
|
||||
std::vector<LoggedAlrStateEvent> alr_state_events_;
|
||||
|
||||
std::vector<LoggedIceCandidatePairConfig> ice_candidate_pair_configs_;
|
||||
|
||||
std::vector<LoggedIceCandidatePairEvent> ice_candidate_pair_events_;
|
||||
|
||||
std::vector<LoggedAudioRecvConfig> audio_recv_configs_;
|
||||
std::vector<LoggedAudioSendConfig> audio_send_configs_;
|
||||
std::vector<LoggedVideoRecvConfig> video_recv_configs_;
|
||||
std::vector<LoggedVideoSendConfig> video_send_configs_;
|
||||
|
||||
uint8_t last_incoming_rtcp_packet_[IP_PACKET_SIZE];
|
||||
uint8_t last_incoming_rtcp_packet_length_;
|
||||
|
||||
int64_t first_timestamp_;
|
||||
int64_t last_timestamp_;
|
||||
|
||||
// The extension maps are mutable to allow us to insert the default
|
||||
// configuration when parsing an RTP header for an unconfigured stream.
|
||||
mutable std::map<uint32_t, webrtc::RtpHeaderExtensionMap>
|
||||
incoming_rtp_extensions_maps_;
|
||||
mutable std::map<uint32_t, webrtc::RtpHeaderExtensionMap>
|
||||
outgoing_rtp_extensions_maps_;
|
||||
};
|
||||
|
||||
} // namespace webrtc
|
||||
|
||||
#endif // LOGGING_RTC_EVENT_LOG_RTC_EVENT_LOG_PARSER_NEW_H_
|
@ -34,7 +34,7 @@
|
||||
#include "logging/rtc_event_log/events/rtc_event_video_send_stream_config.h"
|
||||
#include "logging/rtc_event_log/output/rtc_event_log_output_file.h"
|
||||
#include "logging/rtc_event_log/rtc_event_log.h"
|
||||
#include "logging/rtc_event_log/rtc_event_log_parser.h"
|
||||
#include "logging/rtc_event_log/rtc_event_log_parser_new.h"
|
||||
#include "logging/rtc_event_log/rtc_event_log_unittest_helper.h"
|
||||
#include "logging/rtc_event_log/rtc_stream_config.h"
|
||||
#include "modules/audio_coding/audio_network_adaptor/include/audio_network_adaptor.h"
|
||||
@ -120,35 +120,36 @@ const std::map<EventType, std::string> event_type_to_string(
|
||||
{EventType::kBweProbeClusterCreated, "BWE_PROBE_CREATED"},
|
||||
{EventType::kBweProbeResult, "BWE_PROBE_RESULT"}});
|
||||
|
||||
const std::map<ParsedRtcEventLog::EventType, std::string>
|
||||
const std::map<ParsedRtcEventLogNew::EventType, std::string>
|
||||
parsed_event_type_to_string(
|
||||
{{ParsedRtcEventLog::EventType::UNKNOWN_EVENT, "UNKNOWN_EVENT"},
|
||||
{ParsedRtcEventLog::EventType::LOG_START, "LOG_START"},
|
||||
{ParsedRtcEventLog::EventType::LOG_END, "LOG_END"},
|
||||
{ParsedRtcEventLog::EventType::RTP_EVENT, "RTP"},
|
||||
{ParsedRtcEventLog::EventType::RTCP_EVENT, "RTCP"},
|
||||
{ParsedRtcEventLog::EventType::AUDIO_PLAYOUT_EVENT, "AUDIO_PLAYOUT"},
|
||||
{ParsedRtcEventLog::EventType::LOSS_BASED_BWE_UPDATE,
|
||||
{{ParsedRtcEventLogNew::EventType::UNKNOWN_EVENT, "UNKNOWN_EVENT"},
|
||||
{ParsedRtcEventLogNew::EventType::LOG_START, "LOG_START"},
|
||||
{ParsedRtcEventLogNew::EventType::LOG_END, "LOG_END"},
|
||||
{ParsedRtcEventLogNew::EventType::RTP_EVENT, "RTP"},
|
||||
{ParsedRtcEventLogNew::EventType::RTCP_EVENT, "RTCP"},
|
||||
{ParsedRtcEventLogNew::EventType::AUDIO_PLAYOUT_EVENT,
|
||||
"AUDIO_PLAYOUT"},
|
||||
{ParsedRtcEventLogNew::EventType::LOSS_BASED_BWE_UPDATE,
|
||||
"LOSS_BASED_BWE_UPDATE"},
|
||||
{ParsedRtcEventLog::EventType::DELAY_BASED_BWE_UPDATE,
|
||||
{ParsedRtcEventLogNew::EventType::DELAY_BASED_BWE_UPDATE,
|
||||
"DELAY_BASED_BWE_UPDATE"},
|
||||
{ParsedRtcEventLog::EventType::VIDEO_RECEIVER_CONFIG_EVENT,
|
||||
{ParsedRtcEventLogNew::EventType::VIDEO_RECEIVER_CONFIG_EVENT,
|
||||
"VIDEO_RECV_CONFIG"},
|
||||
{ParsedRtcEventLog::EventType::VIDEO_SENDER_CONFIG_EVENT,
|
||||
{ParsedRtcEventLogNew::EventType::VIDEO_SENDER_CONFIG_EVENT,
|
||||
"VIDEO_SEND_CONFIG"},
|
||||
{ParsedRtcEventLog::EventType::AUDIO_RECEIVER_CONFIG_EVENT,
|
||||
{ParsedRtcEventLogNew::EventType::AUDIO_RECEIVER_CONFIG_EVENT,
|
||||
"AUDIO_RECV_CONFIG"},
|
||||
{ParsedRtcEventLog::EventType::AUDIO_SENDER_CONFIG_EVENT,
|
||||
{ParsedRtcEventLogNew::EventType::AUDIO_SENDER_CONFIG_EVENT,
|
||||
"AUDIO_SEND_CONFIG"},
|
||||
{ParsedRtcEventLog::EventType::AUDIO_NETWORK_ADAPTATION_EVENT,
|
||||
{ParsedRtcEventLogNew::EventType::AUDIO_NETWORK_ADAPTATION_EVENT,
|
||||
"AUDIO_NETWORK_ADAPTATION"},
|
||||
{ParsedRtcEventLog::EventType::BWE_PROBE_CLUSTER_CREATED_EVENT,
|
||||
{ParsedRtcEventLogNew::EventType::BWE_PROBE_CLUSTER_CREATED_EVENT,
|
||||
"BWE_PROBE_CREATED"},
|
||||
{ParsedRtcEventLog::EventType::BWE_PROBE_RESULT_EVENT,
|
||||
{ParsedRtcEventLogNew::EventType::BWE_PROBE_RESULT_EVENT,
|
||||
"BWE_PROBE_RESULT"}});
|
||||
} // namespace
|
||||
|
||||
void PrintActualEvents(const ParsedRtcEventLog& parsed_log,
|
||||
void PrintActualEvents(const ParsedRtcEventLogNew& parsed_log,
|
||||
std::ostream& stream);
|
||||
|
||||
RtpPacketToSend GenerateOutgoingRtpPacket(
|
||||
@ -530,7 +531,7 @@ void RtcEventLogSession::ReadAndVerifySession() {
|
||||
test::OutputPath() + "RtcEventLogTest_" + test_name;
|
||||
|
||||
// Read the generated file from disk.
|
||||
ParsedRtcEventLog parsed_log;
|
||||
ParsedRtcEventLogNew parsed_log;
|
||||
ASSERT_TRUE(parsed_log.ParseFile(temp_filename));
|
||||
EXPECT_GE(5000u, event_types.size() + 2); // The events must fit.
|
||||
EXPECT_EQ(event_types.size() + 2, parsed_log.GetNumberOfEvents());
|
||||
@ -644,7 +645,7 @@ void RtcEventLogSession::PrintExpectedEvents(std::ostream& stream) {
|
||||
stream << std::endl;
|
||||
}
|
||||
|
||||
void PrintActualEvents(const ParsedRtcEventLog& parsed_log,
|
||||
void PrintActualEvents(const ParsedRtcEventLogNew& parsed_log,
|
||||
std::ostream& stream) {
|
||||
for (size_t i = 0; i < parsed_log.GetNumberOfEvents(); i++) {
|
||||
auto it = parsed_event_type_to_string.find(parsed_log.GetEventType(i));
|
||||
@ -735,7 +736,7 @@ TEST(RtcEventLogTest, CircularBufferKeepsMostRecentEvents) {
|
||||
log_dumper->StopLogging();
|
||||
|
||||
// Read the generated file from disk.
|
||||
ParsedRtcEventLog parsed_log;
|
||||
ParsedRtcEventLogNew parsed_log;
|
||||
ASSERT_TRUE(parsed_log.ParseFile(temp_filename));
|
||||
// If the following fails, it probably means that kNumEvents isn't larger
|
||||
// than the size of the cyclic buffer in the event log. Try increasing
|
||||
@ -749,18 +750,17 @@ TEST(RtcEventLogTest, CircularBufferKeepsMostRecentEvents) {
|
||||
rtc::Optional<uint32_t> last_ssrc;
|
||||
for (size_t i = 1; i < parsed_log.GetNumberOfEvents() - 1; i++) {
|
||||
EXPECT_EQ(parsed_log.GetEventType(i),
|
||||
ParsedRtcEventLog::EventType::AUDIO_PLAYOUT_EVENT);
|
||||
uint32_t ssrc;
|
||||
parsed_log.GetAudioPlayout(i, &ssrc);
|
||||
int64_t timestamp = parsed_log.GetTimestamp(i);
|
||||
EXPECT_LT(ssrc, kNumEvents);
|
||||
EXPECT_EQ(static_cast<int64_t>(kStartTime + 10000 * ssrc), timestamp);
|
||||
ParsedRtcEventLogNew::EventType::AUDIO_PLAYOUT_EVENT);
|
||||
LoggedAudioPlayoutEvent playout_event = parsed_log.GetAudioPlayout(i);
|
||||
EXPECT_LT(playout_event.ssrc, kNumEvents);
|
||||
EXPECT_EQ(static_cast<int64_t>(kStartTime + 10000 * playout_event.ssrc),
|
||||
playout_event.timestamp_us);
|
||||
if (last_ssrc)
|
||||
EXPECT_EQ(ssrc, *last_ssrc + 1);
|
||||
EXPECT_EQ(playout_event.ssrc, *last_ssrc + 1);
|
||||
if (last_timestamp)
|
||||
EXPECT_EQ(timestamp, *last_timestamp + 10000);
|
||||
last_ssrc = ssrc;
|
||||
last_timestamp = timestamp;
|
||||
EXPECT_EQ(playout_event.timestamp_us, *last_timestamp + 10000);
|
||||
last_ssrc = playout_event.ssrc;
|
||||
last_timestamp = playout_event.timestamp_us;
|
||||
}
|
||||
RtcEventLogTestHelper::VerifyLogEndEvent(parsed_log,
|
||||
parsed_log.GetNumberOfEvents() - 1);
|
||||
|
@ -176,7 +176,7 @@ void VerifyStreamConfigsAreEqual(const rtclog::StreamConfig& config_1,
|
||||
}
|
||||
|
||||
void RtcEventLogTestHelper::VerifyVideoReceiveStreamConfig(
|
||||
const ParsedRtcEventLog& parsed_log,
|
||||
const ParsedRtcEventLogNew& parsed_log,
|
||||
size_t index,
|
||||
const rtclog::StreamConfig& config) {
|
||||
ASSERT_LT(index, parsed_log.events_.size());
|
||||
@ -247,7 +247,7 @@ void RtcEventLogTestHelper::VerifyVideoReceiveStreamConfig(
|
||||
}
|
||||
|
||||
void RtcEventLogTestHelper::VerifyVideoSendStreamConfig(
|
||||
const ParsedRtcEventLog& parsed_log,
|
||||
const ParsedRtcEventLogNew& parsed_log,
|
||||
size_t index,
|
||||
const rtclog::StreamConfig& config) {
|
||||
ASSERT_LT(index, parsed_log.events_.size());
|
||||
@ -289,7 +289,7 @@ void RtcEventLogTestHelper::VerifyVideoSendStreamConfig(
|
||||
}
|
||||
|
||||
void RtcEventLogTestHelper::VerifyAudioReceiveStreamConfig(
|
||||
const ParsedRtcEventLog& parsed_log,
|
||||
const ParsedRtcEventLogNew& parsed_log,
|
||||
size_t index,
|
||||
const rtclog::StreamConfig& config) {
|
||||
ASSERT_LT(index, parsed_log.events_.size());
|
||||
@ -329,7 +329,7 @@ void RtcEventLogTestHelper::VerifyAudioReceiveStreamConfig(
|
||||
}
|
||||
|
||||
void RtcEventLogTestHelper::VerifyAudioSendStreamConfig(
|
||||
const ParsedRtcEventLog& parsed_log,
|
||||
const ParsedRtcEventLogNew& parsed_log,
|
||||
size_t index,
|
||||
const rtclog::StreamConfig& config) {
|
||||
ASSERT_LT(index, parsed_log.events_.size());
|
||||
@ -357,7 +357,7 @@ void RtcEventLogTestHelper::VerifyAudioSendStreamConfig(
|
||||
}
|
||||
|
||||
void RtcEventLogTestHelper::VerifyIncomingRtpEvent(
|
||||
const ParsedRtcEventLog& parsed_log,
|
||||
const ParsedRtcEventLogNew& parsed_log,
|
||||
size_t index,
|
||||
const RtpPacketReceived& expected_packet) {
|
||||
ASSERT_LT(index, parsed_log.events_.size());
|
||||
@ -388,7 +388,7 @@ void RtcEventLogTestHelper::VerifyIncomingRtpEvent(
|
||||
}
|
||||
|
||||
void RtcEventLogTestHelper::VerifyOutgoingRtpEvent(
|
||||
const ParsedRtcEventLog& parsed_log,
|
||||
const ParsedRtcEventLogNew& parsed_log,
|
||||
size_t index,
|
||||
const RtpPacketToSend& expected_packet) {
|
||||
ASSERT_LT(index, parsed_log.events_.size());
|
||||
@ -418,11 +418,12 @@ void RtcEventLogTestHelper::VerifyOutgoingRtpEvent(
|
||||
EXPECT_EQ(expected_packet.size(), parsed_total_size);
|
||||
}
|
||||
|
||||
void RtcEventLogTestHelper::VerifyRtcpEvent(const ParsedRtcEventLog& parsed_log,
|
||||
size_t index,
|
||||
PacketDirection direction,
|
||||
const uint8_t* packet,
|
||||
size_t total_size) {
|
||||
void RtcEventLogTestHelper::VerifyRtcpEvent(
|
||||
const ParsedRtcEventLogNew& parsed_log,
|
||||
size_t index,
|
||||
PacketDirection direction,
|
||||
const uint8_t* packet,
|
||||
size_t total_size) {
|
||||
ASSERT_LT(index, parsed_log.events_.size());
|
||||
const rtclog::Event& event = parsed_log.events_[index];
|
||||
ASSERT_TRUE(IsValidBasicEvent(event));
|
||||
@ -448,7 +449,7 @@ void RtcEventLogTestHelper::VerifyRtcpEvent(const ParsedRtcEventLog& parsed_log,
|
||||
}
|
||||
|
||||
void RtcEventLogTestHelper::VerifyPlayoutEvent(
|
||||
const ParsedRtcEventLog& parsed_log,
|
||||
const ParsedRtcEventLogNew& parsed_log,
|
||||
size_t index,
|
||||
uint32_t ssrc) {
|
||||
ASSERT_LT(index, parsed_log.events_.size());
|
||||
@ -460,13 +461,12 @@ void RtcEventLogTestHelper::VerifyPlayoutEvent(
|
||||
EXPECT_EQ(ssrc, playout_event.local_ssrc());
|
||||
|
||||
// Check consistency of the parser.
|
||||
uint32_t parsed_ssrc;
|
||||
parsed_log.GetAudioPlayout(index, &parsed_ssrc);
|
||||
EXPECT_EQ(ssrc, parsed_ssrc);
|
||||
LoggedAudioPlayoutEvent parsed_event = parsed_log.GetAudioPlayout(index);
|
||||
EXPECT_EQ(ssrc, parsed_event.ssrc);
|
||||
}
|
||||
|
||||
void RtcEventLogTestHelper::VerifyBweLossEvent(
|
||||
const ParsedRtcEventLog& parsed_log,
|
||||
const ParsedRtcEventLogNew& parsed_log,
|
||||
size_t index,
|
||||
int32_t bitrate,
|
||||
uint8_t fraction_loss,
|
||||
@ -484,18 +484,14 @@ void RtcEventLogTestHelper::VerifyBweLossEvent(
|
||||
EXPECT_EQ(total_packets, bwe_event.total_packets());
|
||||
|
||||
// Check consistency of the parser.
|
||||
int32_t parsed_bitrate;
|
||||
uint8_t parsed_fraction_loss;
|
||||
int32_t parsed_total_packets;
|
||||
parsed_log.GetLossBasedBweUpdate(
|
||||
index, &parsed_bitrate, &parsed_fraction_loss, &parsed_total_packets);
|
||||
EXPECT_EQ(bitrate, parsed_bitrate);
|
||||
EXPECT_EQ(fraction_loss, parsed_fraction_loss);
|
||||
EXPECT_EQ(total_packets, parsed_total_packets);
|
||||
LoggedBweLossBasedUpdate bwe_update = parsed_log.GetLossBasedBweUpdate(index);
|
||||
EXPECT_EQ(bitrate, bwe_update.bitrate_bps);
|
||||
EXPECT_EQ(fraction_loss, bwe_update.fraction_lost);
|
||||
EXPECT_EQ(total_packets, bwe_update.expected_packets);
|
||||
}
|
||||
|
||||
void RtcEventLogTestHelper::VerifyBweDelayEvent(
|
||||
const ParsedRtcEventLog& parsed_log,
|
||||
const ParsedRtcEventLogNew& parsed_log,
|
||||
size_t index,
|
||||
int32_t bitrate,
|
||||
BandwidthUsage detector_state) {
|
||||
@ -511,29 +507,33 @@ void RtcEventLogTestHelper::VerifyBweDelayEvent(
|
||||
GetRuntimeDetectorState(bwe_event.detector_state()));
|
||||
|
||||
// Check consistency of the parser.
|
||||
ParsedRtcEventLog::BweDelayBasedUpdate res =
|
||||
parsed_log.GetDelayBasedBweUpdate(index);
|
||||
LoggedBweDelayBasedUpdate res = parsed_log.GetDelayBasedBweUpdate(index);
|
||||
EXPECT_EQ(res.bitrate_bps, bitrate);
|
||||
EXPECT_EQ(res.detector_state, detector_state);
|
||||
}
|
||||
|
||||
void RtcEventLogTestHelper::VerifyAudioNetworkAdaptation(
|
||||
const ParsedRtcEventLog& parsed_log,
|
||||
const ParsedRtcEventLogNew& parsed_log,
|
||||
size_t index,
|
||||
const AudioEncoderRuntimeConfig& config) {
|
||||
AudioEncoderRuntimeConfig parsed_config;
|
||||
parsed_log.GetAudioNetworkAdaptation(index, &parsed_config);
|
||||
EXPECT_EQ(config.bitrate_bps, parsed_config.bitrate_bps);
|
||||
EXPECT_EQ(config.enable_dtx, parsed_config.enable_dtx);
|
||||
EXPECT_EQ(config.enable_fec, parsed_config.enable_fec);
|
||||
EXPECT_EQ(config.frame_length_ms, parsed_config.frame_length_ms);
|
||||
EXPECT_EQ(config.num_channels, parsed_config.num_channels);
|
||||
ASSERT_LT(index, parsed_log.events_.size());
|
||||
const rtclog::Event& event = parsed_log.events_[index];
|
||||
ASSERT_TRUE(IsValidBasicEvent(event));
|
||||
ASSERT_EQ(rtclog::Event::AUDIO_NETWORK_ADAPTATION_EVENT, event.type());
|
||||
|
||||
LoggedAudioNetworkAdaptationEvent parsed_event =
|
||||
parsed_log.GetAudioNetworkAdaptation(index);
|
||||
EXPECT_EQ(config.bitrate_bps, parsed_event.config.bitrate_bps);
|
||||
EXPECT_EQ(config.enable_dtx, parsed_event.config.enable_dtx);
|
||||
EXPECT_EQ(config.enable_fec, parsed_event.config.enable_fec);
|
||||
EXPECT_EQ(config.frame_length_ms, parsed_event.config.frame_length_ms);
|
||||
EXPECT_EQ(config.num_channels, parsed_event.config.num_channels);
|
||||
EXPECT_EQ(config.uplink_packet_loss_fraction,
|
||||
parsed_config.uplink_packet_loss_fraction);
|
||||
parsed_event.config.uplink_packet_loss_fraction);
|
||||
}
|
||||
|
||||
void RtcEventLogTestHelper::VerifyLogStartEvent(
|
||||
const ParsedRtcEventLog& parsed_log,
|
||||
const ParsedRtcEventLogNew& parsed_log,
|
||||
size_t index) {
|
||||
ASSERT_LT(index, parsed_log.events_.size());
|
||||
const rtclog::Event& event = parsed_log.events_[index];
|
||||
@ -542,7 +542,7 @@ void RtcEventLogTestHelper::VerifyLogStartEvent(
|
||||
}
|
||||
|
||||
void RtcEventLogTestHelper::VerifyLogEndEvent(
|
||||
const ParsedRtcEventLog& parsed_log,
|
||||
const ParsedRtcEventLogNew& parsed_log,
|
||||
size_t index) {
|
||||
ASSERT_LT(index, parsed_log.events_.size());
|
||||
const rtclog::Event& event = parsed_log.events_[index];
|
||||
@ -551,7 +551,7 @@ void RtcEventLogTestHelper::VerifyLogEndEvent(
|
||||
}
|
||||
|
||||
void RtcEventLogTestHelper::VerifyBweProbeCluster(
|
||||
const ParsedRtcEventLog& parsed_log,
|
||||
const ParsedRtcEventLogNew& parsed_log,
|
||||
size_t index,
|
||||
uint32_t id,
|
||||
uint32_t bitrate_bps,
|
||||
@ -576,7 +576,7 @@ void RtcEventLogTestHelper::VerifyBweProbeCluster(
|
||||
}
|
||||
|
||||
void RtcEventLogTestHelper::VerifyProbeResultSuccess(
|
||||
const ParsedRtcEventLog& parsed_log,
|
||||
const ParsedRtcEventLogNew& parsed_log,
|
||||
size_t index,
|
||||
uint32_t id,
|
||||
uint32_t bitrate_bps) {
|
||||
@ -597,7 +597,7 @@ void RtcEventLogTestHelper::VerifyProbeResultSuccess(
|
||||
}
|
||||
|
||||
void RtcEventLogTestHelper::VerifyProbeResultFailure(
|
||||
const ParsedRtcEventLog& parsed_log,
|
||||
const ParsedRtcEventLogNew& parsed_log,
|
||||
size_t index,
|
||||
uint32_t id,
|
||||
ProbeFailureReason failure_reason) {
|
||||
|
@ -12,7 +12,7 @@
|
||||
#define LOGGING_RTC_EVENT_LOG_RTC_EVENT_LOG_UNITTEST_HELPER_H_
|
||||
|
||||
#include "call/call.h"
|
||||
#include "logging/rtc_event_log/rtc_event_log_parser.h"
|
||||
#include "logging/rtc_event_log/rtc_event_log_parser_new.h"
|
||||
#include "modules/rtp_rtcp/source/rtp_packet_received.h"
|
||||
#include "modules/rtp_rtcp/source/rtp_packet_to_send.h"
|
||||
|
||||
@ -21,66 +21,68 @@ namespace webrtc {
|
||||
class RtcEventLogTestHelper {
|
||||
public:
|
||||
static void VerifyVideoReceiveStreamConfig(
|
||||
const ParsedRtcEventLog& parsed_log,
|
||||
const ParsedRtcEventLogNew& parsed_log,
|
||||
size_t index,
|
||||
const rtclog::StreamConfig& config);
|
||||
static void VerifyVideoSendStreamConfig(
|
||||
const ParsedRtcEventLogNew& parsed_log,
|
||||
size_t index,
|
||||
const rtclog::StreamConfig& config);
|
||||
static void VerifyVideoSendStreamConfig(const ParsedRtcEventLog& parsed_log,
|
||||
size_t index,
|
||||
const rtclog::StreamConfig& config);
|
||||
static void VerifyAudioReceiveStreamConfig(
|
||||
const ParsedRtcEventLog& parsed_log,
|
||||
const ParsedRtcEventLogNew& parsed_log,
|
||||
size_t index,
|
||||
const rtclog::StreamConfig& config);
|
||||
static void VerifyAudioSendStreamConfig(const ParsedRtcEventLog& parsed_log,
|
||||
size_t index,
|
||||
const rtclog::StreamConfig& config);
|
||||
static void VerifyIncomingRtpEvent(const ParsedRtcEventLog& parsed_log,
|
||||
static void VerifyAudioSendStreamConfig(
|
||||
const ParsedRtcEventLogNew& parsed_log,
|
||||
size_t index,
|
||||
const rtclog::StreamConfig& config);
|
||||
static void VerifyIncomingRtpEvent(const ParsedRtcEventLogNew& parsed_log,
|
||||
size_t index,
|
||||
const RtpPacketReceived& expected_packet);
|
||||
static void VerifyOutgoingRtpEvent(const ParsedRtcEventLog& parsed_log,
|
||||
static void VerifyOutgoingRtpEvent(const ParsedRtcEventLogNew& parsed_log,
|
||||
size_t index,
|
||||
const RtpPacketToSend& expected_packet);
|
||||
static void VerifyRtcpEvent(const ParsedRtcEventLog& parsed_log,
|
||||
static void VerifyRtcpEvent(const ParsedRtcEventLogNew& parsed_log,
|
||||
size_t index,
|
||||
PacketDirection direction,
|
||||
const uint8_t* packet,
|
||||
size_t total_size);
|
||||
static void VerifyPlayoutEvent(const ParsedRtcEventLog& parsed_log,
|
||||
static void VerifyPlayoutEvent(const ParsedRtcEventLogNew& parsed_log,
|
||||
size_t index,
|
||||
uint32_t ssrc);
|
||||
static void VerifyBweLossEvent(const ParsedRtcEventLog& parsed_log,
|
||||
static void VerifyBweLossEvent(const ParsedRtcEventLogNew& parsed_log,
|
||||
size_t index,
|
||||
int32_t bitrate,
|
||||
uint8_t fraction_loss,
|
||||
int32_t total_packets);
|
||||
static void VerifyBweDelayEvent(const ParsedRtcEventLog& parsed_log,
|
||||
static void VerifyBweDelayEvent(const ParsedRtcEventLogNew& parsed_log,
|
||||
size_t index,
|
||||
int32_t bitrate,
|
||||
BandwidthUsage detector_state);
|
||||
|
||||
static void VerifyAudioNetworkAdaptation(
|
||||
const ParsedRtcEventLog& parsed_log,
|
||||
const ParsedRtcEventLogNew& parsed_log,
|
||||
size_t index,
|
||||
const AudioEncoderRuntimeConfig& config);
|
||||
|
||||
static void VerifyLogStartEvent(const ParsedRtcEventLog& parsed_log,
|
||||
static void VerifyLogStartEvent(const ParsedRtcEventLogNew& parsed_log,
|
||||
size_t index);
|
||||
static void VerifyLogEndEvent(const ParsedRtcEventLog& parsed_log,
|
||||
static void VerifyLogEndEvent(const ParsedRtcEventLogNew& parsed_log,
|
||||
size_t index);
|
||||
|
||||
static void VerifyBweProbeCluster(const ParsedRtcEventLog& parsed_log,
|
||||
static void VerifyBweProbeCluster(const ParsedRtcEventLogNew& parsed_log,
|
||||
size_t index,
|
||||
uint32_t id,
|
||||
uint32_t bitrate_bps,
|
||||
uint32_t min_probes,
|
||||
uint32_t min_bytes);
|
||||
|
||||
static void VerifyProbeResultSuccess(const ParsedRtcEventLog& parsed_log,
|
||||
static void VerifyProbeResultSuccess(const ParsedRtcEventLogNew& parsed_log,
|
||||
size_t index,
|
||||
uint32_t id,
|
||||
uint32_t bitrate_bps);
|
||||
|
||||
static void VerifyProbeResultFailure(const ParsedRtcEventLog& parsed_log,
|
||||
static void VerifyProbeResultFailure(const ParsedRtcEventLogNew& parsed_log,
|
||||
size_t index,
|
||||
uint32_t id,
|
||||
ProbeFailureReason failure_reason);
|
||||
|
@ -40,7 +40,7 @@ std::unique_ptr<Packet> RtcEventLogSource::NextPacket() {
|
||||
for (; rtp_packet_index_ < parsed_stream_.GetNumberOfEvents();
|
||||
rtp_packet_index_++) {
|
||||
if (parsed_stream_.GetEventType(rtp_packet_index_) ==
|
||||
ParsedRtcEventLog::RTP_EVENT) {
|
||||
ParsedRtcEventLogNew::RTP_EVENT) {
|
||||
PacketDirection direction;
|
||||
size_t header_length;
|
||||
size_t packet_length;
|
||||
@ -66,7 +66,7 @@ std::unique_ptr<Packet> RtcEventLogSource::NextPacket() {
|
||||
}
|
||||
|
||||
if (parsed_stream_.GetMediaType(packet->header().ssrc, direction) !=
|
||||
webrtc::ParsedRtcEventLog::MediaType::AUDIO) {
|
||||
ParsedRtcEventLogNew::MediaType::AUDIO) {
|
||||
continue;
|
||||
}
|
||||
|
||||
@ -84,13 +84,11 @@ std::unique_ptr<Packet> RtcEventLogSource::NextPacket() {
|
||||
int64_t RtcEventLogSource::NextAudioOutputEventMs() {
|
||||
while (audio_output_index_ < parsed_stream_.GetNumberOfEvents()) {
|
||||
if (parsed_stream_.GetEventType(audio_output_index_) ==
|
||||
ParsedRtcEventLog::AUDIO_PLAYOUT_EVENT) {
|
||||
uint64_t timestamp_us = parsed_stream_.GetTimestamp(audio_output_index_);
|
||||
// We call GetAudioPlayout only to check that the protobuf event is
|
||||
// well-formed.
|
||||
parsed_stream_.GetAudioPlayout(audio_output_index_, nullptr);
|
||||
ParsedRtcEventLogNew::AUDIO_PLAYOUT_EVENT) {
|
||||
LoggedAudioPlayoutEvent playout_event =
|
||||
parsed_stream_.GetAudioPlayout(audio_output_index_);
|
||||
audio_output_index_++;
|
||||
return timestamp_us / 1000;
|
||||
return playout_event.timestamp_us / 1000;
|
||||
}
|
||||
audio_output_index_++;
|
||||
}
|
||||
|
@ -14,7 +14,7 @@
|
||||
#include <memory>
|
||||
#include <string>
|
||||
|
||||
#include "logging/rtc_event_log/rtc_event_log_parser.h"
|
||||
#include "logging/rtc_event_log/rtc_event_log_parser_new.h"
|
||||
#include "modules/audio_coding/neteq/tools/packet_source.h"
|
||||
#include "modules/rtp_rtcp/include/rtp_rtcp_defines.h"
|
||||
#include "rtc_base/constructormagic.h"
|
||||
@ -53,7 +53,7 @@ class RtcEventLogSource : public PacketSource {
|
||||
size_t rtp_packet_index_ = 0;
|
||||
size_t audio_output_index_ = 0;
|
||||
|
||||
ParsedRtcEventLog parsed_stream_;
|
||||
ParsedRtcEventLogNew parsed_stream_;
|
||||
std::unique_ptr<RtpHeaderParser> parser_;
|
||||
|
||||
RTC_DISALLOW_COPY_AND_ASSIGN(RtcEventLogSource);
|
||||
|
@ -237,6 +237,7 @@ if (!build_with_chromium) {
|
||||
"../rtc_base:checks",
|
||||
"../rtc_base:rtc_base_approved",
|
||||
"../rtc_base:rtc_numerics",
|
||||
"../rtc_base:stringutils",
|
||||
|
||||
# TODO(kwiberg): Remove this dependency.
|
||||
"../api/audio_codecs:audio_codecs_api",
|
||||
|
File diff suppressed because it is too large
Load Diff
@ -18,70 +18,27 @@
|
||||
#include <utility>
|
||||
#include <vector>
|
||||
|
||||
#include "logging/rtc_event_log/rtc_event_log_parser.h"
|
||||
#include "modules/audio_coding/audio_network_adaptor/include/audio_network_adaptor.h"
|
||||
#include "modules/rtp_rtcp/include/rtp_rtcp_defines.h"
|
||||
#include "modules/rtp_rtcp/source/rtcp_packet.h"
|
||||
#include "rtc_base/function_view.h"
|
||||
#include "logging/rtc_event_log/rtc_event_log_parser_new.h"
|
||||
#include "rtc_base/strings/string_builder.h"
|
||||
#include "rtc_tools/event_log_visualizer/plot_base.h"
|
||||
#include "rtc_tools/event_log_visualizer/triage_notifications.h"
|
||||
|
||||
namespace webrtc {
|
||||
namespace plotting {
|
||||
|
||||
struct LoggedRtpPacket {
|
||||
LoggedRtpPacket(uint64_t timestamp,
|
||||
RTPHeader header,
|
||||
size_t header_length,
|
||||
size_t total_length)
|
||||
: timestamp(timestamp),
|
||||
header(header),
|
||||
header_length(header_length),
|
||||
total_length(total_length) {}
|
||||
uint64_t timestamp;
|
||||
// TODO(terelius): This allocates space for 15 CSRCs even if none are used.
|
||||
RTPHeader header;
|
||||
size_t header_length;
|
||||
size_t total_length;
|
||||
};
|
||||
|
||||
struct LoggedRtcpPacket {
|
||||
LoggedRtcpPacket(uint64_t timestamp,
|
||||
RTCPPacketType rtcp_type,
|
||||
std::unique_ptr<rtcp::RtcpPacket> rtcp_packet)
|
||||
: timestamp(timestamp), type(rtcp_type), packet(std::move(rtcp_packet)) {}
|
||||
uint64_t timestamp;
|
||||
RTCPPacketType type;
|
||||
std::unique_ptr<rtcp::RtcpPacket> packet;
|
||||
};
|
||||
|
||||
struct LossBasedBweUpdate {
|
||||
uint64_t timestamp;
|
||||
int32_t new_bitrate;
|
||||
uint8_t fraction_loss;
|
||||
int32_t expected_packets;
|
||||
};
|
||||
|
||||
struct AudioNetworkAdaptationEvent {
|
||||
uint64_t timestamp;
|
||||
AudioEncoderRuntimeConfig config;
|
||||
};
|
||||
|
||||
class EventLogAnalyzer {
|
||||
public:
|
||||
// The EventLogAnalyzer keeps a reference to the ParsedRtcEventLog for the
|
||||
// duration of its lifetime. The ParsedRtcEventLog must not be destroyed or
|
||||
// The EventLogAnalyzer keeps a reference to the ParsedRtcEventLogNew for the
|
||||
// duration of its lifetime. The ParsedRtcEventLogNew must not be destroyed or
|
||||
// modified while the EventLogAnalyzer is being used.
|
||||
explicit EventLogAnalyzer(const ParsedRtcEventLog& log);
|
||||
explicit EventLogAnalyzer(const ParsedRtcEventLogNew& log);
|
||||
|
||||
void CreatePacketGraph(PacketDirection desired_direction, Plot* plot);
|
||||
void CreatePacketGraph(PacketDirection direction, Plot* plot);
|
||||
|
||||
void CreateAccumulatedPacketsGraph(PacketDirection desired_direction,
|
||||
Plot* plot);
|
||||
void CreateAccumulatedPacketsGraph(PacketDirection direction, Plot* plot);
|
||||
|
||||
void CreatePlayoutGraph(Plot* plot);
|
||||
|
||||
void CreateAudioLevelGraph(Plot* plot);
|
||||
void CreateAudioLevelGraph(PacketDirection direction, Plot* plot);
|
||||
|
||||
void CreateSequenceNumberGraph(Plot* plot);
|
||||
|
||||
@ -92,19 +49,20 @@ class EventLogAnalyzer {
|
||||
|
||||
void CreateFractionLossGraph(Plot* plot);
|
||||
|
||||
void CreateTotalBitrateGraph(PacketDirection desired_direction,
|
||||
Plot* plot,
|
||||
bool show_detector_state = false,
|
||||
bool show_alr_state = false);
|
||||
void CreateTotalIncomingBitrateGraph(Plot* plot);
|
||||
void CreateTotalOutgoingBitrateGraph(Plot* plot,
|
||||
bool show_detector_state = false,
|
||||
bool show_alr_state = false);
|
||||
|
||||
void CreateStreamBitrateGraph(PacketDirection desired_direction, Plot* plot);
|
||||
void CreateStreamBitrateGraph(PacketDirection direction, Plot* plot);
|
||||
|
||||
void CreateSendSideBweSimulationGraph(Plot* plot);
|
||||
void CreateReceiveSideBweSimulationGraph(Plot* plot);
|
||||
|
||||
void CreateNetworkDelayFeedbackGraph(Plot* plot);
|
||||
void CreatePacerDelayGraph(Plot* plot);
|
||||
void CreateTimestampGraph(Plot* plot);
|
||||
|
||||
void CreateTimestampGraph(PacketDirection direction, Plot* plot);
|
||||
|
||||
void CreateAudioEncoderTargetBitrateGraph(Plot* plot);
|
||||
void CreateAudioEncoderFrameLengthGraph(Plot* plot);
|
||||
@ -119,108 +77,136 @@ class EventLogAnalyzer {
|
||||
void CreateIceCandidatePairConfigGraph(Plot* plot);
|
||||
void CreateIceConnectivityCheckGraph(Plot* plot);
|
||||
|
||||
// Returns a vector of capture and arrival timestamps for the video frames
|
||||
// of the stream with the most number of frames.
|
||||
std::vector<std::pair<int64_t, int64_t>> GetFrameTimestamps() const;
|
||||
|
||||
void CreateTriageNotifications();
|
||||
void PrintNotifications(FILE* file);
|
||||
|
||||
private:
|
||||
class StreamId {
|
||||
public:
|
||||
StreamId(uint32_t ssrc, webrtc::PacketDirection direction)
|
||||
: ssrc_(ssrc), direction_(direction) {}
|
||||
bool operator<(const StreamId& other) const {
|
||||
return std::tie(ssrc_, direction_) <
|
||||
std::tie(other.ssrc_, other.direction_);
|
||||
bool IsRtxSsrc(PacketDirection direction, uint32_t ssrc) const {
|
||||
if (direction == kIncomingPacket) {
|
||||
return parsed_log_.incoming_rtx_ssrcs().find(ssrc) !=
|
||||
parsed_log_.incoming_rtx_ssrcs().end();
|
||||
} else {
|
||||
return parsed_log_.outgoing_rtx_ssrcs().find(ssrc) !=
|
||||
parsed_log_.outgoing_rtx_ssrcs().end();
|
||||
}
|
||||
bool operator==(const StreamId& other) const {
|
||||
return std::tie(ssrc_, direction_) ==
|
||||
std::tie(other.ssrc_, other.direction_);
|
||||
}
|
||||
|
||||
bool IsVideoSsrc(PacketDirection direction, uint32_t ssrc) const {
|
||||
if (direction == kIncomingPacket) {
|
||||
return parsed_log_.incoming_video_ssrcs().find(ssrc) !=
|
||||
parsed_log_.incoming_video_ssrcs().end();
|
||||
} else {
|
||||
return parsed_log_.outgoing_video_ssrcs().find(ssrc) !=
|
||||
parsed_log_.outgoing_video_ssrcs().end();
|
||||
}
|
||||
uint32_t GetSsrc() const { return ssrc_; }
|
||||
webrtc::PacketDirection GetDirection() const { return direction_; }
|
||||
}
|
||||
|
||||
private:
|
||||
uint32_t ssrc_;
|
||||
webrtc::PacketDirection direction_;
|
||||
};
|
||||
bool IsAudioSsrc(PacketDirection direction, uint32_t ssrc) const {
|
||||
if (direction == kIncomingPacket) {
|
||||
return parsed_log_.incoming_audio_ssrcs().find(ssrc) !=
|
||||
parsed_log_.incoming_audio_ssrcs().end();
|
||||
} else {
|
||||
return parsed_log_.outgoing_audio_ssrcs().find(ssrc) !=
|
||||
parsed_log_.outgoing_audio_ssrcs().end();
|
||||
}
|
||||
}
|
||||
|
||||
template <typename T>
|
||||
void CreateAccumulatedPacketsTimeSeries(
|
||||
PacketDirection desired_direction,
|
||||
Plot* plot,
|
||||
const std::map<StreamId, std::vector<T>>& packets,
|
||||
const std::string& label_prefix);
|
||||
template <typename IterableType>
|
||||
void CreateAccumulatedPacketsTimeSeries(Plot* plot,
|
||||
const IterableType& packets,
|
||||
const std::string& label);
|
||||
|
||||
bool IsRtxSsrc(StreamId stream_id) const;
|
||||
void CreateStreamGapAlerts(PacketDirection direction);
|
||||
void CreateTransmissionGapAlerts(PacketDirection direction);
|
||||
|
||||
bool IsVideoSsrc(StreamId stream_id) const;
|
||||
|
||||
bool IsAudioSsrc(StreamId stream_id) const;
|
||||
|
||||
std::string GetStreamName(StreamId stream_id) const;
|
||||
|
||||
rtc::Optional<uint32_t> EstimateRtpClockFrequency(
|
||||
const std::vector<LoggedRtpPacket>& packets) const;
|
||||
std::string GetStreamName(PacketDirection direction, uint32_t ssrc) const {
|
||||
char buffer[200];
|
||||
rtc::SimpleStringBuilder name(buffer);
|
||||
if (IsAudioSsrc(direction, ssrc)) {
|
||||
name << "Audio ";
|
||||
} else if (IsVideoSsrc(direction, ssrc)) {
|
||||
name << "Video ";
|
||||
} else {
|
||||
name << "Unknown ";
|
||||
}
|
||||
if (IsRtxSsrc(direction, ssrc)) {
|
||||
name << "RTX ";
|
||||
}
|
||||
if (direction == kIncomingPacket)
|
||||
name << "(In) ";
|
||||
else
|
||||
name << "(Out) ";
|
||||
name << "SSRC " << ssrc;
|
||||
return name.str();
|
||||
}
|
||||
|
||||
float ToCallTime(int64_t timestamp) const;
|
||||
|
||||
void Notification(std::unique_ptr<TriageNotification> notification);
|
||||
void Alert_RtpLogTimeGap(PacketDirection direction,
|
||||
float time_seconds,
|
||||
int64_t duration) {
|
||||
if (direction == kIncomingPacket) {
|
||||
incoming_rtp_recv_time_gaps_.emplace_back(time_seconds, duration);
|
||||
} else {
|
||||
outgoing_rtp_send_time_gaps_.emplace_back(time_seconds, duration);
|
||||
}
|
||||
}
|
||||
|
||||
void Alert_RtcpLogTimeGap(PacketDirection direction,
|
||||
float time_seconds,
|
||||
int64_t duration) {
|
||||
if (direction == kIncomingPacket) {
|
||||
incoming_rtcp_recv_time_gaps_.emplace_back(time_seconds, duration);
|
||||
} else {
|
||||
outgoing_rtcp_send_time_gaps_.emplace_back(time_seconds, duration);
|
||||
}
|
||||
}
|
||||
|
||||
void Alert_SeqNumJump(PacketDirection direction,
|
||||
float time_seconds,
|
||||
uint32_t ssrc) {
|
||||
if (direction == kIncomingPacket) {
|
||||
incoming_seq_num_jumps_.emplace_back(time_seconds, ssrc);
|
||||
} else {
|
||||
outgoing_seq_num_jumps_.emplace_back(time_seconds, ssrc);
|
||||
}
|
||||
}
|
||||
|
||||
void Alert_CaptureTimeJump(PacketDirection direction,
|
||||
float time_seconds,
|
||||
uint32_t ssrc) {
|
||||
if (direction == kIncomingPacket) {
|
||||
incoming_capture_time_jumps_.emplace_back(time_seconds, ssrc);
|
||||
} else {
|
||||
outgoing_capture_time_jumps_.emplace_back(time_seconds, ssrc);
|
||||
}
|
||||
}
|
||||
|
||||
void Alert_OutgoingHighLoss(double avg_loss_fraction) {
|
||||
outgoing_high_loss_alerts_.emplace_back(avg_loss_fraction);
|
||||
}
|
||||
|
||||
std::string GetCandidatePairLogDescriptionFromId(uint32_t candidate_pair_id);
|
||||
|
||||
const ParsedRtcEventLog& parsed_log_;
|
||||
const ParsedRtcEventLogNew& parsed_log_;
|
||||
|
||||
// A list of SSRCs we are interested in analysing.
|
||||
// If left empty, all SSRCs will be considered relevant.
|
||||
std::vector<uint32_t> desired_ssrc_;
|
||||
|
||||
// Tracks what each stream is configured for. Note that a single SSRC can be
|
||||
// in several sets. For example, the SSRC used for sending video over RTX
|
||||
// will appear in both video_ssrcs_ and rtx_ssrcs_. In the unlikely case that
|
||||
// an SSRC is reconfigured to a different media type mid-call, it will also
|
||||
// appear in multiple sets.
|
||||
std::set<StreamId> rtx_ssrcs_;
|
||||
std::set<StreamId> video_ssrcs_;
|
||||
std::set<StreamId> audio_ssrcs_;
|
||||
|
||||
// Maps a stream identifier consisting of ssrc and direction to the parsed
|
||||
// RTP headers in that stream. Header extensions are parsed if the stream
|
||||
// has been configured.
|
||||
std::map<StreamId, std::vector<LoggedRtpPacket>> rtp_packets_;
|
||||
|
||||
std::map<StreamId, std::vector<LoggedRtcpPacket>> rtcp_packets_;
|
||||
|
||||
// Maps an SSRC to the timestamps of parsed audio playout events.
|
||||
std::map<uint32_t, std::vector<uint64_t>> audio_playout_events_;
|
||||
|
||||
// Stores the timestamps for all log segments, in the form of associated start
|
||||
// and end events.
|
||||
std::vector<std::pair<uint64_t, uint64_t>> log_segments_;
|
||||
std::vector<std::pair<int64_t, int64_t>> log_segments_;
|
||||
|
||||
// A list of all updates from the send-side loss-based bandwidth estimator.
|
||||
std::vector<LossBasedBweUpdate> bwe_loss_updates_;
|
||||
|
||||
std::vector<AudioNetworkAdaptationEvent> audio_network_adaptation_events_;
|
||||
|
||||
std::vector<ParsedRtcEventLog::BweProbeClusterCreatedEvent>
|
||||
bwe_probe_cluster_created_events_;
|
||||
|
||||
std::vector<ParsedRtcEventLog::BweProbeResultEvent> bwe_probe_result_events_;
|
||||
|
||||
std::vector<ParsedRtcEventLog::BweDelayBasedUpdate> bwe_delay_updates_;
|
||||
|
||||
std::vector<std::unique_ptr<TriageNotification>> notifications_;
|
||||
|
||||
std::vector<ParsedRtcEventLog::AlrStateEvent> alr_state_events_;
|
||||
|
||||
std::vector<ParsedRtcEventLog::IceCandidatePairConfig>
|
||||
ice_candidate_pair_configs_;
|
||||
|
||||
std::vector<ParsedRtcEventLog::IceCandidatePairEvent>
|
||||
ice_candidate_pair_events_;
|
||||
std::vector<IncomingRtpReceiveTimeGap> incoming_rtp_recv_time_gaps_;
|
||||
std::vector<IncomingRtcpReceiveTimeGap> incoming_rtcp_recv_time_gaps_;
|
||||
std::vector<OutgoingRtpSendTimeGap> outgoing_rtp_send_time_gaps_;
|
||||
std::vector<OutgoingRtcpSendTimeGap> outgoing_rtcp_send_time_gaps_;
|
||||
std::vector<IncomingSeqNumJump> incoming_seq_num_jumps_;
|
||||
std::vector<IncomingCaptureTimeJump> incoming_capture_time_jumps_;
|
||||
std::vector<OutgoingSeqNoJump> outgoing_seq_num_jumps_;
|
||||
std::vector<OutgoingCaptureTimeJump> outgoing_capture_time_jumps_;
|
||||
std::vector<OutgoingHighLoss> outgoing_high_loss_alerts_;
|
||||
|
||||
std::map<uint32_t, std::string> candidate_pair_desc_by_id_;
|
||||
|
||||
@ -228,18 +214,17 @@ class EventLogAnalyzer {
|
||||
// The generated data points will be |step_| microseconds apart.
|
||||
// Only events occuring at most |window_duration_| microseconds before the
|
||||
// current data point will be part of the average.
|
||||
uint64_t window_duration_;
|
||||
uint64_t step_;
|
||||
int64_t window_duration_;
|
||||
int64_t step_;
|
||||
|
||||
// First and last events of the log.
|
||||
uint64_t begin_time_;
|
||||
uint64_t end_time_;
|
||||
int64_t begin_time_;
|
||||
int64_t end_time_;
|
||||
|
||||
// Duration (in seconds) of log file.
|
||||
float call_duration_s_;
|
||||
};
|
||||
|
||||
} // namespace plotting
|
||||
} // namespace webrtc
|
||||
|
||||
#endif // RTC_TOOLS_EVENT_LOG_VISUALIZER_ANALYZER_H_
|
||||
|
@ -10,7 +10,7 @@
|
||||
|
||||
#include <iostream>
|
||||
|
||||
#include "logging/rtc_event_log/rtc_event_log_parser.h"
|
||||
#include "logging/rtc_event_log/rtc_event_log_parser_new.h"
|
||||
#include "rtc_base/flags.h"
|
||||
#include "rtc_tools/event_log_visualizer/analyzer.h"
|
||||
#include "rtc_tools/event_log_visualizer/plot_base.h"
|
||||
@ -143,10 +143,15 @@ DEFINE_bool(show_alr_state,
|
||||
false,
|
||||
"Show the state ALR state on the total bitrate graph");
|
||||
|
||||
DEFINE_bool(
|
||||
print_triage_notifications,
|
||||
false,
|
||||
"Print triage notifications, i.e. a list of suspicious looking events.");
|
||||
DEFINE_bool(parse_unconfigured_header_extensions,
|
||||
true,
|
||||
"Attempt to parse unconfigured header extensions using the default "
|
||||
"WebRTC mapping. This can give very misleading results if the "
|
||||
"application negotiates a different mapping.");
|
||||
|
||||
DEFINE_bool(print_triage_alerts,
|
||||
false,
|
||||
"Print triage alerts, i.e. a list of potential problems.");
|
||||
|
||||
void SetAllPlotFlags(bool setting);
|
||||
|
||||
@ -209,7 +214,13 @@ int main(int argc, char* argv[]) {
|
||||
|
||||
std::string filename = argv[1];
|
||||
|
||||
webrtc::ParsedRtcEventLog parsed_log;
|
||||
webrtc::ParsedRtcEventLogNew::UnconfiguredHeaderExtensions header_extensions =
|
||||
webrtc::ParsedRtcEventLogNew::UnconfiguredHeaderExtensions::kDontParse;
|
||||
if (FLAG_parse_unconfigured_header_extensions) {
|
||||
header_extensions = webrtc::ParsedRtcEventLogNew::
|
||||
UnconfiguredHeaderExtensions::kAttemptWebrtcDefaultConfig;
|
||||
}
|
||||
webrtc::ParsedRtcEventLogNew parsed_log(header_extensions);
|
||||
|
||||
if (!parsed_log.ParseFile(filename)) {
|
||||
std::cerr << "Could not parse the entire log file." << std::endl;
|
||||
@ -218,31 +229,34 @@ int main(int argc, char* argv[]) {
|
||||
<< std::endl;
|
||||
}
|
||||
|
||||
webrtc::plotting::EventLogAnalyzer analyzer(parsed_log);
|
||||
std::unique_ptr<webrtc::plotting::PlotCollection> collection(
|
||||
new webrtc::plotting::PythonPlotCollection());
|
||||
webrtc::EventLogAnalyzer analyzer(parsed_log);
|
||||
std::unique_ptr<webrtc::PlotCollection> collection(
|
||||
new webrtc::PythonPlotCollection());
|
||||
|
||||
if (FLAG_plot_incoming_packet_sizes) {
|
||||
analyzer.CreatePacketGraph(webrtc::PacketDirection::kIncomingPacket,
|
||||
analyzer.CreatePacketGraph(webrtc::kIncomingPacket,
|
||||
collection->AppendNewPlot());
|
||||
}
|
||||
if (FLAG_plot_outgoing_packet_sizes) {
|
||||
analyzer.CreatePacketGraph(webrtc::PacketDirection::kOutgoingPacket,
|
||||
analyzer.CreatePacketGraph(webrtc::kOutgoingPacket,
|
||||
collection->AppendNewPlot());
|
||||
}
|
||||
if (FLAG_plot_incoming_packet_count) {
|
||||
analyzer.CreateAccumulatedPacketsGraph(
|
||||
webrtc::PacketDirection::kIncomingPacket, collection->AppendNewPlot());
|
||||
analyzer.CreateAccumulatedPacketsGraph(webrtc::kIncomingPacket,
|
||||
collection->AppendNewPlot());
|
||||
}
|
||||
if (FLAG_plot_outgoing_packet_count) {
|
||||
analyzer.CreateAccumulatedPacketsGraph(
|
||||
webrtc::PacketDirection::kOutgoingPacket, collection->AppendNewPlot());
|
||||
analyzer.CreateAccumulatedPacketsGraph(webrtc::kOutgoingPacket,
|
||||
collection->AppendNewPlot());
|
||||
}
|
||||
if (FLAG_plot_audio_playout) {
|
||||
analyzer.CreatePlayoutGraph(collection->AppendNewPlot());
|
||||
}
|
||||
if (FLAG_plot_audio_level) {
|
||||
analyzer.CreateAudioLevelGraph(collection->AppendNewPlot());
|
||||
analyzer.CreateAudioLevelGraph(webrtc::kIncomingPacket,
|
||||
collection->AppendNewPlot());
|
||||
analyzer.CreateAudioLevelGraph(webrtc::kOutgoingPacket,
|
||||
collection->AppendNewPlot());
|
||||
}
|
||||
if (FLAG_plot_incoming_sequence_number_delta) {
|
||||
analyzer.CreateSequenceNumberGraph(collection->AppendNewPlot());
|
||||
@ -257,23 +271,19 @@ int main(int argc, char* argv[]) {
|
||||
analyzer.CreateIncomingPacketLossGraph(collection->AppendNewPlot());
|
||||
}
|
||||
if (FLAG_plot_incoming_bitrate) {
|
||||
analyzer.CreateTotalBitrateGraph(webrtc::PacketDirection::kIncomingPacket,
|
||||
collection->AppendNewPlot(),
|
||||
FLAG_show_detector_state,
|
||||
FLAG_show_alr_state);
|
||||
analyzer.CreateTotalIncomingBitrateGraph(collection->AppendNewPlot());
|
||||
}
|
||||
if (FLAG_plot_outgoing_bitrate) {
|
||||
analyzer.CreateTotalBitrateGraph(webrtc::PacketDirection::kOutgoingPacket,
|
||||
collection->AppendNewPlot(),
|
||||
FLAG_show_detector_state,
|
||||
FLAG_show_alr_state);
|
||||
analyzer.CreateTotalOutgoingBitrateGraph(collection->AppendNewPlot(),
|
||||
FLAG_show_detector_state,
|
||||
FLAG_show_alr_state);
|
||||
}
|
||||
if (FLAG_plot_incoming_stream_bitrate) {
|
||||
analyzer.CreateStreamBitrateGraph(webrtc::PacketDirection::kIncomingPacket,
|
||||
analyzer.CreateStreamBitrateGraph(webrtc::kIncomingPacket,
|
||||
collection->AppendNewPlot());
|
||||
}
|
||||
if (FLAG_plot_outgoing_stream_bitrate) {
|
||||
analyzer.CreateStreamBitrateGraph(webrtc::PacketDirection::kOutgoingPacket,
|
||||
analyzer.CreateStreamBitrateGraph(webrtc::kOutgoingPacket,
|
||||
collection->AppendNewPlot());
|
||||
}
|
||||
if (FLAG_plot_simulated_receiveside_bwe) {
|
||||
@ -289,7 +299,10 @@ int main(int argc, char* argv[]) {
|
||||
analyzer.CreateFractionLossGraph(collection->AppendNewPlot());
|
||||
}
|
||||
if (FLAG_plot_timestamps) {
|
||||
analyzer.CreateTimestampGraph(collection->AppendNewPlot());
|
||||
analyzer.CreateTimestampGraph(webrtc::kIncomingPacket,
|
||||
collection->AppendNewPlot());
|
||||
analyzer.CreateTimestampGraph(webrtc::kOutgoingPacket,
|
||||
collection->AppendNewPlot());
|
||||
}
|
||||
if (FLAG_plot_pacer_delay) {
|
||||
analyzer.CreatePacerDelayGraph(collection->AppendNewPlot());
|
||||
@ -333,7 +346,7 @@ int main(int argc, char* argv[]) {
|
||||
|
||||
collection->Draw();
|
||||
|
||||
if (FLAG_print_triage_notifications) {
|
||||
if (FLAG_print_triage_alerts) {
|
||||
analyzer.CreateTriageNotifications();
|
||||
analyzer.PrintNotifications(stderr);
|
||||
}
|
||||
|
@ -15,7 +15,6 @@
|
||||
#include "rtc_base/checks.h"
|
||||
|
||||
namespace webrtc {
|
||||
namespace plotting {
|
||||
|
||||
void Plot::SetXAxis(float min_value,
|
||||
float max_value,
|
||||
@ -85,5 +84,4 @@ void Plot::AppendTimeSeriesIfNotEmpty(TimeSeries&& time_series) {
|
||||
}
|
||||
}
|
||||
|
||||
} // namespace plotting
|
||||
} // namespace webrtc
|
||||
|
@ -16,7 +16,6 @@
|
||||
#include <vector>
|
||||
|
||||
namespace webrtc {
|
||||
namespace plotting {
|
||||
|
||||
enum class LineStyle {
|
||||
kNone, // No line connecting the points. Used to create scatter plots.
|
||||
@ -173,7 +172,6 @@ class PlotCollection {
|
||||
std::vector<std::unique_ptr<Plot> > plots_;
|
||||
};
|
||||
|
||||
} // namespace plotting
|
||||
} // namespace webrtc
|
||||
|
||||
#endif // RTC_TOOLS_EVENT_LOG_VISUALIZER_PLOT_BASE_H_
|
||||
|
@ -13,7 +13,6 @@
|
||||
#include <memory>
|
||||
|
||||
namespace webrtc {
|
||||
namespace plotting {
|
||||
|
||||
ProtobufPlot::ProtobufPlot() {}
|
||||
|
||||
@ -83,5 +82,4 @@ Plot* ProtobufPlotCollection::AppendNewPlot() {
|
||||
return plot;
|
||||
}
|
||||
|
||||
} // namespace plotting
|
||||
} // namespace webrtc
|
||||
|
@ -17,7 +17,6 @@ RTC_POP_IGNORING_WUNDEF()
|
||||
#include "rtc_tools/event_log_visualizer/plot_base.h"
|
||||
|
||||
namespace webrtc {
|
||||
namespace plotting {
|
||||
|
||||
class ProtobufPlot final : public Plot {
|
||||
public:
|
||||
@ -36,7 +35,6 @@ class ProtobufPlotCollection final : public PlotCollection {
|
||||
void ExportProtobuf(webrtc::analytics::ChartCollection* collection);
|
||||
};
|
||||
|
||||
} // namespace plotting
|
||||
} // namespace webrtc
|
||||
|
||||
#endif // RTC_TOOLS_EVENT_LOG_VISUALIZER_PLOT_PROTOBUF_H_
|
||||
|
@ -17,7 +17,6 @@
|
||||
#include "rtc_base/checks.h"
|
||||
|
||||
namespace webrtc {
|
||||
namespace plotting {
|
||||
|
||||
PythonPlot::PythonPlot() {}
|
||||
|
||||
@ -180,5 +179,4 @@ Plot* PythonPlotCollection::AppendNewPlot() {
|
||||
return plot;
|
||||
}
|
||||
|
||||
} // namespace plotting
|
||||
} // namespace webrtc
|
||||
|
@ -13,7 +13,6 @@
|
||||
#include "rtc_tools/event_log_visualizer/plot_base.h"
|
||||
|
||||
namespace webrtc {
|
||||
namespace plotting {
|
||||
|
||||
class PythonPlot final : public Plot {
|
||||
public:
|
||||
@ -30,7 +29,6 @@ class PythonPlotCollection final : public PlotCollection {
|
||||
Plot* AppendNewPlot() override;
|
||||
};
|
||||
|
||||
} // namespace plotting
|
||||
} // namespace webrtc
|
||||
|
||||
#endif // RTC_TOOLS_EVENT_LOG_VISUALIZER_PLOT_PYTHON_H_
|
||||
|
@ -14,130 +14,136 @@
|
||||
#include <string>
|
||||
|
||||
namespace webrtc {
|
||||
namespace plotting {
|
||||
|
||||
class TriageNotification {
|
||||
public:
|
||||
TriageNotification() : time_seconds_() {}
|
||||
explicit TriageNotification(float time_seconds)
|
||||
: time_seconds_(time_seconds) {}
|
||||
virtual ~TriageNotification() = default;
|
||||
virtual std::string ToString() = 0;
|
||||
rtc::Optional<float> Time() { return time_seconds_; }
|
||||
|
||||
private:
|
||||
rtc::Optional<float> time_seconds_;
|
||||
};
|
||||
|
||||
class IncomingRtpReceiveTimeGap : public TriageNotification {
|
||||
class IncomingRtpReceiveTimeGap {
|
||||
public:
|
||||
IncomingRtpReceiveTimeGap(float time_seconds, int64_t duration)
|
||||
: TriageNotification(time_seconds), duration_(duration) {}
|
||||
std::string ToString() {
|
||||
: time_seconds_(time_seconds), duration_(duration) {}
|
||||
float Time() const { return time_seconds_; }
|
||||
std::string ToString() const {
|
||||
return std::string("No RTP packets received for ") +
|
||||
std::to_string(duration_) + std::string(" ms");
|
||||
}
|
||||
|
||||
private:
|
||||
float time_seconds_;
|
||||
int64_t duration_;
|
||||
};
|
||||
|
||||
class IncomingRtcpReceiveTimeGap : public TriageNotification {
|
||||
class IncomingRtcpReceiveTimeGap {
|
||||
public:
|
||||
IncomingRtcpReceiveTimeGap(float time_seconds, int64_t duration)
|
||||
: TriageNotification(time_seconds), duration_(duration) {}
|
||||
std::string ToString() {
|
||||
: time_seconds_(time_seconds), duration_(duration) {}
|
||||
float Time() const { return time_seconds_; }
|
||||
std::string ToString() const {
|
||||
return std::string("No RTCP packets received for ") +
|
||||
std::to_string(duration_) + std::string(" ms");
|
||||
}
|
||||
|
||||
private:
|
||||
float time_seconds_;
|
||||
int64_t duration_;
|
||||
};
|
||||
|
||||
class OutgoingRtpSendTimeGap : public TriageNotification {
|
||||
class OutgoingRtpSendTimeGap {
|
||||
public:
|
||||
OutgoingRtpSendTimeGap(float time_seconds, int64_t duration)
|
||||
: TriageNotification(time_seconds), duration_(duration) {}
|
||||
std::string ToString() {
|
||||
: time_seconds_(time_seconds), duration_(duration) {}
|
||||
float Time() const { return time_seconds_; }
|
||||
std::string ToString() const {
|
||||
return std::string("No RTP packets sent for ") + std::to_string(duration_) +
|
||||
std::string(" ms");
|
||||
}
|
||||
|
||||
private:
|
||||
float time_seconds_;
|
||||
int64_t duration_;
|
||||
};
|
||||
|
||||
class OutgoingRtcpSendTimeGap : public TriageNotification {
|
||||
class OutgoingRtcpSendTimeGap {
|
||||
public:
|
||||
OutgoingRtcpSendTimeGap(float time_seconds, int64_t duration)
|
||||
: TriageNotification(time_seconds), duration_(duration) {}
|
||||
std::string ToString() {
|
||||
: time_seconds_(time_seconds), duration_(duration) {}
|
||||
float Time() const { return time_seconds_; }
|
||||
std::string ToString() const {
|
||||
return std::string("No RTCP packets sent for ") +
|
||||
std::to_string(duration_) + std::string(" ms");
|
||||
}
|
||||
|
||||
private:
|
||||
float time_seconds_;
|
||||
int64_t duration_;
|
||||
};
|
||||
|
||||
class IncomingSeqNoJump : public TriageNotification {
|
||||
class IncomingSeqNumJump {
|
||||
public:
|
||||
IncomingSeqNoJump(float time_seconds, uint32_t ssrc)
|
||||
: TriageNotification(time_seconds), ssrc_(ssrc) {}
|
||||
std::string ToString() {
|
||||
IncomingSeqNumJump(float time_seconds, uint32_t ssrc)
|
||||
: time_seconds_(time_seconds), ssrc_(ssrc) {}
|
||||
float Time() const { return time_seconds_; }
|
||||
std::string ToString() const {
|
||||
return std::string("Sequence number jumps on incoming SSRC ") +
|
||||
std::to_string(ssrc_);
|
||||
}
|
||||
|
||||
private:
|
||||
float time_seconds_;
|
||||
|
||||
uint32_t ssrc_;
|
||||
};
|
||||
|
||||
class IncomingCaptureTimeJump : public TriageNotification {
|
||||
class IncomingCaptureTimeJump {
|
||||
public:
|
||||
IncomingCaptureTimeJump(float time_seconds, uint32_t ssrc)
|
||||
: TriageNotification(time_seconds), ssrc_(ssrc) {}
|
||||
std::string ToString() {
|
||||
: time_seconds_(time_seconds), ssrc_(ssrc) {}
|
||||
float Time() const { return time_seconds_; }
|
||||
std::string ToString() const {
|
||||
return std::string("Capture timestamp jumps on incoming SSRC ") +
|
||||
std::to_string(ssrc_);
|
||||
}
|
||||
|
||||
private:
|
||||
float time_seconds_;
|
||||
|
||||
uint32_t ssrc_;
|
||||
};
|
||||
|
||||
class OutgoingSeqNoJump : public TriageNotification {
|
||||
class OutgoingSeqNoJump {
|
||||
public:
|
||||
OutgoingSeqNoJump(float time_seconds, uint32_t ssrc)
|
||||
: TriageNotification(time_seconds), ssrc_(ssrc) {}
|
||||
std::string ToString() {
|
||||
: time_seconds_(time_seconds), ssrc_(ssrc) {}
|
||||
float Time() const { return time_seconds_; }
|
||||
std::string ToString() const {
|
||||
return std::string("Sequence number jumps on outgoing SSRC ") +
|
||||
std::to_string(ssrc_);
|
||||
}
|
||||
|
||||
private:
|
||||
float time_seconds_;
|
||||
|
||||
uint32_t ssrc_;
|
||||
};
|
||||
|
||||
class OutgoingCaptureTimeJump : public TriageNotification {
|
||||
class OutgoingCaptureTimeJump {
|
||||
public:
|
||||
OutgoingCaptureTimeJump(float time_seconds, uint32_t ssrc)
|
||||
: TriageNotification(time_seconds), ssrc_(ssrc) {}
|
||||
std::string ToString() {
|
||||
: time_seconds_(time_seconds), ssrc_(ssrc) {}
|
||||
float Time() const { return time_seconds_; }
|
||||
std::string ToString() const {
|
||||
return std::string("Capture timestamp jumps on outgoing SSRC ") +
|
||||
std::to_string(ssrc_);
|
||||
}
|
||||
|
||||
private:
|
||||
float time_seconds_;
|
||||
|
||||
uint32_t ssrc_;
|
||||
};
|
||||
|
||||
class OutgoingHighLoss : public TriageNotification {
|
||||
class OutgoingHighLoss {
|
||||
public:
|
||||
explicit OutgoingHighLoss(double avg_loss_fraction)
|
||||
: avg_loss_fraction_(avg_loss_fraction) {}
|
||||
std::string ToString() {
|
||||
std::string ToString() const {
|
||||
return std::string("High average loss (") +
|
||||
std::to_string(avg_loss_fraction_ * 100) +
|
||||
std::string("%) across the call.");
|
||||
@ -147,7 +153,6 @@ class OutgoingHighLoss : public TriageNotification {
|
||||
double avg_loss_fraction_;
|
||||
};
|
||||
|
||||
} // namespace plotting
|
||||
} // namespace webrtc
|
||||
|
||||
#endif // RTC_TOOLS_EVENT_LOG_VISUALIZER_TRIAGE_NOTIFICATIONS_H_
|
||||
|
Reference in New Issue
Block a user