Create new API for RtcEventLogParser.
The new API stores events gathered by event type. For example, it is possible to ask fo 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: I8e7168302beb69b2e163a097a2a142b86dd4a26b Reviewed-on: https://webrtc-review.googlesource.com/60865 Reviewed-by: Minyue Li <minyue@webrtc.org> Reviewed-by: Sebastian Jansson <srte@webrtc.org> Commit-Queue: Björn Terelius <terelius@webrtc.org> Cr-Commit-Position: refs/heads/master@{#23015}
This commit is contained in:
committed by
Commit Bot
parent
a945aee72e
commit
9e336ec0b8
@ -253,8 +253,8 @@ if (rtc_enable_protobuf) {
|
|||||||
|
|
||||||
rtc_static_library("rtc_event_log_parser") {
|
rtc_static_library("rtc_event_log_parser") {
|
||||||
sources = [
|
sources = [
|
||||||
"rtc_event_log/rtc_event_log_parser.cc",
|
"rtc_event_log/rtc_event_log_parser2.cc",
|
||||||
"rtc_event_log/rtc_event_log_parser.h",
|
"rtc_event_log/rtc_event_log_parser2.h",
|
||||||
]
|
]
|
||||||
|
|
||||||
deps = [
|
deps = [
|
||||||
@ -265,6 +265,7 @@ if (rtc_enable_protobuf) {
|
|||||||
":rtc_event_log_proto",
|
":rtc_event_log_proto",
|
||||||
":rtc_stream_config",
|
":rtc_stream_config",
|
||||||
"..:webrtc_common",
|
"..:webrtc_common",
|
||||||
|
"../api:libjingle_peerconnection_api",
|
||||||
"../call:video_stream_api",
|
"../call:video_stream_api",
|
||||||
"../modules/audio_coding:audio_network_adaptor",
|
"../modules/audio_coding:audio_network_adaptor",
|
||||||
"../modules/remote_bitrate_estimator:remote_bitrate_estimator",
|
"../modules/remote_bitrate_estimator:remote_bitrate_estimator",
|
||||||
@ -365,6 +366,7 @@ if (rtc_enable_protobuf) {
|
|||||||
"../rtc_base:checks",
|
"../rtc_base:checks",
|
||||||
"../rtc_base:protobuf_utils",
|
"../rtc_base:protobuf_utils",
|
||||||
"../rtc_base:rtc_base_approved",
|
"../rtc_base:rtc_base_approved",
|
||||||
|
"../rtc_base:stringutils",
|
||||||
|
|
||||||
# TODO(kwiberg): Remove this dependency.
|
# TODO(kwiberg): Remove this dependency.
|
||||||
"../api/audio_codecs:audio_codecs_api",
|
"../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_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_receive_stream_config.h"
|
||||||
#include "logging/rtc_event_log/events/rtc_event_video_send_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_parser2.h"
|
||||||
#include "modules/audio_coding/audio_network_adaptor/include/audio_network_adaptor_config.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/remote_bitrate_estimator/include/bwe_defines.h"
|
||||||
#include "modules/rtp_rtcp/source/rtcp_packet/bye.h" // Arbitrary RTCP message.
|
#include "modules/rtp_rtcp/source/rtcp_packet/bye.h" // Arbitrary RTCP message.
|
||||||
@ -142,11 +142,11 @@ void RtcEventLogEncoderTest::TestRtcEventAudioNetworkAdaptation(
|
|||||||
ASSERT_EQ(parsed_log_.GetEventType(0),
|
ASSERT_EQ(parsed_log_.GetEventType(0),
|
||||||
ParsedRtcEventLog::AUDIO_NETWORK_ADAPTATION_EVENT);
|
ParsedRtcEventLog::AUDIO_NETWORK_ADAPTATION_EVENT);
|
||||||
|
|
||||||
AudioEncoderRuntimeConfig parsed_runtime_config;
|
LoggedAudioNetworkAdaptationEvent parsed_event =
|
||||||
parsed_log_.GetAudioNetworkAdaptation(0, &parsed_runtime_config);
|
parsed_log_.GetAudioNetworkAdaptation(0);
|
||||||
|
|
||||||
EXPECT_EQ(parsed_log_.GetTimestamp(0), timestamp_us);
|
EXPECT_EQ(parsed_event.timestamp_us, timestamp_us);
|
||||||
EXPECT_EQ(parsed_runtime_config, original_runtime_config);
|
EXPECT_EQ(parsed_event.config, original_runtime_config);
|
||||||
}
|
}
|
||||||
|
|
||||||
TEST_P(RtcEventLogEncoderTest, RtcEventAudioNetworkAdaptationBitrate) {
|
TEST_P(RtcEventLogEncoderTest, RtcEventAudioNetworkAdaptationBitrate) {
|
||||||
@ -234,11 +234,10 @@ TEST_P(RtcEventLogEncoderTest, RtcEventAudioPlayout) {
|
|||||||
ASSERT_EQ(parsed_log_.GetEventType(0),
|
ASSERT_EQ(parsed_log_.GetEventType(0),
|
||||||
ParsedRtcEventLog::AUDIO_PLAYOUT_EVENT);
|
ParsedRtcEventLog::AUDIO_PLAYOUT_EVENT);
|
||||||
|
|
||||||
uint32_t parsed_ssrc;
|
LoggedAudioPlayoutEvent playout_event = parsed_log_.GetAudioPlayout(0);
|
||||||
parsed_log_.GetAudioPlayout(0, &parsed_ssrc);
|
|
||||||
|
|
||||||
EXPECT_EQ(parsed_log_.GetTimestamp(0), timestamp_us);
|
EXPECT_EQ(playout_event.timestamp_us, timestamp_us);
|
||||||
EXPECT_EQ(parsed_ssrc, ssrc);
|
EXPECT_EQ(playout_event.ssrc, ssrc);
|
||||||
}
|
}
|
||||||
|
|
||||||
TEST_P(RtcEventLogEncoderTest, RtcEventAudioReceiveStreamConfig) {
|
TEST_P(RtcEventLogEncoderTest, RtcEventAudioReceiveStreamConfig) {
|
||||||
@ -333,16 +332,12 @@ TEST_P(RtcEventLogEncoderTest, RtcEventBweUpdateLossBased) {
|
|||||||
ASSERT_EQ(parsed_log_.GetEventType(0),
|
ASSERT_EQ(parsed_log_.GetEventType(0),
|
||||||
ParsedRtcEventLog::LOSS_BASED_BWE_UPDATE);
|
ParsedRtcEventLog::LOSS_BASED_BWE_UPDATE);
|
||||||
|
|
||||||
int32_t parsed_bitrate_bps;
|
LoggedBweLossBasedUpdate bwe_update = parsed_log_.GetLossBasedBweUpdate(0);
|
||||||
uint8_t parsed_fraction_loss;
|
|
||||||
int32_t parsed_total_packets;
|
|
||||||
parsed_log_.GetLossBasedBweUpdate(
|
|
||||||
0, &parsed_bitrate_bps, &parsed_fraction_loss, &parsed_total_packets);
|
|
||||||
|
|
||||||
EXPECT_EQ(parsed_log_.GetTimestamp(0), timestamp_us);
|
EXPECT_EQ(bwe_update.timestamp_us, timestamp_us);
|
||||||
EXPECT_EQ(parsed_bitrate_bps, bitrate_bps);
|
EXPECT_EQ(bwe_update.bitrate_bps, bitrate_bps);
|
||||||
EXPECT_EQ(parsed_fraction_loss, fraction_loss);
|
EXPECT_EQ(bwe_update.fraction_lost, fraction_loss);
|
||||||
EXPECT_EQ(parsed_total_packets, total_packets);
|
EXPECT_EQ(bwe_update.expected_packets, total_packets);
|
||||||
}
|
}
|
||||||
|
|
||||||
TEST_P(RtcEventLogEncoderTest, RtcEventLoggingStarted) {
|
TEST_P(RtcEventLogEncoderTest, RtcEventLoggingStarted) {
|
||||||
|
|||||||
@ -21,6 +21,7 @@
|
|||||||
|
|
||||||
namespace webrtc {
|
namespace webrtc {
|
||||||
|
|
||||||
|
// TODO(terelius): Move this to the parser.
|
||||||
enum PacketDirection { kIncomingPacket = 0, kOutgoingPacket };
|
enum PacketDirection { kIncomingPacket = 0, kOutgoingPacket };
|
||||||
|
|
||||||
class RtcEventLog {
|
class RtcEventLog {
|
||||||
|
|||||||
@ -16,7 +16,7 @@
|
|||||||
#include <string>
|
#include <string>
|
||||||
|
|
||||||
#include "logging/rtc_event_log/rtc_event_log.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_parser2.h"
|
||||||
#include "modules/rtp_rtcp/source/byte_io.h"
|
#include "modules/rtp_rtcp/source/byte_io.h"
|
||||||
#include "modules/rtp_rtcp/source/rtp_utility.h"
|
#include "modules/rtp_rtcp/source/rtp_utility.h"
|
||||||
#include "rtc_base/checks.h"
|
#include "rtc_base/checks.h"
|
||||||
|
|||||||
@ -13,13 +13,12 @@
|
|||||||
#include <iomanip> // setfill, setw
|
#include <iomanip> // setfill, setw
|
||||||
#include <iostream>
|
#include <iostream>
|
||||||
#include <map>
|
#include <map>
|
||||||
#include <sstream>
|
|
||||||
#include <string>
|
#include <string>
|
||||||
#include <utility> // pair
|
#include <utility> // pair
|
||||||
|
|
||||||
#include "call/video_config.h"
|
#include "call/video_config.h"
|
||||||
#include "common_types.h" // NOLINT(build/include)
|
#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_parser2.h"
|
||||||
#include "modules/audio_coding/audio_network_adaptor/include/audio_network_adaptor_config.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/bye.h"
|
||||||
#include "modules/rtp_rtcp/source/rtcp_packet/common_header.h"
|
#include "modules/rtp_rtcp/source/rtcp_packet/common_header.h"
|
||||||
@ -40,6 +39,7 @@
|
|||||||
#include "rtc_base/checks.h"
|
#include "rtc_base/checks.h"
|
||||||
#include "rtc_base/flags.h"
|
#include "rtc_base/flags.h"
|
||||||
#include "rtc_base/logging.h"
|
#include "rtc_base/logging.h"
|
||||||
|
#include "rtc_base/strings/string_builder.h"
|
||||||
|
|
||||||
namespace {
|
namespace {
|
||||||
|
|
||||||
@ -443,7 +443,7 @@ int main(int argc, char* argv[]) {
|
|||||||
size_t total_length;
|
size_t total_length;
|
||||||
uint8_t header[IP_PACKET_SIZE];
|
uint8_t header[IP_PACKET_SIZE];
|
||||||
webrtc::PacketDirection direction;
|
webrtc::PacketDirection direction;
|
||||||
webrtc::RtpHeaderExtensionMap* extension_map =
|
const webrtc::RtpHeaderExtensionMap* extension_map =
|
||||||
parsed_stream.GetRtpHeader(i, &direction, header, &header_length,
|
parsed_stream.GetRtpHeader(i, &direction, header, &header_length,
|
||||||
&total_length, nullptr);
|
&total_length, nullptr);
|
||||||
|
|
||||||
@ -583,10 +583,9 @@ int main(int argc, char* argv[]) {
|
|||||||
|
|
||||||
case webrtc::ParsedRtcEventLog::AUDIO_PLAYOUT_EVENT: {
|
case webrtc::ParsedRtcEventLog::AUDIO_PLAYOUT_EVENT: {
|
||||||
if (FLAG_playout) {
|
if (FLAG_playout) {
|
||||||
uint32_t ssrc;
|
auto audio_playout = parsed_stream.GetAudioPlayout(i);
|
||||||
parsed_stream.GetAudioPlayout(i, &ssrc);
|
std::cout << audio_playout.log_time_us() << "\tAUDIO_PLAYOUT"
|
||||||
std::cout << parsed_stream.GetTimestamp(i) << "\tAUDIO_PLAYOUT"
|
<< "\tssrc=" << audio_playout.ssrc << std::endl;
|
||||||
<< "\tssrc=" << ssrc << std::endl;
|
|
||||||
}
|
}
|
||||||
event_recognized = true;
|
event_recognized = true;
|
||||||
break;
|
break;
|
||||||
@ -594,15 +593,13 @@ int main(int argc, char* argv[]) {
|
|||||||
|
|
||||||
case webrtc::ParsedRtcEventLog::LOSS_BASED_BWE_UPDATE: {
|
case webrtc::ParsedRtcEventLog::LOSS_BASED_BWE_UPDATE: {
|
||||||
if (FLAG_bwe) {
|
if (FLAG_bwe) {
|
||||||
int32_t bitrate_bps;
|
auto bwe_update = parsed_stream.GetLossBasedBweUpdate(i);
|
||||||
uint8_t fraction_loss;
|
std::cout << bwe_update.log_time_us() << "\tBWE(LOSS_BASED)"
|
||||||
int32_t total_packets;
|
<< "\tbitrate_bps=" << bwe_update.bitrate_bps
|
||||||
parsed_stream.GetLossBasedBweUpdate(i, &bitrate_bps, &fraction_loss,
|
<< "\tfraction_lost="
|
||||||
&total_packets);
|
<< static_cast<unsigned>(bwe_update.fraction_lost)
|
||||||
std::cout << parsed_stream.GetTimestamp(i) << "\tBWE(LOSS_BASED)"
|
<< "\texpected_packets=" << bwe_update.expected_packets
|
||||||
<< "\tbitrate_bps=" << bitrate_bps << "\tfraction_loss="
|
<< std::endl;
|
||||||
<< static_cast<unsigned>(fraction_loss)
|
|
||||||
<< "\ttotal_packets=" << total_packets << std::endl;
|
|
||||||
}
|
}
|
||||||
event_recognized = true;
|
event_recognized = true;
|
||||||
break;
|
break;
|
||||||
@ -611,7 +608,7 @@ int main(int argc, char* argv[]) {
|
|||||||
case webrtc::ParsedRtcEventLog::DELAY_BASED_BWE_UPDATE: {
|
case webrtc::ParsedRtcEventLog::DELAY_BASED_BWE_UPDATE: {
|
||||||
if (FLAG_bwe) {
|
if (FLAG_bwe) {
|
||||||
auto bwe_update = parsed_stream.GetDelayBasedBweUpdate(i);
|
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
|
<< "\tbitrate_bps=" << bwe_update.bitrate_bps
|
||||||
<< "\tdetector_state="
|
<< "\tdetector_state="
|
||||||
<< static_cast<int>(bwe_update.detector_state) << std::endl;
|
<< static_cast<int>(bwe_update.detector_state) << std::endl;
|
||||||
@ -723,30 +720,31 @@ int main(int argc, char* argv[]) {
|
|||||||
|
|
||||||
case webrtc::ParsedRtcEventLog::AUDIO_NETWORK_ADAPTATION_EVENT: {
|
case webrtc::ParsedRtcEventLog::AUDIO_NETWORK_ADAPTATION_EVENT: {
|
||||||
if (FLAG_ana) {
|
if (FLAG_ana) {
|
||||||
webrtc::AudioEncoderRuntimeConfig ana_config;
|
auto ana_event = parsed_stream.GetAudioNetworkAdaptation(i);
|
||||||
parsed_stream.GetAudioNetworkAdaptation(i, &ana_config);
|
char buffer[300];
|
||||||
std::stringstream ss;
|
rtc::SimpleStringBuilder builder(buffer);
|
||||||
ss << parsed_stream.GetTimestamp(i) << "\tANA_UPDATE";
|
builder << parsed_stream.GetTimestamp(i) << "\tANA_UPDATE";
|
||||||
if (ana_config.bitrate_bps) {
|
if (ana_event.config.bitrate_bps) {
|
||||||
ss << "\tbitrate_bps=" << *ana_config.bitrate_bps;
|
builder << "\tbitrate_bps=" << *ana_event.config.bitrate_bps;
|
||||||
}
|
}
|
||||||
if (ana_config.frame_length_ms) {
|
if (ana_event.config.frame_length_ms) {
|
||||||
ss << "\tframe_length_ms=" << *ana_config.frame_length_ms;
|
builder << "\tframe_length_ms="
|
||||||
|
<< *ana_event.config.frame_length_ms;
|
||||||
}
|
}
|
||||||
if (ana_config.uplink_packet_loss_fraction) {
|
if (ana_event.config.uplink_packet_loss_fraction) {
|
||||||
ss << "\tuplink_packet_loss_fraction="
|
builder << "\tuplink_packet_loss_fraction="
|
||||||
<< *ana_config.uplink_packet_loss_fraction;
|
<< *ana_event.config.uplink_packet_loss_fraction;
|
||||||
}
|
}
|
||||||
if (ana_config.enable_fec) {
|
if (ana_event.config.enable_fec) {
|
||||||
ss << "\tenable_fec=" << *ana_config.enable_fec;
|
builder << "\tenable_fec=" << *ana_event.config.enable_fec;
|
||||||
}
|
}
|
||||||
if (ana_config.enable_dtx) {
|
if (ana_event.config.enable_dtx) {
|
||||||
ss << "\tenable_dtx=" << *ana_config.enable_dtx;
|
builder << "\tenable_dtx=" << *ana_event.config.enable_dtx;
|
||||||
}
|
}
|
||||||
if (ana_config.num_channels) {
|
if (ana_event.config.num_channels) {
|
||||||
ss << "\tnum_channels=" << *ana_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;
|
event_recognized = true;
|
||||||
break;
|
break;
|
||||||
@ -754,8 +752,7 @@ int main(int argc, char* argv[]) {
|
|||||||
|
|
||||||
case webrtc::ParsedRtcEventLog::BWE_PROBE_CLUSTER_CREATED_EVENT: {
|
case webrtc::ParsedRtcEventLog::BWE_PROBE_CLUSTER_CREATED_EVENT: {
|
||||||
if (FLAG_probe) {
|
if (FLAG_probe) {
|
||||||
webrtc::ParsedRtcEventLog::BweProbeClusterCreatedEvent probe_event =
|
auto probe_event = parsed_stream.GetBweProbeClusterCreated(i);
|
||||||
parsed_stream.GetBweProbeClusterCreated(i);
|
|
||||||
std::cout << parsed_stream.GetTimestamp(i) << "\tPROBE_CREATED("
|
std::cout << parsed_stream.GetTimestamp(i) << "\tPROBE_CREATED("
|
||||||
<< probe_event.id << ")"
|
<< probe_event.id << ")"
|
||||||
<< "\tbitrate_bps=" << probe_event.bitrate_bps
|
<< "\tbitrate_bps=" << probe_event.bitrate_bps
|
||||||
@ -768,7 +765,7 @@ int main(int argc, char* argv[]) {
|
|||||||
|
|
||||||
case webrtc::ParsedRtcEventLog::BWE_PROBE_RESULT_EVENT: {
|
case webrtc::ParsedRtcEventLog::BWE_PROBE_RESULT_EVENT: {
|
||||||
if (FLAG_probe) {
|
if (FLAG_probe) {
|
||||||
webrtc::ParsedRtcEventLog::BweProbeResultEvent probe_result =
|
webrtc::LoggedBweProbeResultEvent probe_result =
|
||||||
parsed_stream.GetBweProbeResult(i);
|
parsed_stream.GetBweProbeResult(i);
|
||||||
if (probe_result.failure_reason) {
|
if (probe_result.failure_reason) {
|
||||||
std::cout << parsed_stream.GetTimestamp(i) << "\tPROBE_SUCCESS("
|
std::cout << parsed_stream.GetTimestamp(i) << "\tPROBE_SUCCESS("
|
||||||
@ -789,8 +786,7 @@ int main(int argc, char* argv[]) {
|
|||||||
|
|
||||||
case webrtc::ParsedRtcEventLog::ALR_STATE_EVENT: {
|
case webrtc::ParsedRtcEventLog::ALR_STATE_EVENT: {
|
||||||
if (FLAG_bwe) {
|
if (FLAG_bwe) {
|
||||||
webrtc::ParsedRtcEventLog::AlrStateEvent alr_state =
|
webrtc::LoggedAlrStateEvent alr_state = parsed_stream.GetAlrState(i);
|
||||||
parsed_stream.GetAlrState(i);
|
|
||||||
std::cout << parsed_stream.GetTimestamp(i) << "\tALR_STATE"
|
std::cout << parsed_stream.GetTimestamp(i) << "\tALR_STATE"
|
||||||
<< "\tin_alr=" << alr_state.in_alr << std::endl;
|
<< "\tin_alr=" << alr_state.in_alr << std::endl;
|
||||||
}
|
}
|
||||||
@ -800,7 +796,7 @@ int main(int argc, char* argv[]) {
|
|||||||
|
|
||||||
case webrtc::ParsedRtcEventLog::ICE_CANDIDATE_PAIR_CONFIG: {
|
case webrtc::ParsedRtcEventLog::ICE_CANDIDATE_PAIR_CONFIG: {
|
||||||
if (FLAG_ice) {
|
if (FLAG_ice) {
|
||||||
webrtc::ParsedRtcEventLog::IceCandidatePairConfig ice_cp_config =
|
webrtc::LoggedIceCandidatePairConfig ice_cp_config =
|
||||||
parsed_stream.GetIceCandidatePairConfig(i);
|
parsed_stream.GetIceCandidatePairConfig(i);
|
||||||
// TODO(qingsi): convert the numeric representation of states to text
|
// TODO(qingsi): convert the numeric representation of states to text
|
||||||
std::cout << parsed_stream.GetTimestamp(i)
|
std::cout << parsed_stream.GetTimestamp(i)
|
||||||
@ -814,7 +810,7 @@ int main(int argc, char* argv[]) {
|
|||||||
|
|
||||||
case webrtc::ParsedRtcEventLog::ICE_CANDIDATE_PAIR_EVENT: {
|
case webrtc::ParsedRtcEventLog::ICE_CANDIDATE_PAIR_EVENT: {
|
||||||
if (FLAG_ice) {
|
if (FLAG_ice) {
|
||||||
webrtc::ParsedRtcEventLog::IceCandidatePairEvent ice_cp_event =
|
webrtc::LoggedIceCandidatePairEvent ice_cp_event =
|
||||||
parsed_stream.GetIceCandidatePairEvent(i);
|
parsed_stream.GetIceCandidatePairEvent(i);
|
||||||
// TODO(qingsi): convert the numeric representation of states to text
|
// TODO(qingsi): convert the numeric representation of states to text
|
||||||
std::cout << parsed_stream.GetTimestamp(i)
|
std::cout << parsed_stream.GetTimestamp(i)
|
||||||
|
|||||||
1248
logging/rtc_event_log/rtc_event_log_parser2.cc
Normal file
1248
logging/rtc_event_log/rtc_event_log_parser2.cc
Normal file
File diff suppressed because it is too large
Load Diff
920
logging/rtc_event_log/rtc_event_log_parser2.h
Normal file
920
logging/rtc_event_log/rtc_event_log_parser2.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_PARSER2_H_
|
||||||
|
#define LOGGING_RTC_EVENT_LOG_RTC_EVENT_LOG_PARSER2_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 ParsedRtcEventLog {
|
||||||
|
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 ParsedRtcEventLog(
|
||||||
|
UnconfiguredHeaderExtensions parse_unconfigured_header_extensions =
|
||||||
|
UnconfiguredHeaderExtensions::kDontParse);
|
||||||
|
|
||||||
|
// Clears previously parsed events and resets the ParsedRtcEventLog 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_PARSER2_H_
|
||||||
@ -34,7 +34,7 @@
|
|||||||
#include "logging/rtc_event_log/events/rtc_event_video_send_stream_config.h"
|
#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/output/rtc_event_log_output_file.h"
|
||||||
#include "logging/rtc_event_log/rtc_event_log.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_parser2.h"
|
||||||
#include "logging/rtc_event_log/rtc_event_log_unittest_helper.h"
|
#include "logging/rtc_event_log/rtc_event_log_unittest_helper.h"
|
||||||
#include "logging/rtc_event_log/rtc_stream_config.h"
|
#include "logging/rtc_event_log/rtc_stream_config.h"
|
||||||
#include "modules/audio_coding/audio_network_adaptor/include/audio_network_adaptor.h"
|
#include "modules/audio_coding/audio_network_adaptor/include/audio_network_adaptor.h"
|
||||||
@ -750,17 +750,16 @@ TEST(RtcEventLogTest, CircularBufferKeepsMostRecentEvents) {
|
|||||||
for (size_t i = 1; i < parsed_log.GetNumberOfEvents() - 1; i++) {
|
for (size_t i = 1; i < parsed_log.GetNumberOfEvents() - 1; i++) {
|
||||||
EXPECT_EQ(parsed_log.GetEventType(i),
|
EXPECT_EQ(parsed_log.GetEventType(i),
|
||||||
ParsedRtcEventLog::EventType::AUDIO_PLAYOUT_EVENT);
|
ParsedRtcEventLog::EventType::AUDIO_PLAYOUT_EVENT);
|
||||||
uint32_t ssrc;
|
LoggedAudioPlayoutEvent playout_event = parsed_log.GetAudioPlayout(i);
|
||||||
parsed_log.GetAudioPlayout(i, &ssrc);
|
EXPECT_LT(playout_event.ssrc, kNumEvents);
|
||||||
int64_t timestamp = parsed_log.GetTimestamp(i);
|
EXPECT_EQ(static_cast<int64_t>(kStartTime + 10000 * playout_event.ssrc),
|
||||||
EXPECT_LT(ssrc, kNumEvents);
|
playout_event.timestamp_us);
|
||||||
EXPECT_EQ(static_cast<int64_t>(kStartTime + 10000 * ssrc), timestamp);
|
|
||||||
if (last_ssrc)
|
if (last_ssrc)
|
||||||
EXPECT_EQ(ssrc, *last_ssrc + 1);
|
EXPECT_EQ(playout_event.ssrc, *last_ssrc + 1);
|
||||||
if (last_timestamp)
|
if (last_timestamp)
|
||||||
EXPECT_EQ(timestamp, *last_timestamp + 10000);
|
EXPECT_EQ(playout_event.timestamp_us, *last_timestamp + 10000);
|
||||||
last_ssrc = ssrc;
|
last_ssrc = playout_event.ssrc;
|
||||||
last_timestamp = timestamp;
|
last_timestamp = playout_event.timestamp_us;
|
||||||
}
|
}
|
||||||
RtcEventLogTestHelper::VerifyLogEndEvent(parsed_log,
|
RtcEventLogTestHelper::VerifyLogEndEvent(parsed_log,
|
||||||
parsed_log.GetNumberOfEvents() - 1);
|
parsed_log.GetNumberOfEvents() - 1);
|
||||||
|
|||||||
@ -460,9 +460,8 @@ void RtcEventLogTestHelper::VerifyPlayoutEvent(
|
|||||||
EXPECT_EQ(ssrc, playout_event.local_ssrc());
|
EXPECT_EQ(ssrc, playout_event.local_ssrc());
|
||||||
|
|
||||||
// Check consistency of the parser.
|
// Check consistency of the parser.
|
||||||
uint32_t parsed_ssrc;
|
LoggedAudioPlayoutEvent parsed_event = parsed_log.GetAudioPlayout(index);
|
||||||
parsed_log.GetAudioPlayout(index, &parsed_ssrc);
|
EXPECT_EQ(ssrc, parsed_event.ssrc);
|
||||||
EXPECT_EQ(ssrc, parsed_ssrc);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void RtcEventLogTestHelper::VerifyBweLossEvent(
|
void RtcEventLogTestHelper::VerifyBweLossEvent(
|
||||||
@ -484,14 +483,10 @@ void RtcEventLogTestHelper::VerifyBweLossEvent(
|
|||||||
EXPECT_EQ(total_packets, bwe_event.total_packets());
|
EXPECT_EQ(total_packets, bwe_event.total_packets());
|
||||||
|
|
||||||
// Check consistency of the parser.
|
// Check consistency of the parser.
|
||||||
int32_t parsed_bitrate;
|
LoggedBweLossBasedUpdate bwe_update = parsed_log.GetLossBasedBweUpdate(index);
|
||||||
uint8_t parsed_fraction_loss;
|
EXPECT_EQ(bitrate, bwe_update.bitrate_bps);
|
||||||
int32_t parsed_total_packets;
|
EXPECT_EQ(fraction_loss, bwe_update.fraction_lost);
|
||||||
parsed_log.GetLossBasedBweUpdate(
|
EXPECT_EQ(total_packets, bwe_update.expected_packets);
|
||||||
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);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void RtcEventLogTestHelper::VerifyBweDelayEvent(
|
void RtcEventLogTestHelper::VerifyBweDelayEvent(
|
||||||
@ -511,8 +506,7 @@ void RtcEventLogTestHelper::VerifyBweDelayEvent(
|
|||||||
GetRuntimeDetectorState(bwe_event.detector_state()));
|
GetRuntimeDetectorState(bwe_event.detector_state()));
|
||||||
|
|
||||||
// Check consistency of the parser.
|
// Check consistency of the parser.
|
||||||
ParsedRtcEventLog::BweDelayBasedUpdate res =
|
LoggedBweDelayBasedUpdate res = parsed_log.GetDelayBasedBweUpdate(index);
|
||||||
parsed_log.GetDelayBasedBweUpdate(index);
|
|
||||||
EXPECT_EQ(res.bitrate_bps, bitrate);
|
EXPECT_EQ(res.bitrate_bps, bitrate);
|
||||||
EXPECT_EQ(res.detector_state, detector_state);
|
EXPECT_EQ(res.detector_state, detector_state);
|
||||||
}
|
}
|
||||||
@ -521,15 +515,20 @@ void RtcEventLogTestHelper::VerifyAudioNetworkAdaptation(
|
|||||||
const ParsedRtcEventLog& parsed_log,
|
const ParsedRtcEventLog& parsed_log,
|
||||||
size_t index,
|
size_t index,
|
||||||
const AudioEncoderRuntimeConfig& config) {
|
const AudioEncoderRuntimeConfig& config) {
|
||||||
AudioEncoderRuntimeConfig parsed_config;
|
ASSERT_LT(index, parsed_log.events_.size());
|
||||||
parsed_log.GetAudioNetworkAdaptation(index, &parsed_config);
|
const rtclog::Event& event = parsed_log.events_[index];
|
||||||
EXPECT_EQ(config.bitrate_bps, parsed_config.bitrate_bps);
|
ASSERT_TRUE(IsValidBasicEvent(event));
|
||||||
EXPECT_EQ(config.enable_dtx, parsed_config.enable_dtx);
|
ASSERT_EQ(rtclog::Event::AUDIO_NETWORK_ADAPTATION_EVENT, event.type());
|
||||||
EXPECT_EQ(config.enable_fec, parsed_config.enable_fec);
|
|
||||||
EXPECT_EQ(config.frame_length_ms, parsed_config.frame_length_ms);
|
LoggedAudioNetworkAdaptationEvent parsed_event =
|
||||||
EXPECT_EQ(config.num_channels, parsed_config.num_channels);
|
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,
|
EXPECT_EQ(config.uplink_packet_loss_fraction,
|
||||||
parsed_config.uplink_packet_loss_fraction);
|
parsed_event.config.uplink_packet_loss_fraction);
|
||||||
}
|
}
|
||||||
|
|
||||||
void RtcEventLogTestHelper::VerifyLogStartEvent(
|
void RtcEventLogTestHelper::VerifyLogStartEvent(
|
||||||
|
|||||||
@ -12,7 +12,7 @@
|
|||||||
#define LOGGING_RTC_EVENT_LOG_RTC_EVENT_LOG_UNITTEST_HELPER_H_
|
#define LOGGING_RTC_EVENT_LOG_RTC_EVENT_LOG_UNITTEST_HELPER_H_
|
||||||
|
|
||||||
#include "call/call.h"
|
#include "call/call.h"
|
||||||
#include "logging/rtc_event_log/rtc_event_log_parser.h"
|
#include "logging/rtc_event_log/rtc_event_log_parser2.h"
|
||||||
#include "modules/rtp_rtcp/source/rtp_packet_received.h"
|
#include "modules/rtp_rtcp/source/rtp_packet_received.h"
|
||||||
#include "modules/rtp_rtcp/source/rtp_packet_to_send.h"
|
#include "modules/rtp_rtcp/source/rtp_packet_to_send.h"
|
||||||
|
|
||||||
|
|||||||
@ -66,7 +66,7 @@ std::unique_ptr<Packet> RtcEventLogSource::NextPacket() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (parsed_stream_.GetMediaType(packet->header().ssrc, direction) !=
|
if (parsed_stream_.GetMediaType(packet->header().ssrc, direction) !=
|
||||||
webrtc::ParsedRtcEventLog::MediaType::AUDIO) {
|
ParsedRtcEventLog::MediaType::AUDIO) {
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -85,12 +85,10 @@ int64_t RtcEventLogSource::NextAudioOutputEventMs() {
|
|||||||
while (audio_output_index_ < parsed_stream_.GetNumberOfEvents()) {
|
while (audio_output_index_ < parsed_stream_.GetNumberOfEvents()) {
|
||||||
if (parsed_stream_.GetEventType(audio_output_index_) ==
|
if (parsed_stream_.GetEventType(audio_output_index_) ==
|
||||||
ParsedRtcEventLog::AUDIO_PLAYOUT_EVENT) {
|
ParsedRtcEventLog::AUDIO_PLAYOUT_EVENT) {
|
||||||
uint64_t timestamp_us = parsed_stream_.GetTimestamp(audio_output_index_);
|
LoggedAudioPlayoutEvent playout_event =
|
||||||
// We call GetAudioPlayout only to check that the protobuf event is
|
parsed_stream_.GetAudioPlayout(audio_output_index_);
|
||||||
// well-formed.
|
|
||||||
parsed_stream_.GetAudioPlayout(audio_output_index_, nullptr);
|
|
||||||
audio_output_index_++;
|
audio_output_index_++;
|
||||||
return timestamp_us / 1000;
|
return playout_event.timestamp_us / 1000;
|
||||||
}
|
}
|
||||||
audio_output_index_++;
|
audio_output_index_++;
|
||||||
}
|
}
|
||||||
|
|||||||
@ -14,7 +14,7 @@
|
|||||||
#include <memory>
|
#include <memory>
|
||||||
#include <string>
|
#include <string>
|
||||||
|
|
||||||
#include "logging/rtc_event_log/rtc_event_log_parser.h"
|
#include "logging/rtc_event_log/rtc_event_log_parser2.h"
|
||||||
#include "modules/audio_coding/neteq/tools/packet_source.h"
|
#include "modules/audio_coding/neteq/tools/packet_source.h"
|
||||||
#include "modules/rtp_rtcp/include/rtp_rtcp_defines.h"
|
#include "modules/rtp_rtcp/include/rtp_rtcp_defines.h"
|
||||||
#include "rtc_base/constructormagic.h"
|
#include "rtc_base/constructormagic.h"
|
||||||
|
|||||||
@ -237,6 +237,7 @@ if (!build_with_chromium) {
|
|||||||
"../rtc_base:checks",
|
"../rtc_base:checks",
|
||||||
"../rtc_base:rtc_base_approved",
|
"../rtc_base:rtc_base_approved",
|
||||||
"../rtc_base:rtc_numerics",
|
"../rtc_base:rtc_numerics",
|
||||||
|
"../rtc_base:stringutils",
|
||||||
|
|
||||||
# TODO(kwiberg): Remove this dependency.
|
# TODO(kwiberg): Remove this dependency.
|
||||||
"../api/audio_codecs:audio_codecs_api",
|
"../api/audio_codecs:audio_codecs_api",
|
||||||
|
|||||||
File diff suppressed because it is too large
Load Diff
@ -18,54 +18,12 @@
|
|||||||
#include <utility>
|
#include <utility>
|
||||||
#include <vector>
|
#include <vector>
|
||||||
|
|
||||||
#include "logging/rtc_event_log/rtc_event_log_parser.h"
|
#include "logging/rtc_event_log/rtc_event_log_parser2.h"
|
||||||
#include "modules/audio_coding/audio_network_adaptor/include/audio_network_adaptor.h"
|
#include "rtc_base/strings/string_builder.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 "rtc_tools/event_log_visualizer/plot_base.h"
|
#include "rtc_tools/event_log_visualizer/plot_base.h"
|
||||||
#include "rtc_tools/event_log_visualizer/triage_notifications.h"
|
#include "rtc_tools/event_log_visualizer/triage_notifications.h"
|
||||||
|
|
||||||
namespace webrtc {
|
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 {
|
class EventLogAnalyzer {
|
||||||
public:
|
public:
|
||||||
@ -74,14 +32,13 @@ class EventLogAnalyzer {
|
|||||||
// modified while the EventLogAnalyzer is being used.
|
// modified while the EventLogAnalyzer is being used.
|
||||||
explicit EventLogAnalyzer(const ParsedRtcEventLog& log);
|
explicit EventLogAnalyzer(const ParsedRtcEventLog& log);
|
||||||
|
|
||||||
void CreatePacketGraph(PacketDirection desired_direction, Plot* plot);
|
void CreatePacketGraph(PacketDirection direction, Plot* plot);
|
||||||
|
|
||||||
void CreateAccumulatedPacketsGraph(PacketDirection desired_direction,
|
void CreateAccumulatedPacketsGraph(PacketDirection direction, Plot* plot);
|
||||||
Plot* plot);
|
|
||||||
|
|
||||||
void CreatePlayoutGraph(Plot* plot);
|
void CreatePlayoutGraph(Plot* plot);
|
||||||
|
|
||||||
void CreateAudioLevelGraph(Plot* plot);
|
void CreateAudioLevelGraph(PacketDirection direction, Plot* plot);
|
||||||
|
|
||||||
void CreateSequenceNumberGraph(Plot* plot);
|
void CreateSequenceNumberGraph(Plot* plot);
|
||||||
|
|
||||||
@ -92,19 +49,20 @@ class EventLogAnalyzer {
|
|||||||
|
|
||||||
void CreateFractionLossGraph(Plot* plot);
|
void CreateFractionLossGraph(Plot* plot);
|
||||||
|
|
||||||
void CreateTotalBitrateGraph(PacketDirection desired_direction,
|
void CreateTotalIncomingBitrateGraph(Plot* plot);
|
||||||
Plot* plot,
|
void CreateTotalOutgoingBitrateGraph(Plot* plot,
|
||||||
bool show_detector_state = false,
|
bool show_detector_state = false,
|
||||||
bool show_alr_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 CreateSendSideBweSimulationGraph(Plot* plot);
|
||||||
void CreateReceiveSideBweSimulationGraph(Plot* plot);
|
void CreateReceiveSideBweSimulationGraph(Plot* plot);
|
||||||
|
|
||||||
void CreateNetworkDelayFeedbackGraph(Plot* plot);
|
void CreateNetworkDelayFeedbackGraph(Plot* plot);
|
||||||
void CreatePacerDelayGraph(Plot* plot);
|
void CreatePacerDelayGraph(Plot* plot);
|
||||||
void CreateTimestampGraph(Plot* plot);
|
|
||||||
|
void CreateTimestampGraph(PacketDirection direction, Plot* plot);
|
||||||
|
|
||||||
void CreateAudioEncoderTargetBitrateGraph(Plot* plot);
|
void CreateAudioEncoderTargetBitrateGraph(Plot* plot);
|
||||||
void CreateAudioEncoderFrameLengthGraph(Plot* plot);
|
void CreateAudioEncoderFrameLengthGraph(Plot* plot);
|
||||||
@ -119,55 +77,114 @@ class EventLogAnalyzer {
|
|||||||
void CreateIceCandidatePairConfigGraph(Plot* plot);
|
void CreateIceCandidatePairConfigGraph(Plot* plot);
|
||||||
void CreateIceConnectivityCheckGraph(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 CreateTriageNotifications();
|
||||||
void PrintNotifications(FILE* file);
|
void PrintNotifications(FILE* file);
|
||||||
|
|
||||||
private:
|
private:
|
||||||
class StreamId {
|
bool IsRtxSsrc(PacketDirection direction, uint32_t ssrc) const {
|
||||||
public:
|
if (direction == kIncomingPacket) {
|
||||||
StreamId(uint32_t ssrc, webrtc::PacketDirection direction)
|
return parsed_log_.incoming_rtx_ssrcs().find(ssrc) !=
|
||||||
: ssrc_(ssrc), direction_(direction) {}
|
parsed_log_.incoming_rtx_ssrcs().end();
|
||||||
bool operator<(const StreamId& other) const {
|
} else {
|
||||||
return std::tie(ssrc_, direction_) <
|
return parsed_log_.outgoing_rtx_ssrcs().find(ssrc) !=
|
||||||
std::tie(other.ssrc_, other.direction_);
|
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:
|
bool IsAudioSsrc(PacketDirection direction, uint32_t ssrc) const {
|
||||||
uint32_t ssrc_;
|
if (direction == kIncomingPacket) {
|
||||||
webrtc::PacketDirection direction_;
|
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>
|
template <typename IterableType>
|
||||||
void CreateAccumulatedPacketsTimeSeries(
|
void CreateAccumulatedPacketsTimeSeries(Plot* plot,
|
||||||
PacketDirection desired_direction,
|
const IterableType& packets,
|
||||||
Plot* plot,
|
const std::string& label);
|
||||||
const std::map<StreamId, std::vector<T>>& packets,
|
|
||||||
const std::string& label_prefix);
|
|
||||||
|
|
||||||
bool IsRtxSsrc(StreamId stream_id) const;
|
void CreateStreamGapAlerts(PacketDirection direction);
|
||||||
|
void CreateTransmissionGapAlerts(PacketDirection direction);
|
||||||
|
|
||||||
bool IsVideoSsrc(StreamId stream_id) const;
|
std::string GetStreamName(PacketDirection direction, uint32_t ssrc) const {
|
||||||
|
char buffer[200];
|
||||||
bool IsAudioSsrc(StreamId stream_id) const;
|
rtc::SimpleStringBuilder name(buffer);
|
||||||
|
if (IsAudioSsrc(direction, ssrc)) {
|
||||||
std::string GetStreamName(StreamId stream_id) const;
|
name << "Audio ";
|
||||||
|
} else if (IsVideoSsrc(direction, ssrc)) {
|
||||||
rtc::Optional<uint32_t> EstimateRtpClockFrequency(
|
name << "Video ";
|
||||||
const std::vector<LoggedRtpPacket>& packets) const;
|
} 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;
|
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);
|
std::string GetCandidatePairLogDescriptionFromId(uint32_t candidate_pair_id);
|
||||||
|
|
||||||
@ -177,50 +194,19 @@ class EventLogAnalyzer {
|
|||||||
// If left empty, all SSRCs will be considered relevant.
|
// If left empty, all SSRCs will be considered relevant.
|
||||||
std::vector<uint32_t> desired_ssrc_;
|
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
|
// Stores the timestamps for all log segments, in the form of associated start
|
||||||
// and end events.
|
// 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<IncomingRtpReceiveTimeGap> incoming_rtp_recv_time_gaps_;
|
||||||
std::vector<LossBasedBweUpdate> bwe_loss_updates_;
|
std::vector<IncomingRtcpReceiveTimeGap> incoming_rtcp_recv_time_gaps_;
|
||||||
|
std::vector<OutgoingRtpSendTimeGap> outgoing_rtp_send_time_gaps_;
|
||||||
std::vector<AudioNetworkAdaptationEvent> audio_network_adaptation_events_;
|
std::vector<OutgoingRtcpSendTimeGap> outgoing_rtcp_send_time_gaps_;
|
||||||
|
std::vector<IncomingSeqNumJump> incoming_seq_num_jumps_;
|
||||||
std::vector<ParsedRtcEventLog::BweProbeClusterCreatedEvent>
|
std::vector<IncomingCaptureTimeJump> incoming_capture_time_jumps_;
|
||||||
bwe_probe_cluster_created_events_;
|
std::vector<OutgoingSeqNoJump> outgoing_seq_num_jumps_;
|
||||||
|
std::vector<OutgoingCaptureTimeJump> outgoing_capture_time_jumps_;
|
||||||
std::vector<ParsedRtcEventLog::BweProbeResultEvent> bwe_probe_result_events_;
|
std::vector<OutgoingHighLoss> outgoing_high_loss_alerts_;
|
||||||
|
|
||||||
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::map<uint32_t, std::string> candidate_pair_desc_by_id_;
|
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.
|
// The generated data points will be |step_| microseconds apart.
|
||||||
// Only events occuring at most |window_duration_| microseconds before the
|
// Only events occuring at most |window_duration_| microseconds before the
|
||||||
// current data point will be part of the average.
|
// current data point will be part of the average.
|
||||||
uint64_t window_duration_;
|
int64_t window_duration_;
|
||||||
uint64_t step_;
|
int64_t step_;
|
||||||
|
|
||||||
// First and last events of the log.
|
// First and last events of the log.
|
||||||
uint64_t begin_time_;
|
int64_t begin_time_;
|
||||||
uint64_t end_time_;
|
int64_t end_time_;
|
||||||
|
|
||||||
// Duration (in seconds) of log file.
|
// Duration (in seconds) of log file.
|
||||||
float call_duration_s_;
|
float call_duration_s_;
|
||||||
};
|
};
|
||||||
|
|
||||||
} // namespace plotting
|
|
||||||
} // namespace webrtc
|
} // namespace webrtc
|
||||||
|
|
||||||
#endif // RTC_TOOLS_EVENT_LOG_VISUALIZER_ANALYZER_H_
|
#endif // RTC_TOOLS_EVENT_LOG_VISUALIZER_ANALYZER_H_
|
||||||
|
|||||||
@ -10,7 +10,7 @@
|
|||||||
|
|
||||||
#include <iostream>
|
#include <iostream>
|
||||||
|
|
||||||
#include "logging/rtc_event_log/rtc_event_log_parser.h"
|
#include "logging/rtc_event_log/rtc_event_log_parser2.h"
|
||||||
#include "rtc_base/flags.h"
|
#include "rtc_base/flags.h"
|
||||||
#include "rtc_tools/event_log_visualizer/analyzer.h"
|
#include "rtc_tools/event_log_visualizer/analyzer.h"
|
||||||
#include "rtc_tools/event_log_visualizer/plot_base.h"
|
#include "rtc_tools/event_log_visualizer/plot_base.h"
|
||||||
@ -143,10 +143,15 @@ DEFINE_bool(show_alr_state,
|
|||||||
false,
|
false,
|
||||||
"Show the state ALR state on the total bitrate graph");
|
"Show the state ALR state on the total bitrate graph");
|
||||||
|
|
||||||
DEFINE_bool(
|
DEFINE_bool(parse_unconfigured_header_extensions,
|
||||||
print_triage_notifications,
|
true,
|
||||||
false,
|
"Attempt to parse unconfigured header extensions using the default "
|
||||||
"Print triage notifications, i.e. a list of suspicious looking events.");
|
"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);
|
void SetAllPlotFlags(bool setting);
|
||||||
|
|
||||||
@ -209,7 +214,13 @@ int main(int argc, char* argv[]) {
|
|||||||
|
|
||||||
std::string filename = argv[1];
|
std::string filename = argv[1];
|
||||||
|
|
||||||
webrtc::ParsedRtcEventLog parsed_log;
|
webrtc::ParsedRtcEventLog::UnconfiguredHeaderExtensions header_extensions =
|
||||||
|
webrtc::ParsedRtcEventLog::UnconfiguredHeaderExtensions::kDontParse;
|
||||||
|
if (FLAG_parse_unconfigured_header_extensions) {
|
||||||
|
header_extensions = webrtc::ParsedRtcEventLog::
|
||||||
|
UnconfiguredHeaderExtensions::kAttemptWebrtcDefaultConfig;
|
||||||
|
}
|
||||||
|
webrtc::ParsedRtcEventLog parsed_log(header_extensions);
|
||||||
|
|
||||||
if (!parsed_log.ParseFile(filename)) {
|
if (!parsed_log.ParseFile(filename)) {
|
||||||
std::cerr << "Could not parse the entire log file." << std::endl;
|
std::cerr << "Could not parse the entire log file." << std::endl;
|
||||||
@ -218,31 +229,34 @@ int main(int argc, char* argv[]) {
|
|||||||
<< std::endl;
|
<< std::endl;
|
||||||
}
|
}
|
||||||
|
|
||||||
webrtc::plotting::EventLogAnalyzer analyzer(parsed_log);
|
webrtc::EventLogAnalyzer analyzer(parsed_log);
|
||||||
std::unique_ptr<webrtc::plotting::PlotCollection> collection(
|
std::unique_ptr<webrtc::PlotCollection> collection(
|
||||||
new webrtc::plotting::PythonPlotCollection());
|
new webrtc::PythonPlotCollection());
|
||||||
|
|
||||||
if (FLAG_plot_incoming_packet_sizes) {
|
if (FLAG_plot_incoming_packet_sizes) {
|
||||||
analyzer.CreatePacketGraph(webrtc::PacketDirection::kIncomingPacket,
|
analyzer.CreatePacketGraph(webrtc::kIncomingPacket,
|
||||||
collection->AppendNewPlot());
|
collection->AppendNewPlot());
|
||||||
}
|
}
|
||||||
if (FLAG_plot_outgoing_packet_sizes) {
|
if (FLAG_plot_outgoing_packet_sizes) {
|
||||||
analyzer.CreatePacketGraph(webrtc::PacketDirection::kOutgoingPacket,
|
analyzer.CreatePacketGraph(webrtc::kOutgoingPacket,
|
||||||
collection->AppendNewPlot());
|
collection->AppendNewPlot());
|
||||||
}
|
}
|
||||||
if (FLAG_plot_incoming_packet_count) {
|
if (FLAG_plot_incoming_packet_count) {
|
||||||
analyzer.CreateAccumulatedPacketsGraph(
|
analyzer.CreateAccumulatedPacketsGraph(webrtc::kIncomingPacket,
|
||||||
webrtc::PacketDirection::kIncomingPacket, collection->AppendNewPlot());
|
collection->AppendNewPlot());
|
||||||
}
|
}
|
||||||
if (FLAG_plot_outgoing_packet_count) {
|
if (FLAG_plot_outgoing_packet_count) {
|
||||||
analyzer.CreateAccumulatedPacketsGraph(
|
analyzer.CreateAccumulatedPacketsGraph(webrtc::kOutgoingPacket,
|
||||||
webrtc::PacketDirection::kOutgoingPacket, collection->AppendNewPlot());
|
collection->AppendNewPlot());
|
||||||
}
|
}
|
||||||
if (FLAG_plot_audio_playout) {
|
if (FLAG_plot_audio_playout) {
|
||||||
analyzer.CreatePlayoutGraph(collection->AppendNewPlot());
|
analyzer.CreatePlayoutGraph(collection->AppendNewPlot());
|
||||||
}
|
}
|
||||||
if (FLAG_plot_audio_level) {
|
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) {
|
if (FLAG_plot_incoming_sequence_number_delta) {
|
||||||
analyzer.CreateSequenceNumberGraph(collection->AppendNewPlot());
|
analyzer.CreateSequenceNumberGraph(collection->AppendNewPlot());
|
||||||
@ -257,23 +271,19 @@ int main(int argc, char* argv[]) {
|
|||||||
analyzer.CreateIncomingPacketLossGraph(collection->AppendNewPlot());
|
analyzer.CreateIncomingPacketLossGraph(collection->AppendNewPlot());
|
||||||
}
|
}
|
||||||
if (FLAG_plot_incoming_bitrate) {
|
if (FLAG_plot_incoming_bitrate) {
|
||||||
analyzer.CreateTotalBitrateGraph(webrtc::PacketDirection::kIncomingPacket,
|
analyzer.CreateTotalIncomingBitrateGraph(collection->AppendNewPlot());
|
||||||
collection->AppendNewPlot(),
|
|
||||||
FLAG_show_detector_state,
|
|
||||||
FLAG_show_alr_state);
|
|
||||||
}
|
}
|
||||||
if (FLAG_plot_outgoing_bitrate) {
|
if (FLAG_plot_outgoing_bitrate) {
|
||||||
analyzer.CreateTotalBitrateGraph(webrtc::PacketDirection::kOutgoingPacket,
|
analyzer.CreateTotalOutgoingBitrateGraph(collection->AppendNewPlot(),
|
||||||
collection->AppendNewPlot(),
|
FLAG_show_detector_state,
|
||||||
FLAG_show_detector_state,
|
FLAG_show_alr_state);
|
||||||
FLAG_show_alr_state);
|
|
||||||
}
|
}
|
||||||
if (FLAG_plot_incoming_stream_bitrate) {
|
if (FLAG_plot_incoming_stream_bitrate) {
|
||||||
analyzer.CreateStreamBitrateGraph(webrtc::PacketDirection::kIncomingPacket,
|
analyzer.CreateStreamBitrateGraph(webrtc::kIncomingPacket,
|
||||||
collection->AppendNewPlot());
|
collection->AppendNewPlot());
|
||||||
}
|
}
|
||||||
if (FLAG_plot_outgoing_stream_bitrate) {
|
if (FLAG_plot_outgoing_stream_bitrate) {
|
||||||
analyzer.CreateStreamBitrateGraph(webrtc::PacketDirection::kOutgoingPacket,
|
analyzer.CreateStreamBitrateGraph(webrtc::kOutgoingPacket,
|
||||||
collection->AppendNewPlot());
|
collection->AppendNewPlot());
|
||||||
}
|
}
|
||||||
if (FLAG_plot_simulated_receiveside_bwe) {
|
if (FLAG_plot_simulated_receiveside_bwe) {
|
||||||
@ -289,7 +299,10 @@ int main(int argc, char* argv[]) {
|
|||||||
analyzer.CreateFractionLossGraph(collection->AppendNewPlot());
|
analyzer.CreateFractionLossGraph(collection->AppendNewPlot());
|
||||||
}
|
}
|
||||||
if (FLAG_plot_timestamps) {
|
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) {
|
if (FLAG_plot_pacer_delay) {
|
||||||
analyzer.CreatePacerDelayGraph(collection->AppendNewPlot());
|
analyzer.CreatePacerDelayGraph(collection->AppendNewPlot());
|
||||||
@ -333,7 +346,7 @@ int main(int argc, char* argv[]) {
|
|||||||
|
|
||||||
collection->Draw();
|
collection->Draw();
|
||||||
|
|
||||||
if (FLAG_print_triage_notifications) {
|
if (FLAG_print_triage_alerts) {
|
||||||
analyzer.CreateTriageNotifications();
|
analyzer.CreateTriageNotifications();
|
||||||
analyzer.PrintNotifications(stderr);
|
analyzer.PrintNotifications(stderr);
|
||||||
}
|
}
|
||||||
|
|||||||
@ -15,7 +15,6 @@
|
|||||||
#include "rtc_base/checks.h"
|
#include "rtc_base/checks.h"
|
||||||
|
|
||||||
namespace webrtc {
|
namespace webrtc {
|
||||||
namespace plotting {
|
|
||||||
|
|
||||||
void Plot::SetXAxis(float min_value,
|
void Plot::SetXAxis(float min_value,
|
||||||
float max_value,
|
float max_value,
|
||||||
@ -85,5 +84,4 @@ void Plot::AppendTimeSeriesIfNotEmpty(TimeSeries&& time_series) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
} // namespace plotting
|
|
||||||
} // namespace webrtc
|
} // namespace webrtc
|
||||||
|
|||||||
@ -16,7 +16,6 @@
|
|||||||
#include <vector>
|
#include <vector>
|
||||||
|
|
||||||
namespace webrtc {
|
namespace webrtc {
|
||||||
namespace plotting {
|
|
||||||
|
|
||||||
enum class LineStyle {
|
enum class LineStyle {
|
||||||
kNone, // No line connecting the points. Used to create scatter plots.
|
kNone, // No line connecting the points. Used to create scatter plots.
|
||||||
@ -173,7 +172,6 @@ class PlotCollection {
|
|||||||
std::vector<std::unique_ptr<Plot> > plots_;
|
std::vector<std::unique_ptr<Plot> > plots_;
|
||||||
};
|
};
|
||||||
|
|
||||||
} // namespace plotting
|
|
||||||
} // namespace webrtc
|
} // namespace webrtc
|
||||||
|
|
||||||
#endif // RTC_TOOLS_EVENT_LOG_VISUALIZER_PLOT_BASE_H_
|
#endif // RTC_TOOLS_EVENT_LOG_VISUALIZER_PLOT_BASE_H_
|
||||||
|
|||||||
@ -13,7 +13,6 @@
|
|||||||
#include <memory>
|
#include <memory>
|
||||||
|
|
||||||
namespace webrtc {
|
namespace webrtc {
|
||||||
namespace plotting {
|
|
||||||
|
|
||||||
ProtobufPlot::ProtobufPlot() {}
|
ProtobufPlot::ProtobufPlot() {}
|
||||||
|
|
||||||
@ -83,5 +82,4 @@ Plot* ProtobufPlotCollection::AppendNewPlot() {
|
|||||||
return plot;
|
return plot;
|
||||||
}
|
}
|
||||||
|
|
||||||
} // namespace plotting
|
|
||||||
} // namespace webrtc
|
} // namespace webrtc
|
||||||
|
|||||||
@ -17,7 +17,6 @@ RTC_POP_IGNORING_WUNDEF()
|
|||||||
#include "rtc_tools/event_log_visualizer/plot_base.h"
|
#include "rtc_tools/event_log_visualizer/plot_base.h"
|
||||||
|
|
||||||
namespace webrtc {
|
namespace webrtc {
|
||||||
namespace plotting {
|
|
||||||
|
|
||||||
class ProtobufPlot final : public Plot {
|
class ProtobufPlot final : public Plot {
|
||||||
public:
|
public:
|
||||||
@ -36,7 +35,6 @@ class ProtobufPlotCollection final : public PlotCollection {
|
|||||||
void ExportProtobuf(webrtc::analytics::ChartCollection* collection);
|
void ExportProtobuf(webrtc::analytics::ChartCollection* collection);
|
||||||
};
|
};
|
||||||
|
|
||||||
} // namespace plotting
|
|
||||||
} // namespace webrtc
|
} // namespace webrtc
|
||||||
|
|
||||||
#endif // RTC_TOOLS_EVENT_LOG_VISUALIZER_PLOT_PROTOBUF_H_
|
#endif // RTC_TOOLS_EVENT_LOG_VISUALIZER_PLOT_PROTOBUF_H_
|
||||||
|
|||||||
@ -17,7 +17,6 @@
|
|||||||
#include "rtc_base/checks.h"
|
#include "rtc_base/checks.h"
|
||||||
|
|
||||||
namespace webrtc {
|
namespace webrtc {
|
||||||
namespace plotting {
|
|
||||||
|
|
||||||
PythonPlot::PythonPlot() {}
|
PythonPlot::PythonPlot() {}
|
||||||
|
|
||||||
@ -180,5 +179,4 @@ Plot* PythonPlotCollection::AppendNewPlot() {
|
|||||||
return plot;
|
return plot;
|
||||||
}
|
}
|
||||||
|
|
||||||
} // namespace plotting
|
|
||||||
} // namespace webrtc
|
} // namespace webrtc
|
||||||
|
|||||||
@ -13,7 +13,6 @@
|
|||||||
#include "rtc_tools/event_log_visualizer/plot_base.h"
|
#include "rtc_tools/event_log_visualizer/plot_base.h"
|
||||||
|
|
||||||
namespace webrtc {
|
namespace webrtc {
|
||||||
namespace plotting {
|
|
||||||
|
|
||||||
class PythonPlot final : public Plot {
|
class PythonPlot final : public Plot {
|
||||||
public:
|
public:
|
||||||
@ -30,7 +29,6 @@ class PythonPlotCollection final : public PlotCollection {
|
|||||||
Plot* AppendNewPlot() override;
|
Plot* AppendNewPlot() override;
|
||||||
};
|
};
|
||||||
|
|
||||||
} // namespace plotting
|
|
||||||
} // namespace webrtc
|
} // namespace webrtc
|
||||||
|
|
||||||
#endif // RTC_TOOLS_EVENT_LOG_VISUALIZER_PLOT_PYTHON_H_
|
#endif // RTC_TOOLS_EVENT_LOG_VISUALIZER_PLOT_PYTHON_H_
|
||||||
|
|||||||
@ -14,130 +14,136 @@
|
|||||||
#include <string>
|
#include <string>
|
||||||
|
|
||||||
namespace webrtc {
|
namespace webrtc {
|
||||||
namespace plotting {
|
|
||||||
|
|
||||||
class TriageNotification {
|
class IncomingRtpReceiveTimeGap {
|
||||||
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 {
|
|
||||||
public:
|
public:
|
||||||
IncomingRtpReceiveTimeGap(float time_seconds, int64_t duration)
|
IncomingRtpReceiveTimeGap(float time_seconds, int64_t duration)
|
||||||
: TriageNotification(time_seconds), duration_(duration) {}
|
: time_seconds_(time_seconds), duration_(duration) {}
|
||||||
std::string ToString() {
|
float Time() const { return time_seconds_; }
|
||||||
|
std::string ToString() const {
|
||||||
return std::string("No RTP packets received for ") +
|
return std::string("No RTP packets received for ") +
|
||||||
std::to_string(duration_) + std::string(" ms");
|
std::to_string(duration_) + std::string(" ms");
|
||||||
}
|
}
|
||||||
|
|
||||||
private:
|
private:
|
||||||
|
float time_seconds_;
|
||||||
int64_t duration_;
|
int64_t duration_;
|
||||||
};
|
};
|
||||||
|
|
||||||
class IncomingRtcpReceiveTimeGap : public TriageNotification {
|
class IncomingRtcpReceiveTimeGap {
|
||||||
public:
|
public:
|
||||||
IncomingRtcpReceiveTimeGap(float time_seconds, int64_t duration)
|
IncomingRtcpReceiveTimeGap(float time_seconds, int64_t duration)
|
||||||
: TriageNotification(time_seconds), duration_(duration) {}
|
: time_seconds_(time_seconds), duration_(duration) {}
|
||||||
std::string ToString() {
|
float Time() const { return time_seconds_; }
|
||||||
|
std::string ToString() const {
|
||||||
return std::string("No RTCP packets received for ") +
|
return std::string("No RTCP packets received for ") +
|
||||||
std::to_string(duration_) + std::string(" ms");
|
std::to_string(duration_) + std::string(" ms");
|
||||||
}
|
}
|
||||||
|
|
||||||
private:
|
private:
|
||||||
|
float time_seconds_;
|
||||||
int64_t duration_;
|
int64_t duration_;
|
||||||
};
|
};
|
||||||
|
|
||||||
class OutgoingRtpSendTimeGap : public TriageNotification {
|
class OutgoingRtpSendTimeGap {
|
||||||
public:
|
public:
|
||||||
OutgoingRtpSendTimeGap(float time_seconds, int64_t duration)
|
OutgoingRtpSendTimeGap(float time_seconds, int64_t duration)
|
||||||
: TriageNotification(time_seconds), duration_(duration) {}
|
: time_seconds_(time_seconds), duration_(duration) {}
|
||||||
std::string ToString() {
|
float Time() const { return time_seconds_; }
|
||||||
|
std::string ToString() const {
|
||||||
return std::string("No RTP packets sent for ") + std::to_string(duration_) +
|
return std::string("No RTP packets sent for ") + std::to_string(duration_) +
|
||||||
std::string(" ms");
|
std::string(" ms");
|
||||||
}
|
}
|
||||||
|
|
||||||
private:
|
private:
|
||||||
|
float time_seconds_;
|
||||||
int64_t duration_;
|
int64_t duration_;
|
||||||
};
|
};
|
||||||
|
|
||||||
class OutgoingRtcpSendTimeGap : public TriageNotification {
|
class OutgoingRtcpSendTimeGap {
|
||||||
public:
|
public:
|
||||||
OutgoingRtcpSendTimeGap(float time_seconds, int64_t duration)
|
OutgoingRtcpSendTimeGap(float time_seconds, int64_t duration)
|
||||||
: TriageNotification(time_seconds), duration_(duration) {}
|
: time_seconds_(time_seconds), duration_(duration) {}
|
||||||
std::string ToString() {
|
float Time() const { return time_seconds_; }
|
||||||
|
std::string ToString() const {
|
||||||
return std::string("No RTCP packets sent for ") +
|
return std::string("No RTCP packets sent for ") +
|
||||||
std::to_string(duration_) + std::string(" ms");
|
std::to_string(duration_) + std::string(" ms");
|
||||||
}
|
}
|
||||||
|
|
||||||
private:
|
private:
|
||||||
|
float time_seconds_;
|
||||||
int64_t duration_;
|
int64_t duration_;
|
||||||
};
|
};
|
||||||
|
|
||||||
class IncomingSeqNoJump : public TriageNotification {
|
class IncomingSeqNumJump {
|
||||||
public:
|
public:
|
||||||
IncomingSeqNoJump(float time_seconds, uint32_t ssrc)
|
IncomingSeqNumJump(float time_seconds, uint32_t ssrc)
|
||||||
: TriageNotification(time_seconds), ssrc_(ssrc) {}
|
: time_seconds_(time_seconds), ssrc_(ssrc) {}
|
||||||
std::string ToString() {
|
float Time() const { return time_seconds_; }
|
||||||
|
std::string ToString() const {
|
||||||
return std::string("Sequence number jumps on incoming SSRC ") +
|
return std::string("Sequence number jumps on incoming SSRC ") +
|
||||||
std::to_string(ssrc_);
|
std::to_string(ssrc_);
|
||||||
}
|
}
|
||||||
|
|
||||||
private:
|
private:
|
||||||
|
float time_seconds_;
|
||||||
|
|
||||||
uint32_t ssrc_;
|
uint32_t ssrc_;
|
||||||
};
|
};
|
||||||
|
|
||||||
class IncomingCaptureTimeJump : public TriageNotification {
|
class IncomingCaptureTimeJump {
|
||||||
public:
|
public:
|
||||||
IncomingCaptureTimeJump(float time_seconds, uint32_t ssrc)
|
IncomingCaptureTimeJump(float time_seconds, uint32_t ssrc)
|
||||||
: TriageNotification(time_seconds), ssrc_(ssrc) {}
|
: time_seconds_(time_seconds), ssrc_(ssrc) {}
|
||||||
std::string ToString() {
|
float Time() const { return time_seconds_; }
|
||||||
|
std::string ToString() const {
|
||||||
return std::string("Capture timestamp jumps on incoming SSRC ") +
|
return std::string("Capture timestamp jumps on incoming SSRC ") +
|
||||||
std::to_string(ssrc_);
|
std::to_string(ssrc_);
|
||||||
}
|
}
|
||||||
|
|
||||||
private:
|
private:
|
||||||
|
float time_seconds_;
|
||||||
|
|
||||||
uint32_t ssrc_;
|
uint32_t ssrc_;
|
||||||
};
|
};
|
||||||
|
|
||||||
class OutgoingSeqNoJump : public TriageNotification {
|
class OutgoingSeqNoJump {
|
||||||
public:
|
public:
|
||||||
OutgoingSeqNoJump(float time_seconds, uint32_t ssrc)
|
OutgoingSeqNoJump(float time_seconds, uint32_t ssrc)
|
||||||
: TriageNotification(time_seconds), ssrc_(ssrc) {}
|
: time_seconds_(time_seconds), ssrc_(ssrc) {}
|
||||||
std::string ToString() {
|
float Time() const { return time_seconds_; }
|
||||||
|
std::string ToString() const {
|
||||||
return std::string("Sequence number jumps on outgoing SSRC ") +
|
return std::string("Sequence number jumps on outgoing SSRC ") +
|
||||||
std::to_string(ssrc_);
|
std::to_string(ssrc_);
|
||||||
}
|
}
|
||||||
|
|
||||||
private:
|
private:
|
||||||
|
float time_seconds_;
|
||||||
|
|
||||||
uint32_t ssrc_;
|
uint32_t ssrc_;
|
||||||
};
|
};
|
||||||
|
|
||||||
class OutgoingCaptureTimeJump : public TriageNotification {
|
class OutgoingCaptureTimeJump {
|
||||||
public:
|
public:
|
||||||
OutgoingCaptureTimeJump(float time_seconds, uint32_t ssrc)
|
OutgoingCaptureTimeJump(float time_seconds, uint32_t ssrc)
|
||||||
: TriageNotification(time_seconds), ssrc_(ssrc) {}
|
: time_seconds_(time_seconds), ssrc_(ssrc) {}
|
||||||
std::string ToString() {
|
float Time() const { return time_seconds_; }
|
||||||
|
std::string ToString() const {
|
||||||
return std::string("Capture timestamp jumps on outgoing SSRC ") +
|
return std::string("Capture timestamp jumps on outgoing SSRC ") +
|
||||||
std::to_string(ssrc_);
|
std::to_string(ssrc_);
|
||||||
}
|
}
|
||||||
|
|
||||||
private:
|
private:
|
||||||
|
float time_seconds_;
|
||||||
|
|
||||||
uint32_t ssrc_;
|
uint32_t ssrc_;
|
||||||
};
|
};
|
||||||
|
|
||||||
class OutgoingHighLoss : public TriageNotification {
|
class OutgoingHighLoss {
|
||||||
public:
|
public:
|
||||||
explicit OutgoingHighLoss(double avg_loss_fraction)
|
explicit OutgoingHighLoss(double avg_loss_fraction)
|
||||||
: avg_loss_fraction_(avg_loss_fraction) {}
|
: avg_loss_fraction_(avg_loss_fraction) {}
|
||||||
std::string ToString() {
|
std::string ToString() const {
|
||||||
return std::string("High average loss (") +
|
return std::string("High average loss (") +
|
||||||
std::to_string(avg_loss_fraction_ * 100) +
|
std::to_string(avg_loss_fraction_ * 100) +
|
||||||
std::string("%) across the call.");
|
std::string("%) across the call.");
|
||||||
@ -147,7 +153,6 @@ class OutgoingHighLoss : public TriageNotification {
|
|||||||
double avg_loss_fraction_;
|
double avg_loss_fraction_;
|
||||||
};
|
};
|
||||||
|
|
||||||
} // namespace plotting
|
|
||||||
} // namespace webrtc
|
} // namespace webrtc
|
||||||
|
|
||||||
#endif // RTC_TOOLS_EVENT_LOG_VISUALIZER_TRIAGE_NOTIFICATIONS_H_
|
#endif // RTC_TOOLS_EVENT_LOG_VISUALIZER_TRIAGE_NOTIFICATIONS_H_
|
||||||
|
|||||||
Reference in New Issue
Block a user