Add noop stubs for encoding/parsing all RTC event log events.

The actual event definitions will be added in upcoming CLs.

Bug: webrtc:11933
Change-Id: Ie10b08a71aeb12118612b7717a08b6acbc699c4d
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/249361
Reviewed-by: Sebastian Jansson <srte@webrtc.org>
Commit-Queue: Björn Terelius <terelius@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#35978}
This commit is contained in:
Björn Terelius
2022-02-11 14:25:49 +01:00
committed by WebRTC LUCI CQ
parent a751f167c6
commit 9a6097046e
32 changed files with 915 additions and 372 deletions

View File

@ -170,6 +170,7 @@ rtc_library("rtc_event_frame_events") {
"rtc_event_log/events/rtc_event_frame_decoded.h",
]
deps = [
":rtc_event_field",
"../api/rtc_event_log",
"../api/units:timestamp",
"../api/video:video_frame",
@ -177,6 +178,7 @@ rtc_library("rtc_event_frame_events") {
]
absl_deps = [
"//third_party/abseil-cpp/absl/memory",
"//third_party/abseil-cpp/absl/strings",
"//third_party/abseil-cpp/absl/types:optional",
]
}
@ -192,18 +194,21 @@ rtc_library("rtc_event_generic_packet_events") {
"rtc_event_log/events/rtc_event_generic_packet_sent.h",
]
deps = [
":rtc_event_field",
"../api/rtc_event_log",
"../api/units:timestamp",
"../rtc_base:timeutils",
]
absl_deps = [
"//third_party/abseil-cpp/absl/memory",
"//third_party/abseil-cpp/absl/strings",
"//third_party/abseil-cpp/absl/types:optional",
]
}
rtc_library("rtc_event_rtp_rtcp") {
sources = [
"rtc_event_log/events/logged_rtp_rtcp.h",
"rtc_event_log/events/rtc_event_rtcp_packet_incoming.cc",
"rtc_event_log/events/rtc_event_rtcp_packet_incoming.h",
"rtc_event_log/events/rtc_event_rtcp_packet_outgoing.cc",
@ -215,13 +220,19 @@ rtc_library("rtc_event_rtp_rtcp") {
]
deps = [
":rtc_event_field",
"../api:array_view",
"../api:rtp_headers",
"../api/rtc_event_log",
"../api/units:timestamp",
"../modules/rtp_rtcp:rtp_rtcp_format",
"../rtc_base:checks",
"../rtc_base:rtc_base_approved",
]
absl_deps = [ "//third_party/abseil-cpp/absl/memory" ]
absl_deps = [
"//third_party/abseil-cpp/absl/memory",
"//third_party/abseil-cpp/absl/strings",
]
}
rtc_library("rtc_event_video") {
@ -233,12 +244,16 @@ rtc_library("rtc_event_video") {
]
deps = [
":rtc_event_field",
":rtc_stream_config",
"../api/rtc_event_log",
"../api/units:timestamp",
"../rtc_base:checks",
]
absl_deps = [ "//third_party/abseil-cpp/absl/memory" ]
absl_deps = [
"//third_party/abseil-cpp/absl/memory",
"//third_party/abseil-cpp/absl/strings",
]
}
rtc_library("rtc_event_number_encodings") {
@ -391,7 +406,6 @@ if (rtc_enable_protobuf) {
rtc_library("rtc_event_log_parser") {
visibility = [ "*" ]
sources = [
"rtc_event_log/logged_events.cc",
"rtc_event_log/logged_events.h",
"rtc_event_log/rtc_event_log_parser.cc",
"rtc_event_log/rtc_event_log_parser.h",
@ -540,13 +554,17 @@ rtc_library("ice_log") {
]
deps = [
":rtc_event_field",
"../api:libjingle_logging_api",
"../api:libjingle_peerconnection_api", # For api/dtls_transport_interface.h
"../api/rtc_event_log",
"../api/units:timestamp",
"../rtc_base:rtc_base_approved",
]
absl_deps = [ "//third_party/abseil-cpp/absl/memory" ]
absl_deps = [
"//third_party/abseil-cpp/absl/memory",
"//third_party/abseil-cpp/absl/strings",
]
}
if (rtc_include_tests) {

View File

@ -75,9 +75,53 @@ std::string RtcEventLogEncoderV3::EncodeLogEnd(int64_t timestamp_us) {
RtcEventLogEncoderV3::RtcEventLogEncoderV3() {
encoders_[RtcEvent::Type::AlrStateEvent] = RtcEventAlrState::Encode;
encoders_[RtcEvent::Type::AudioNetworkAdaptation] =
RtcEventAudioNetworkAdaptation::Encode;
encoders_[RtcEvent::Type::AudioPlayout] = RtcEventAudioPlayout::Encode;
encoders_[RtcEvent::Type::AudioReceiveStreamConfig] =
RtcEventAudioReceiveStreamConfig::Encode;
encoders_[RtcEvent::Type::AudioSendStreamConfig] =
RtcEventAudioSendStreamConfig::Encode;
encoders_[RtcEvent::Type::BweUpdateDelayBased] =
RtcEventBweUpdateDelayBased::Encode;
encoders_[RtcEvent::Type::BweUpdateLossBased] =
RtcEventBweUpdateLossBased::Encode;
encoders_[RtcEvent::Type::DtlsTransportState] =
RtcEventDtlsTransportState::Encode;
encoders_[RtcEvent::Type::DtlsWritableState] =
RtcEventDtlsWritableState::Encode;
encoders_[RtcEvent::Type::FrameDecoded] = RtcEventFrameDecoded::Encode;
encoders_[RtcEvent::Type::GenericAckReceived] =
RtcEventGenericAckReceived::Encode;
encoders_[RtcEvent::Type::GenericPacketReceived] =
RtcEventGenericPacketReceived::Encode;
encoders_[RtcEvent::Type::GenericPacketSent] =
RtcEventGenericPacketSent::Encode;
encoders_[RtcEvent::Type::IceCandidatePairConfig] =
RtcEventIceCandidatePairConfig::Encode;
encoders_[RtcEvent::Type::IceCandidatePairEvent] =
RtcEventIceCandidatePair::Encode;
encoders_[RtcEvent::Type::ProbeClusterCreated] =
RtcEventProbeClusterCreated::Encode;
encoders_[RtcEvent::Type::ProbeResultFailure] =
RtcEventProbeResultFailure::Encode;
encoders_[RtcEvent::Type::ProbeResultSuccess] =
RtcEventProbeResultSuccess::Encode;
encoders_[RtcEvent::Type::RemoteEstimateEvent] =
RtcEventRemoteEstimate::Encode;
encoders_[RtcEvent::Type::RouteChangeEvent] = RtcEventRouteChange::Encode;
encoders_[RtcEvent::Type::RtcpPacketIncoming] =
RtcEventRtcpPacketIncoming::Encode;
encoders_[RtcEvent::Type::RtcpPacketOutgoing] =
RtcEventRtcpPacketOutgoing::Encode;
encoders_[RtcEvent::Type::RtpPacketIncoming] =
RtcEventRtpPacketIncoming::Encode;
encoders_[RtcEvent::Type::RtpPacketOutgoing] =
RtcEventRtpPacketOutgoing::Encode;
encoders_[RtcEvent::Type::VideoReceiveStreamConfig] =
RtcEventVideoReceiveStreamConfig::Encode;
encoders_[RtcEvent::Type::VideoSendStreamConfig] =
RtcEventVideoSendStreamConfig::Encode;
}
std::string RtcEventLogEncoderV3::EncodeBatch(

View File

@ -0,0 +1,243 @@
/*
* Copyright 2022 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_EVENTS_LOGGED_RTP_RTCP_H_
#define LOGGING_RTC_EVENT_LOG_EVENTS_LOGGED_RTP_RTCP_H_
#include <string>
#include <vector>
#include "api/rtp_headers.h"
#include "api/units/timestamp.h"
#include "modules/rtp_rtcp/source/rtcp_packet/bye.h"
#include "modules/rtp_rtcp/source/rtcp_packet/extended_reports.h"
#include "modules/rtp_rtcp/source/rtcp_packet/fir.h"
#include "modules/rtp_rtcp/source/rtcp_packet/loss_notification.h"
#include "modules/rtp_rtcp/source/rtcp_packet/nack.h"
#include "modules/rtp_rtcp/source/rtcp_packet/pli.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"
namespace webrtc {
struct LoggedRtpPacket {
LoggedRtpPacket(Timestamp timestamp,
RTPHeader header,
size_t header_length,
size_t total_length)
: timestamp(timestamp),
header(header),
header_length(header_length),
total_length(total_length) {}
int64_t log_time_us() const { return timestamp.us(); }
int64_t log_time_ms() const { return timestamp.ms(); }
Timestamp 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 LoggedRtpPacketIncoming {
LoggedRtpPacketIncoming(Timestamp timestamp,
RTPHeader header,
size_t header_length,
size_t total_length)
: rtp(timestamp, header, header_length, total_length) {}
int64_t log_time_us() const { return rtp.timestamp.us(); }
int64_t log_time_ms() const { return rtp.timestamp.ms(); }
LoggedRtpPacket rtp;
};
struct LoggedRtpPacketOutgoing {
LoggedRtpPacketOutgoing(Timestamp timestamp,
RTPHeader header,
size_t header_length,
size_t total_length)
: rtp(timestamp, header, header_length, total_length) {}
int64_t log_time_us() const { return rtp.timestamp.us(); }
int64_t log_time_ms() const { return rtp.timestamp.ms(); }
LoggedRtpPacket rtp;
};
struct LoggedRtcpPacket {
LoggedRtcpPacket(Timestamp timestamp, const std::vector<uint8_t>& packet)
: timestamp(timestamp), raw_data(packet) {}
LoggedRtcpPacket(Timestamp timestamp, const std::string& packet)
: timestamp(timestamp), raw_data(packet.size()) {
memcpy(raw_data.data(), packet.data(), packet.size());
}
LoggedRtcpPacket(const LoggedRtcpPacket& rhs) = default;
~LoggedRtcpPacket() = default;
int64_t log_time_us() const { return timestamp.us(); }
int64_t log_time_ms() const { return timestamp.ms(); }
Timestamp timestamp;
std::vector<uint8_t> raw_data;
};
struct LoggedRtcpPacketIncoming {
LoggedRtcpPacketIncoming(Timestamp timestamp,
const std::vector<uint8_t>& packet)
: rtcp(timestamp, packet) {}
LoggedRtcpPacketIncoming(Timestamp timestamp, const std::string& packet)
: rtcp(timestamp, packet) {}
int64_t log_time_us() const { return rtcp.timestamp.us(); }
int64_t log_time_ms() const { return rtcp.timestamp.ms(); }
LoggedRtcpPacket rtcp;
};
struct LoggedRtcpPacketOutgoing {
LoggedRtcpPacketOutgoing(Timestamp timestamp,
const std::vector<uint8_t>& packet)
: rtcp(timestamp, packet) {}
LoggedRtcpPacketOutgoing(Timestamp timestamp, const std::string& packet)
: rtcp(timestamp, packet) {}
int64_t log_time_us() const { return rtcp.timestamp.us(); }
int64_t log_time_ms() const { return rtcp.timestamp.ms(); }
LoggedRtcpPacket rtcp;
};
struct LoggedRtcpPacketReceiverReport {
LoggedRtcpPacketReceiverReport() = default;
LoggedRtcpPacketReceiverReport(Timestamp timestamp,
const rtcp::ReceiverReport& rr)
: timestamp(timestamp), rr(rr) {}
int64_t log_time_us() const { return timestamp.us(); }
int64_t log_time_ms() const { return timestamp.ms(); }
Timestamp timestamp = Timestamp::MinusInfinity();
rtcp::ReceiverReport rr;
};
struct LoggedRtcpPacketSenderReport {
LoggedRtcpPacketSenderReport() = default;
LoggedRtcpPacketSenderReport(Timestamp timestamp,
const rtcp::SenderReport& sr)
: timestamp(timestamp), sr(sr) {}
int64_t log_time_us() const { return timestamp.us(); }
int64_t log_time_ms() const { return timestamp.ms(); }
Timestamp timestamp = Timestamp::MinusInfinity();
rtcp::SenderReport sr;
};
struct LoggedRtcpPacketExtendedReports {
LoggedRtcpPacketExtendedReports() = default;
int64_t log_time_us() const { return timestamp.us(); }
int64_t log_time_ms() const { return timestamp.ms(); }
Timestamp timestamp = Timestamp::MinusInfinity();
rtcp::ExtendedReports xr;
};
struct LoggedRtcpPacketRemb {
LoggedRtcpPacketRemb() = default;
LoggedRtcpPacketRemb(Timestamp timestamp, const rtcp::Remb& remb)
: timestamp(timestamp), remb(remb) {}
int64_t log_time_us() const { return timestamp.us(); }
int64_t log_time_ms() const { return timestamp.ms(); }
Timestamp timestamp = Timestamp::MinusInfinity();
rtcp::Remb remb;
};
struct LoggedRtcpPacketNack {
LoggedRtcpPacketNack() = default;
LoggedRtcpPacketNack(Timestamp timestamp, const rtcp::Nack& nack)
: timestamp(timestamp), nack(nack) {}
int64_t log_time_us() const { return timestamp.us(); }
int64_t log_time_ms() const { return timestamp.ms(); }
Timestamp timestamp = Timestamp::MinusInfinity();
rtcp::Nack nack;
};
struct LoggedRtcpPacketFir {
LoggedRtcpPacketFir() = default;
int64_t log_time_us() const { return timestamp.us(); }
int64_t log_time_ms() const { return timestamp.ms(); }
Timestamp timestamp = Timestamp::MinusInfinity();
rtcp::Fir fir;
};
struct LoggedRtcpPacketPli {
LoggedRtcpPacketPli() = default;
int64_t log_time_us() const { return timestamp.us(); }
int64_t log_time_ms() const { return timestamp.ms(); }
Timestamp timestamp = Timestamp::MinusInfinity();
rtcp::Pli pli;
};
struct LoggedRtcpPacketTransportFeedback {
LoggedRtcpPacketTransportFeedback()
: transport_feedback(/*include_timestamps=*/true, /*include_lost*/ true) {
}
LoggedRtcpPacketTransportFeedback(
Timestamp timestamp,
const rtcp::TransportFeedback& transport_feedback)
: timestamp(timestamp), transport_feedback(transport_feedback) {}
int64_t log_time_us() const { return timestamp.us(); }
int64_t log_time_ms() const { return timestamp.ms(); }
Timestamp timestamp = Timestamp::MinusInfinity();
rtcp::TransportFeedback transport_feedback;
};
struct LoggedRtcpPacketLossNotification {
LoggedRtcpPacketLossNotification() = default;
LoggedRtcpPacketLossNotification(
Timestamp timestamp,
const rtcp::LossNotification& loss_notification)
: timestamp(timestamp), loss_notification(loss_notification) {}
int64_t log_time_us() const { return timestamp.us(); }
int64_t log_time_ms() const { return timestamp.ms(); }
Timestamp timestamp = Timestamp::MinusInfinity();
rtcp::LossNotification loss_notification;
};
struct LoggedRtcpPacketBye {
LoggedRtcpPacketBye() = default;
int64_t log_time_us() const { return timestamp.us(); }
int64_t log_time_ms() const { return timestamp.ms(); }
Timestamp timestamp = Timestamp::MinusInfinity();
rtcp::Bye bye;
};
} // namespace webrtc
#endif // LOGGING_RTC_EVENT_LOG_EVENTS_LOGGED_RTP_RTCP_H_

View File

@ -12,9 +12,13 @@
#define LOGGING_RTC_EVENT_LOG_EVENTS_RTC_EVENT_AUDIO_NETWORK_ADAPTATION_H_
#include <memory>
#include <string>
#include <vector>
#include "absl/strings/string_view.h"
#include "api/rtc_event_log/rtc_event.h"
#include "api/units/timestamp.h"
#include "logging/rtc_event_log/events/rtc_event_field_encoding_parser.h"
#include "modules/audio_coding/audio_network_adaptor/include/audio_network_adaptor_config.h"
namespace webrtc {
@ -49,6 +53,19 @@ class RtcEventAudioNetworkAdaptation final : public RtcEvent {
const AudioEncoderRuntimeConfig& config() const { return *config_; }
static std::string Encode(rtc::ArrayView<const RtcEvent*> batch) {
// TODO(terelius): Implement
return "";
}
static RtcEventLogParseStatus Parse(
absl::string_view encoded_bytes,
bool batched,
std::vector<LoggedAudioNetworkAdaptationEvent>& output) {
// TODO(terelius): Implement
return RtcEventLogParseStatus::Error("Not Implemented", __FILE__, __LINE__);
}
private:
RtcEventAudioNetworkAdaptation(const RtcEventAudioNetworkAdaptation& other);

View File

@ -56,12 +56,12 @@ class RtcEventAudioPlayout final : public RtcEvent {
}
static RtcEventLogParseStatus Parse(
absl::string_view s,
absl::string_view encoded_bytes,
bool batched,
std::map<uint32_t, std::vector<LoggedAudioPlayoutEvent>>& output) {
std::vector<LoggedAudioPlayoutEvent> temp_output;
auto status =
RtcEventAudioPlayout::definition_.ParseBatch(s, batched, temp_output);
auto status = RtcEventAudioPlayout::definition_.ParseBatch(
encoded_bytes, batched, temp_output);
for (const LoggedAudioPlayoutEvent& event : temp_output) {
output[event.ssrc].push_back(event);
}

View File

@ -12,9 +12,13 @@
#define LOGGING_RTC_EVENT_LOG_EVENTS_RTC_EVENT_AUDIO_RECEIVE_STREAM_CONFIG_H_
#include <memory>
#include <string>
#include <vector>
#include "absl/strings/string_view.h"
#include "api/rtc_event_log/rtc_event.h"
#include "api/units/timestamp.h"
#include "logging/rtc_event_log/events/rtc_event_field_encoding_parser.h"
#include "logging/rtc_event_log/rtc_stream_config.h"
namespace webrtc {
@ -46,6 +50,19 @@ class RtcEventAudioReceiveStreamConfig final : public RtcEvent {
const rtclog::StreamConfig& config() const { return *config_; }
static std::string Encode(rtc::ArrayView<const RtcEvent*> batch) {
// TODO(terelius): Implement
return "";
}
static RtcEventLogParseStatus Parse(
absl::string_view encoded_bytes,
bool batched,
std::vector<LoggedAudioRecvConfig>& output) {
// TODO(terelius): Implement
return RtcEventLogParseStatus::Error("Not Implemented", __FILE__, __LINE__);
}
private:
RtcEventAudioReceiveStreamConfig(
const RtcEventAudioReceiveStreamConfig& other);

View File

@ -12,8 +12,12 @@
#define LOGGING_RTC_EVENT_LOG_EVENTS_RTC_EVENT_AUDIO_SEND_STREAM_CONFIG_H_
#include <memory>
#include <string>
#include <vector>
#include "absl/strings/string_view.h"
#include "api/rtc_event_log/rtc_event.h"
#include "logging/rtc_event_log/events/rtc_event_field_encoding_parser.h"
#include "logging/rtc_event_log/rtc_stream_config.h"
namespace webrtc {
@ -45,6 +49,19 @@ class RtcEventAudioSendStreamConfig final : public RtcEvent {
const rtclog::StreamConfig& config() const { return *config_; }
static std::string Encode(rtc::ArrayView<const RtcEvent*> batch) {
// TODO(terelius): Implement
return "";
}
static RtcEventLogParseStatus Parse(
absl::string_view encoded_bytes,
bool batched,
std::vector<LoggedAudioSendConfig>& output) {
// TODO(terelius): Implement
return RtcEventLogParseStatus::Error("Not Implemented", __FILE__, __LINE__);
}
private:
RtcEventAudioSendStreamConfig(const RtcEventAudioSendStreamConfig& other);

View File

@ -103,11 +103,11 @@ class RtcEventBweUpdateDelayBased final : public RtcEvent {
}
static RtcEventLogParseStatus Parse(
absl::string_view s,
absl::string_view encoded_bytes,
bool batched,
std::vector<LoggedBweDelayBasedUpdate>& output) {
return RtcEventBweUpdateDelayBased::definition_.ParseBatch(s, batched,
output);
return RtcEventBweUpdateDelayBased::definition_.ParseBatch(encoded_bytes,
batched, output);
}
private:

View File

@ -14,9 +14,13 @@
#include <stdint.h>
#include <memory>
#include <string>
#include <vector>
#include "absl/strings/string_view.h"
#include "api/rtc_event_log/rtc_event.h"
#include "api/units/timestamp.h"
#include "logging/rtc_event_log/events/rtc_event_field_encoding_parser.h"
namespace webrtc {
@ -58,6 +62,19 @@ class RtcEventBweUpdateLossBased final : public RtcEvent {
uint8_t fraction_loss() const { return fraction_loss_; }
int32_t total_packets() const { return total_packets_; }
static std::string Encode(rtc::ArrayView<const RtcEvent*> batch) {
// TODO(terelius): Implement
return "";
}
static RtcEventLogParseStatus Parse(
absl::string_view encoded_bytes,
bool batched,
std::vector<LoggedBweLossBasedUpdate>& output) {
// TODO(terelius): Implement
return RtcEventLogParseStatus::Error("Not Implemented", __FILE__, __LINE__);
}
private:
RtcEventBweUpdateLossBased(const RtcEventBweUpdateLossBased& other);

View File

@ -12,10 +12,14 @@
#define LOGGING_RTC_EVENT_LOG_EVENTS_RTC_EVENT_DTLS_TRANSPORT_STATE_H_
#include <memory>
#include <string>
#include <vector>
#include "absl/strings/string_view.h"
#include "api/dtls_transport_interface.h"
#include "api/rtc_event_log/rtc_event.h"
#include "api/units/timestamp.h"
#include "logging/rtc_event_log/events/rtc_event_field_encoding_parser.h"
namespace webrtc {
@ -43,6 +47,19 @@ class RtcEventDtlsTransportState : public RtcEvent {
return dtls_transport_state_;
}
static std::string Encode(rtc::ArrayView<const RtcEvent*> batch) {
// TODO(terelius): Implement
return "";
}
static RtcEventLogParseStatus Parse(
absl::string_view encoded_bytes,
bool batched,
std::vector<LoggedDtlsTransportState>& output) {
// TODO(terelius): Implement
return RtcEventLogParseStatus::Error("Not Implemented", __FILE__, __LINE__);
}
private:
RtcEventDtlsTransportState(const RtcEventDtlsTransportState& other);

View File

@ -12,9 +12,13 @@
#define LOGGING_RTC_EVENT_LOG_EVENTS_RTC_EVENT_DTLS_WRITABLE_STATE_H_
#include <memory>
#include <string>
#include <vector>
#include "absl/strings/string_view.h"
#include "api/rtc_event_log/rtc_event.h"
#include "api/units/timestamp.h"
#include "logging/rtc_event_log/events/rtc_event_field_encoding_parser.h"
namespace webrtc {
@ -43,6 +47,19 @@ class RtcEventDtlsWritableState : public RtcEvent {
bool writable() const { return writable_; }
static std::string Encode(rtc::ArrayView<const RtcEvent*> batch) {
// TODO(terelius): Implement
return "";
}
static RtcEventLogParseStatus Parse(
absl::string_view encoded_bytes,
bool batched,
std::vector<LoggedDtlsWritableState>& output) {
// TODO(terelius): Implement
return RtcEventLogParseStatus::Error("Not Implemented", __FILE__, __LINE__);
}
private:
RtcEventDtlsWritableState(const RtcEventDtlsWritableState& other);

View File

@ -13,11 +13,16 @@
#include <stdint.h>
#include <map>
#include <memory>
#include <string>
#include <vector>
#include "absl/strings/string_view.h"
#include "api/rtc_event_log/rtc_event.h"
#include "api/units/timestamp.h"
#include "api/video/video_codec_type.h"
#include "logging/rtc_event_log/events/rtc_event_field_encoding_parser.h"
namespace webrtc {
@ -58,6 +63,19 @@ class RtcEventFrameDecoded final : public RtcEvent {
VideoCodecType codec() const { return codec_; }
uint8_t qp() const { return qp_; }
static std::string Encode(rtc::ArrayView<const RtcEvent*> batch) {
// TODO(terelius): Implement
return "";
}
static RtcEventLogParseStatus Parse(
absl::string_view encoded_bytes,
bool batched,
std::map<uint32_t, std::vector<LoggedFrameDecoded>>& output) {
// TODO(terelius): Implement
return RtcEventLogParseStatus::Error("Not Implemented", __FILE__, __LINE__);
}
private:
RtcEventFrameDecoded(const RtcEventFrameDecoded& other);

View File

@ -12,11 +12,14 @@
#define LOGGING_RTC_EVENT_LOG_EVENTS_RTC_EVENT_GENERIC_ACK_RECEIVED_H_
#include <memory>
#include <string>
#include <vector>
#include "absl/strings/string_view.h"
#include "absl/types/optional.h"
#include "api/rtc_event_log/rtc_event.h"
#include "api/units/timestamp.h"
#include "logging/rtc_event_log/events/rtc_event_field_encoding_parser.h"
namespace webrtc {
@ -77,6 +80,19 @@ class RtcEventGenericAckReceived final : public RtcEvent {
return receive_acked_packet_time_ms_;
}
static std::string Encode(rtc::ArrayView<const RtcEvent*> batch) {
// TODO(terelius): Implement
return "";
}
static RtcEventLogParseStatus Parse(
absl::string_view encoded_bytes,
bool batched,
std::vector<LoggedGenericAckReceived>& output) {
// TODO(terelius): Implement
return RtcEventLogParseStatus::Error("Not Implemented", __FILE__, __LINE__);
}
private:
RtcEventGenericAckReceived(const RtcEventGenericAckReceived& packet);

View File

@ -12,9 +12,13 @@
#define LOGGING_RTC_EVENT_LOG_EVENTS_RTC_EVENT_GENERIC_PACKET_RECEIVED_H_
#include <memory>
#include <string>
#include <vector>
#include "absl/strings/string_view.h"
#include "api/rtc_event_log/rtc_event.h"
#include "api/units/timestamp.h"
#include "logging/rtc_event_log/events/rtc_event_field_encoding_parser.h"
namespace webrtc {
@ -54,6 +58,19 @@ class RtcEventGenericPacketReceived final : public RtcEvent {
// including ICE/TURN/IP overheads.
size_t packet_length() const { return packet_length_; }
static std::string Encode(rtc::ArrayView<const RtcEvent*> batch) {
// TODO(terelius): Implement
return "";
}
static RtcEventLogParseStatus Parse(
absl::string_view encoded_bytes,
bool batched,
std::vector<LoggedGenericPacketReceived>& output) {
// TODO(terelius): Implement
return RtcEventLogParseStatus::Error("Not Implemented", __FILE__, __LINE__);
}
private:
RtcEventGenericPacketReceived(const RtcEventGenericPacketReceived& packet);

View File

@ -12,9 +12,13 @@
#define LOGGING_RTC_EVENT_LOG_EVENTS_RTC_EVENT_GENERIC_PACKET_SENT_H_
#include <memory>
#include <string>
#include <vector>
#include "absl/strings/string_view.h"
#include "api/rtc_event_log/rtc_event.h"
#include "api/units/timestamp.h"
#include "logging/rtc_event_log/events/rtc_event_field_encoding_parser.h"
namespace webrtc {
@ -78,6 +82,19 @@ class RtcEventGenericPacketSent final : public RtcEvent {
size_t padding_length() const { return padding_length_; }
static std::string Encode(rtc::ArrayView<const RtcEvent*> batch) {
// TODO(terelius): Implement
return "";
}
static RtcEventLogParseStatus Parse(
absl::string_view encoded_bytes,
bool batched,
std::vector<LoggedGenericPacketSent>& output) {
// TODO(terelius): Implement
return RtcEventLogParseStatus::Error("Not Implemented", __FILE__, __LINE__);
}
private:
RtcEventGenericPacketSent(const RtcEventGenericPacketSent& packet);

View File

@ -14,9 +14,13 @@
#include <stdint.h>
#include <memory>
#include <string>
#include <vector>
#include "absl/strings/string_view.h"
#include "api/rtc_event_log/rtc_event.h"
#include "api/units/timestamp.h"
#include "logging/rtc_event_log/events/rtc_event_field_encoding_parser.h"
namespace webrtc {
@ -67,6 +71,19 @@ class RtcEventIceCandidatePair final : public RtcEvent {
uint32_t candidate_pair_id() const { return candidate_pair_id_; }
uint32_t transaction_id() const { return transaction_id_; }
static std::string Encode(rtc::ArrayView<const RtcEvent*> batch) {
// TODO(terelius): Implement
return "";
}
static RtcEventLogParseStatus Parse(
absl::string_view encoded_bytes,
bool batched,
std::vector<LoggedIceCandidatePairEvent>& output) {
// TODO(terelius): Implement
return RtcEventLogParseStatus::Error("Not Implemented", __FILE__, __LINE__);
}
private:
RtcEventIceCandidatePair(const RtcEventIceCandidatePair& other);

View File

@ -14,9 +14,13 @@
#include <stdint.h>
#include <memory>
#include <string>
#include <vector>
#include "absl/strings/string_view.h"
#include "api/rtc_event_log/rtc_event.h"
#include "api/units/timestamp.h"
#include "logging/rtc_event_log/events/rtc_event_field_encoding_parser.h"
namespace webrtc {
@ -121,6 +125,19 @@ class RtcEventIceCandidatePairConfig final : public RtcEvent {
return candidate_pair_desc_;
}
static std::string Encode(rtc::ArrayView<const RtcEvent*> batch) {
// TODO(terelius): Implement
return "";
}
static RtcEventLogParseStatus Parse(
absl::string_view encoded_bytes,
bool batched,
std::vector<LoggedIceCandidatePairConfig>& output) {
// TODO(terelius): Implement
return RtcEventLogParseStatus::Error("Not Implemented", __FILE__, __LINE__);
}
private:
RtcEventIceCandidatePairConfig(const RtcEventIceCandidatePairConfig& other);

View File

@ -14,9 +14,13 @@
#include <stdint.h>
#include <memory>
#include <string>
#include <vector>
#include "absl/strings/string_view.h"
#include "api/rtc_event_log/rtc_event.h"
#include "api/units/timestamp.h"
#include "logging/rtc_event_log/events/rtc_event_field_encoding_parser.h"
namespace webrtc {
@ -63,6 +67,19 @@ class RtcEventProbeClusterCreated final : public RtcEvent {
uint32_t min_probes() const { return min_probes_; }
uint32_t min_bytes() const { return min_bytes_; }
static std::string Encode(rtc::ArrayView<const RtcEvent*> batch) {
// TODO(terelius): Implement
return "";
}
static RtcEventLogParseStatus Parse(
absl::string_view encoded_bytes,
bool batched,
std::vector<LoggedBweProbeClusterCreatedEvent>& output) {
// TODO(terelius): Implement
return RtcEventLogParseStatus::Error("Not Implemented", __FILE__, __LINE__);
}
private:
RtcEventProbeClusterCreated(const RtcEventProbeClusterCreated& other);

View File

@ -14,9 +14,13 @@
#include <stdint.h>
#include <memory>
#include <string>
#include <vector>
#include "absl/strings/string_view.h"
#include "api/rtc_event_log/rtc_event.h"
#include "api/units/timestamp.h"
#include "logging/rtc_event_log/events/rtc_event_field_encoding_parser.h"
namespace webrtc {
@ -57,6 +61,19 @@ class RtcEventProbeResultFailure final : public RtcEvent {
int32_t id() const { return id_; }
ProbeFailureReason failure_reason() const { return failure_reason_; }
static std::string Encode(rtc::ArrayView<const RtcEvent*> batch) {
// TODO(terelius): Implement
return "";
}
static RtcEventLogParseStatus Parse(
absl::string_view encoded_bytes,
bool batched,
std::vector<LoggedBweProbeFailureEvent>& output) {
// TODO(terelius): Implement
return RtcEventLogParseStatus::Error("Not Implemented", __FILE__, __LINE__);
}
private:
RtcEventProbeResultFailure(const RtcEventProbeResultFailure& other);

View File

@ -14,9 +14,13 @@
#include <stdint.h>
#include <memory>
#include <string>
#include <vector>
#include "absl/strings/string_view.h"
#include "api/rtc_event_log/rtc_event.h"
#include "api/units/timestamp.h"
#include "logging/rtc_event_log/events/rtc_event_field_encoding_parser.h"
namespace webrtc {
@ -50,6 +54,19 @@ class RtcEventProbeResultSuccess final : public RtcEvent {
int32_t id() const { return id_; }
int32_t bitrate_bps() const { return bitrate_bps_; }
static std::string Encode(rtc::ArrayView<const RtcEvent*> batch) {
// TODO(terelius): Implement
return "";
}
static RtcEventLogParseStatus Parse(
absl::string_view encoded_bytes,
bool batched,
std::vector<LoggedBweProbeSuccessEvent>& output) {
// TODO(terelius): Implement
return RtcEventLogParseStatus::Error("Not Implemented", __FILE__, __LINE__);
}
private:
RtcEventProbeResultSuccess(const RtcEventProbeResultSuccess& other);

View File

@ -11,11 +11,15 @@
#define LOGGING_RTC_EVENT_LOG_EVENTS_RTC_EVENT_REMOTE_ESTIMATE_H_
#include <memory>
#include <string>
#include <vector>
#include "absl/strings/string_view.h"
#include "absl/types/optional.h"
#include "api/rtc_event_log/rtc_event.h"
#include "api/units/data_rate.h"
#include "api/units/timestamp.h"
#include "logging/rtc_event_log/events/rtc_event_field_encoding_parser.h"
namespace webrtc {
@ -42,6 +46,19 @@ class RtcEventRemoteEstimate final : public RtcEvent {
Type GetType() const override { return kType; }
bool IsConfigEvent() const override { return false; }
static std::string Encode(rtc::ArrayView<const RtcEvent*> batch) {
// TODO(terelius): Implement
return "";
}
static RtcEventLogParseStatus Parse(
absl::string_view encoded_bytes,
bool batched,
std::vector<LoggedRemoteEstimateEvent>& output) {
// TODO(terelius): Implement
return RtcEventLogParseStatus::Error("Not Implemented", __FILE__, __LINE__);
}
const DataRate link_capacity_lower_;
const DataRate link_capacity_upper_;
};

View File

@ -12,9 +12,13 @@
#define LOGGING_RTC_EVENT_LOG_EVENTS_RTC_EVENT_ROUTE_CHANGE_H_
#include <memory>
#include <string>
#include <vector>
#include "absl/strings/string_view.h"
#include "api/rtc_event_log/rtc_event.h"
#include "api/units/timestamp.h"
#include "logging/rtc_event_log/events/rtc_event_field_encoding_parser.h"
namespace webrtc {
@ -46,6 +50,19 @@ class RtcEventRouteChange final : public RtcEvent {
bool connected() const { return connected_; }
uint32_t overhead() const { return overhead_; }
static std::string Encode(rtc::ArrayView<const RtcEvent*> batch) {
// TODO(terelius): Implement
return "";
}
static RtcEventLogParseStatus Parse(
absl::string_view encoded_bytes,
bool batched,
std::vector<LoggedRouteChangeEvent>& output) {
// TODO(terelius): Implement
return RtcEventLogParseStatus::Error("Not Implemented", __FILE__, __LINE__);
}
private:
RtcEventRouteChange(const RtcEventRouteChange& other);

View File

@ -14,9 +14,14 @@
#include <stdint.h>
#include <memory>
#include <string>
#include <vector>
#include "absl/strings/string_view.h"
#include "api/array_view.h"
#include "api/rtc_event_log/rtc_event.h"
#include "logging/rtc_event_log/events/logged_rtp_rtcp.h"
#include "logging/rtc_event_log/events/rtc_event_field_encoding_parser.h"
#include "rtc_base/buffer.h"
namespace webrtc {
@ -35,6 +40,19 @@ class RtcEventRtcpPacketIncoming final : public RtcEvent {
const rtc::Buffer& packet() const { return packet_; }
static std::string Encode(rtc::ArrayView<const RtcEvent*> batch) {
// TODO(terelius): Implement
return "";
}
static RtcEventLogParseStatus Parse(
absl::string_view encoded_bytes,
bool batched,
std::vector<LoggedRtcpPacketIncoming>& output) {
// TODO(terelius): Implement
return RtcEventLogParseStatus::Error("Not Implemented", __FILE__, __LINE__);
}
private:
RtcEventRtcpPacketIncoming(const RtcEventRtcpPacketIncoming& other);

View File

@ -14,9 +14,14 @@
#include <stdint.h>
#include <memory>
#include <string>
#include <vector>
#include "absl/strings/string_view.h"
#include "api/array_view.h"
#include "api/rtc_event_log/rtc_event.h"
#include "logging/rtc_event_log/events/logged_rtp_rtcp.h"
#include "logging/rtc_event_log/events/rtc_event_field_encoding_parser.h"
#include "rtc_base/buffer.h"
namespace webrtc {
@ -35,6 +40,19 @@ class RtcEventRtcpPacketOutgoing final : public RtcEvent {
const rtc::Buffer& packet() const { return packet_; }
static std::string Encode(rtc::ArrayView<const RtcEvent*> batch) {
// TODO(terelius): Implement
return "";
}
static RtcEventLogParseStatus Parse(
absl::string_view encoded_bytes,
bool batched,
std::vector<LoggedRtcpPacketOutgoing>& output) {
// TODO(terelius): Implement
return RtcEventLogParseStatus::Error("Not Implemented", __FILE__, __LINE__);
}
private:
RtcEventRtcpPacketOutgoing(const RtcEventRtcpPacketOutgoing& other);

View File

@ -13,11 +13,17 @@
#include <cstddef>
#include <cstdint>
#include <map>
#include <memory>
#include <string>
#include <utility>
#include <vector>
#include "absl/strings/string_view.h"
#include "api/array_view.h"
#include "api/rtc_event_log/rtc_event.h"
#include "logging/rtc_event_log/events/logged_rtp_rtcp.h"
#include "logging/rtc_event_log/events/rtc_event_field_encoding_parser.h"
#include "modules/rtp_rtcp/source/rtp_packet.h"
namespace webrtc {
@ -59,6 +65,19 @@ class RtcEventRtpPacketIncoming final : public RtcEvent {
size_t header_length() const { return packet_.headers_size(); }
size_t padding_length() const { return packet_.padding_size(); }
static std::string Encode(rtc::ArrayView<const RtcEvent*> batch) {
// TODO(terelius): Implement
return "";
}
static RtcEventLogParseStatus Parse(
absl::string_view encoded_bytes,
bool batched,
std::map<uint32_t, std::vector<LoggedRtpPacketIncoming>>& output) {
// TODO(terelius): Implement
return RtcEventLogParseStatus::Error("Not Implemented", __FILE__, __LINE__);
}
private:
RtcEventRtpPacketIncoming(const RtcEventRtpPacketIncoming& other);

View File

@ -13,11 +13,17 @@
#include <cstddef>
#include <cstdint>
#include <map>
#include <memory>
#include <string>
#include <utility>
#include <vector>
#include "absl/strings/string_view.h"
#include "api/array_view.h"
#include "api/rtc_event_log/rtc_event.h"
#include "logging/rtc_event_log/events/logged_rtp_rtcp.h"
#include "logging/rtc_event_log/events/rtc_event_field_encoding_parser.h"
#include "modules/rtp_rtcp/source/rtp_packet.h"
namespace webrtc {
@ -61,6 +67,19 @@ class RtcEventRtpPacketOutgoing final : public RtcEvent {
size_t padding_length() const { return packet_.padding_size(); }
int probe_cluster_id() const { return probe_cluster_id_; }
static std::string Encode(rtc::ArrayView<const RtcEvent*> batch) {
// TODO(terelius): Implement
return "";
}
static RtcEventLogParseStatus Parse(
absl::string_view encoded_bytes,
bool batched,
std::map<uint32_t, std::vector<LoggedRtpPacketOutgoing>>& output) {
// TODO(terelius): Implement
return RtcEventLogParseStatus::Error("Not Implemented", __FILE__, __LINE__);
}
private:
RtcEventRtpPacketOutgoing(const RtcEventRtpPacketOutgoing& other);

View File

@ -12,9 +12,13 @@
#define LOGGING_RTC_EVENT_LOG_EVENTS_RTC_EVENT_VIDEO_RECEIVE_STREAM_CONFIG_H_
#include <memory>
#include <string>
#include <vector>
#include "absl/strings/string_view.h"
#include "api/rtc_event_log/rtc_event.h"
#include "api/units/timestamp.h"
#include "logging/rtc_event_log/events/rtc_event_field_encoding_parser.h"
#include "logging/rtc_event_log/rtc_stream_config.h"
namespace webrtc {
@ -46,6 +50,19 @@ class RtcEventVideoReceiveStreamConfig final : public RtcEvent {
const rtclog::StreamConfig& config() const { return *config_; }
static std::string Encode(rtc::ArrayView<const RtcEvent*> batch) {
// TODO(terelius): Implement
return "";
}
static RtcEventLogParseStatus Parse(
absl::string_view encoded_bytes,
bool batched,
std::vector<LoggedVideoRecvConfig>& output) {
// TODO(terelius): Implement
return RtcEventLogParseStatus::Error("Not Implemented", __FILE__, __LINE__);
}
private:
RtcEventVideoReceiveStreamConfig(
const RtcEventVideoReceiveStreamConfig& other);

View File

@ -12,9 +12,13 @@
#define LOGGING_RTC_EVENT_LOG_EVENTS_RTC_EVENT_VIDEO_SEND_STREAM_CONFIG_H_
#include <memory>
#include <string>
#include <vector>
#include "absl/strings/string_view.h"
#include "api/rtc_event_log/rtc_event.h"
#include "api/units/timestamp.h"
#include "logging/rtc_event_log/events/rtc_event_field_encoding_parser.h"
#include "logging/rtc_event_log/rtc_stream_config.h"
namespace webrtc {
@ -46,6 +50,19 @@ class RtcEventVideoSendStreamConfig final : public RtcEvent {
const rtclog::StreamConfig& config() const { return *config_; }
static std::string Encode(rtc::ArrayView<const RtcEvent*> batch) {
// TODO(terelius): Implement
return "";
}
static RtcEventLogParseStatus Parse(
absl::string_view encoded_bytes,
bool batched,
std::vector<LoggedVideoSendConfig>& output) {
// TODO(terelius): Implement
return RtcEventLogParseStatus::Error("Not Implemented", __FILE__, __LINE__);
}
private:
RtcEventVideoSendStreamConfig(const RtcEventVideoSendStreamConfig& other);

View File

@ -1,57 +0,0 @@
/*
* Copyright 2019 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.
*/
#include "logging/rtc_event_log/logged_events.h"
namespace webrtc {
LoggedPacketInfo::LoggedPacketInfo(const LoggedRtpPacket& rtp,
LoggedMediaType media_type,
bool rtx,
Timestamp capture_time)
: ssrc(rtp.header.ssrc),
stream_seq_no(rtp.header.sequenceNumber),
size(static_cast<uint16_t>(rtp.total_length)),
payload_size(static_cast<uint16_t>(rtp.total_length -
rtp.header.paddingLength -
rtp.header.headerLength)),
padding_size(static_cast<uint16_t>(rtp.header.paddingLength)),
payload_type(rtp.header.payloadType),
media_type(media_type),
rtx(rtx),
marker_bit(rtp.header.markerBit),
has_transport_seq_no(rtp.header.extension.hasTransportSequenceNumber),
transport_seq_no(static_cast<uint16_t>(
has_transport_seq_no ? rtp.header.extension.transportSequenceNumber
: 0)),
capture_time(capture_time),
log_packet_time(Timestamp::Micros(rtp.log_time_us())),
reported_send_time(rtp.header.extension.hasAbsoluteSendTime
? rtp.header.extension.GetAbsoluteSendTimestamp()
: Timestamp::MinusInfinity()) {}
LoggedPacketInfo::LoggedPacketInfo(const LoggedPacketInfo&) = default;
LoggedPacketInfo::~LoggedPacketInfo() {}
LoggedRtcpPacket::LoggedRtcpPacket(Timestamp timestamp,
const std::vector<uint8_t>& packet)
: timestamp(timestamp), raw_data(packet) {}
LoggedRtcpPacket::LoggedRtcpPacket(Timestamp timestamp,
const std::string& packet)
: timestamp(timestamp), raw_data(packet.size()) {
memcpy(raw_data.data(), packet.data(), packet.size());
}
LoggedRtcpPacket::LoggedRtcpPacket(const LoggedRtcpPacket& rhs) = default;
LoggedRtcpPacket::~LoggedRtcpPacket() = default;
} // namespace webrtc

View File

@ -7,312 +7,12 @@
* 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_LOGGED_EVENTS_H_
#define LOGGING_RTC_EVENT_LOG_LOGGED_EVENTS_H_
#include <string>
#include <vector>
// TODO(terelius): Delete this forwarding header when downstream
// projects have been updated.
#include "logging/rtc_event_log/events/logged_rtp_rtcp.h"
#include "absl/types/optional.h"
#include "api/rtp_headers.h"
#include "api/units/time_delta.h"
#include "api/units/timestamp.h"
#include "modules/rtp_rtcp/source/rtcp_packet/bye.h"
#include "modules/rtp_rtcp/source/rtcp_packet/extended_reports.h"
#include "modules/rtp_rtcp/source/rtcp_packet/fir.h"
#include "modules/rtp_rtcp/source/rtcp_packet/loss_notification.h"
#include "modules/rtp_rtcp/source/rtcp_packet/nack.h"
#include "modules/rtp_rtcp/source/rtcp_packet/pli.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"
namespace webrtc {
// The different event types are deliberately POD. Analysis of large logs is
// already resource intensive. The code simplifications that would be possible
// possible by having a base class (containing e.g. the log time) are not
// considered to outweigh the added memory and runtime overhead incurred by
// adding a vptr.
struct LoggedRtpPacket {
LoggedRtpPacket(Timestamp timestamp,
RTPHeader header,
size_t header_length,
size_t total_length)
: timestamp(timestamp),
header(header),
header_length(header_length),
total_length(total_length) {}
int64_t log_time_us() const { return timestamp.us(); }
int64_t log_time_ms() const { return timestamp.ms(); }
Timestamp 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 LoggedRtpPacketIncoming {
LoggedRtpPacketIncoming(Timestamp timestamp,
RTPHeader header,
size_t header_length,
size_t total_length)
: rtp(timestamp, header, header_length, total_length) {}
int64_t log_time_us() const { return rtp.timestamp.us(); }
int64_t log_time_ms() const { return rtp.timestamp.ms(); }
LoggedRtpPacket rtp;
};
struct LoggedRtpPacketOutgoing {
LoggedRtpPacketOutgoing(Timestamp timestamp,
RTPHeader header,
size_t header_length,
size_t total_length)
: rtp(timestamp, header, header_length, total_length) {}
int64_t log_time_us() const { return rtp.timestamp.us(); }
int64_t log_time_ms() const { return rtp.timestamp.ms(); }
LoggedRtpPacket rtp;
};
struct LoggedRtcpPacket {
LoggedRtcpPacket(Timestamp timestamp, const std::vector<uint8_t>& packet);
LoggedRtcpPacket(Timestamp timestamp, const std::string& packet);
LoggedRtcpPacket(const LoggedRtcpPacket&);
~LoggedRtcpPacket();
int64_t log_time_us() const { return timestamp.us(); }
int64_t log_time_ms() const { return timestamp.ms(); }
Timestamp timestamp;
std::vector<uint8_t> raw_data;
};
struct LoggedRtcpPacketIncoming {
LoggedRtcpPacketIncoming(Timestamp timestamp,
const std::vector<uint8_t>& packet)
: rtcp(timestamp, packet) {}
LoggedRtcpPacketIncoming(Timestamp timestamp, const std::string& packet)
: rtcp(timestamp, packet) {}
int64_t log_time_us() const { return rtcp.timestamp.us(); }
int64_t log_time_ms() const { return rtcp.timestamp.ms(); }
LoggedRtcpPacket rtcp;
};
struct LoggedRtcpPacketOutgoing {
LoggedRtcpPacketOutgoing(Timestamp timestamp,
const std::vector<uint8_t>& packet)
: rtcp(timestamp, packet) {}
LoggedRtcpPacketOutgoing(Timestamp timestamp, const std::string& packet)
: rtcp(timestamp, packet) {}
int64_t log_time_us() const { return rtcp.timestamp.us(); }
int64_t log_time_ms() const { return rtcp.timestamp.ms(); }
LoggedRtcpPacket rtcp;
};
struct LoggedRtcpPacketReceiverReport {
LoggedRtcpPacketReceiverReport() = default;
LoggedRtcpPacketReceiverReport(Timestamp timestamp,
const rtcp::ReceiverReport& rr)
: timestamp(timestamp), rr(rr) {}
int64_t log_time_us() const { return timestamp.us(); }
int64_t log_time_ms() const { return timestamp.ms(); }
Timestamp timestamp = Timestamp::MinusInfinity();
rtcp::ReceiverReport rr;
};
struct LoggedRtcpPacketSenderReport {
LoggedRtcpPacketSenderReport() = default;
LoggedRtcpPacketSenderReport(Timestamp timestamp,
const rtcp::SenderReport& sr)
: timestamp(timestamp), sr(sr) {}
int64_t log_time_us() const { return timestamp.us(); }
int64_t log_time_ms() const { return timestamp.ms(); }
Timestamp timestamp = Timestamp::MinusInfinity();
rtcp::SenderReport sr;
};
struct LoggedRtcpPacketExtendedReports {
LoggedRtcpPacketExtendedReports() = default;
int64_t log_time_us() const { return timestamp.us(); }
int64_t log_time_ms() const { return timestamp.ms(); }
Timestamp timestamp = Timestamp::MinusInfinity();
rtcp::ExtendedReports xr;
};
struct LoggedRtcpPacketRemb {
LoggedRtcpPacketRemb() = default;
LoggedRtcpPacketRemb(Timestamp timestamp, const rtcp::Remb& remb)
: timestamp(timestamp), remb(remb) {}
int64_t log_time_us() const { return timestamp.us(); }
int64_t log_time_ms() const { return timestamp.ms(); }
Timestamp timestamp = Timestamp::MinusInfinity();
rtcp::Remb remb;
};
struct LoggedRtcpPacketNack {
LoggedRtcpPacketNack() = default;
LoggedRtcpPacketNack(Timestamp timestamp, const rtcp::Nack& nack)
: timestamp(timestamp), nack(nack) {}
int64_t log_time_us() const { return timestamp.us(); }
int64_t log_time_ms() const { return timestamp.ms(); }
Timestamp timestamp = Timestamp::MinusInfinity();
rtcp::Nack nack;
};
struct LoggedRtcpPacketFir {
LoggedRtcpPacketFir() = default;
int64_t log_time_us() const { return timestamp.us(); }
int64_t log_time_ms() const { return timestamp.ms(); }
Timestamp timestamp = Timestamp::MinusInfinity();
rtcp::Fir fir;
};
struct LoggedRtcpPacketPli {
LoggedRtcpPacketPli() = default;
int64_t log_time_us() const { return timestamp.us(); }
int64_t log_time_ms() const { return timestamp.ms(); }
Timestamp timestamp = Timestamp::MinusInfinity();
rtcp::Pli pli;
};
struct LoggedRtcpPacketTransportFeedback {
LoggedRtcpPacketTransportFeedback()
: transport_feedback(/*include_timestamps=*/true, /*include_lost*/ true) {
}
LoggedRtcpPacketTransportFeedback(
Timestamp timestamp,
const rtcp::TransportFeedback& transport_feedback)
: timestamp(timestamp), transport_feedback(transport_feedback) {}
int64_t log_time_us() const { return timestamp.us(); }
int64_t log_time_ms() const { return timestamp.ms(); }
Timestamp timestamp = Timestamp::MinusInfinity();
rtcp::TransportFeedback transport_feedback;
};
struct LoggedRtcpPacketLossNotification {
LoggedRtcpPacketLossNotification() = default;
LoggedRtcpPacketLossNotification(
Timestamp timestamp,
const rtcp::LossNotification& loss_notification)
: timestamp(timestamp), loss_notification(loss_notification) {}
int64_t log_time_us() const { return timestamp.us(); }
int64_t log_time_ms() const { return timestamp.ms(); }
Timestamp timestamp = Timestamp::MinusInfinity();
rtcp::LossNotification loss_notification;
};
struct LoggedRtcpPacketBye {
LoggedRtcpPacketBye() = default;
int64_t log_time_us() const { return timestamp.us(); }
int64_t log_time_ms() const { return timestamp.ms(); }
Timestamp timestamp = Timestamp::MinusInfinity();
rtcp::Bye bye;
};
struct InferredRouteChangeEvent {
int64_t log_time_ms() const { return log_time.ms(); }
int64_t log_time_us() const { return log_time.us(); }
uint32_t route_id;
Timestamp log_time = Timestamp::MinusInfinity();
uint16_t send_overhead;
uint16_t return_overhead;
};
enum class LoggedMediaType : uint8_t { kUnknown, kAudio, kVideo };
struct LoggedPacketInfo {
LoggedPacketInfo(const LoggedRtpPacket& rtp,
LoggedMediaType media_type,
bool rtx,
Timestamp capture_time);
LoggedPacketInfo(const LoggedPacketInfo&);
~LoggedPacketInfo();
int64_t log_time_ms() const { return log_packet_time.ms(); }
int64_t log_time_us() const { return log_packet_time.us(); }
uint32_t ssrc;
uint16_t stream_seq_no;
uint16_t size;
uint16_t payload_size;
uint16_t padding_size;
uint16_t overhead = 0;
uint8_t payload_type;
LoggedMediaType media_type = LoggedMediaType::kUnknown;
bool rtx = false;
bool marker_bit = false;
bool has_transport_seq_no = false;
bool last_in_feedback = false;
uint16_t transport_seq_no = 0;
// The RTP header timestamp unwrapped and converted from tick count to seconds
// based timestamp.
Timestamp capture_time;
// The time the packet was logged. This is the receive time for incoming
// packets and send time for outgoing.
Timestamp log_packet_time;
// Send time as reported by abs-send-time extension, For outgoing packets this
// corresponds to log_packet_time, but might be measured using another clock.
Timestamp reported_send_time;
// The receive time that was reported in feedback. For incoming packets this
// corresponds to log_packet_time, but might be measured using another clock.
// PlusInfinity indicates that the packet was lost.
Timestamp reported_recv_time = Timestamp::MinusInfinity();
// The time feedback message was logged. This is the feedback send time for
// incoming packets and feedback receive time for outgoing.
// PlusInfinity indicates that feedback was expected but not received.
Timestamp log_feedback_time = Timestamp::MinusInfinity();
// The delay betweeen receiving an RTP packet and sending feedback for
// incoming packets. For outgoing packets we don't know the feedback send
// time, and this is instead calculated as the difference in reported receive
// time between this packet and the last packet in the same feedback message.
TimeDelta feedback_hold_duration = TimeDelta::MinusInfinity();
};
enum class LoggedIceEventType {
kAdded,
kUpdated,
kDestroyed,
kSelected,
kCheckSent,
kCheckReceived,
kCheckResponseSent,
kCheckResponseReceived,
};
struct LoggedIceEvent {
uint32_t candidate_pair_id;
Timestamp log_time;
LoggedIceEventType event_type;
};
} // namespace webrtc
#endif // LOGGING_RTC_EVENT_LOG_LOGGED_EVENTS_H_

View File

@ -28,6 +28,7 @@
#include "logging/rtc_event_log/encoder/delta_encoding.h"
#include "logging/rtc_event_log/encoder/rtc_event_log_encoder_common.h"
#include "logging/rtc_event_log/encoder/var_int.h"
#include "logging/rtc_event_log/events/logged_rtp_rtcp.h"
#include "logging/rtc_event_log/rtc_event_processor.h"
#include "modules/audio_coding/audio_network_adaptor/include/audio_network_adaptor.h"
#include "modules/include/module_common_types_public.h"
@ -951,6 +952,35 @@ std::vector<RtpExtension> GetRuntimeRtpHeaderExtensionConfig(
}
// End of conversion functions.
LoggedPacketInfo::LoggedPacketInfo(const LoggedRtpPacket& rtp,
LoggedMediaType media_type,
bool rtx,
Timestamp capture_time)
: ssrc(rtp.header.ssrc),
stream_seq_no(rtp.header.sequenceNumber),
size(static_cast<uint16_t>(rtp.total_length)),
payload_size(static_cast<uint16_t>(rtp.total_length -
rtp.header.paddingLength -
rtp.header.headerLength)),
padding_size(static_cast<uint16_t>(rtp.header.paddingLength)),
payload_type(rtp.header.payloadType),
media_type(media_type),
rtx(rtx),
marker_bit(rtp.header.markerBit),
has_transport_seq_no(rtp.header.extension.hasTransportSequenceNumber),
transport_seq_no(static_cast<uint16_t>(
has_transport_seq_no ? rtp.header.extension.transportSequenceNumber
: 0)),
capture_time(capture_time),
log_packet_time(Timestamp::Micros(rtp.log_time_us())),
reported_send_time(rtp.header.extension.hasAbsoluteSendTime
? rtp.header.extension.GetAbsoluteSendTimestamp()
: Timestamp::MinusInfinity()) {}
LoggedPacketInfo::LoggedPacketInfo(const LoggedPacketInfo&) = default;
LoggedPacketInfo::~LoggedPacketInfo() {}
ParsedRtcEventLog::~ParsedRtcEventLog() = default;
ParsedRtcEventLog::LoggedRtpStreamIncoming::LoggedRtpStreamIncoming() = default;
@ -1433,6 +1463,96 @@ ParsedRtcEventLog::ParseStatus ParsedRtcEventLog::ParseStreamInternalV3(
RtcEventBweUpdateDelayBased::Parse(event_fields, batched,
bwe_delay_updates_);
break;
case static_cast<uint32_t>(RtcEvent::Type::AudioNetworkAdaptation):
RtcEventAudioNetworkAdaptation::Parse(event_fields, batched,
audio_network_adaptation_events_);
break;
case static_cast<uint32_t>(RtcEvent::Type::AudioReceiveStreamConfig):
RtcEventAudioReceiveStreamConfig::Parse(event_fields, batched,
audio_recv_configs_);
break;
case static_cast<uint32_t>(RtcEvent::Type::AudioSendStreamConfig):
RtcEventAudioSendStreamConfig::Parse(event_fields, batched,
audio_send_configs_);
break;
case static_cast<uint32_t>(RtcEvent::Type::BweUpdateLossBased):
RtcEventBweUpdateLossBased::Parse(event_fields, batched,
bwe_loss_updates_);
break;
case static_cast<uint32_t>(RtcEvent::Type::DtlsTransportState):
RtcEventDtlsTransportState::Parse(event_fields, batched,
dtls_transport_states_);
break;
case static_cast<uint32_t>(RtcEvent::Type::DtlsWritableState):
RtcEventDtlsWritableState::Parse(event_fields, batched,
dtls_writable_states_);
break;
case static_cast<uint32_t>(RtcEvent::Type::FrameDecoded):
RtcEventFrameDecoded::Parse(event_fields, batched, decoded_frames_);
break;
case static_cast<uint32_t>(RtcEvent::Type::GenericAckReceived):
RtcEventGenericAckReceived::Parse(event_fields, batched,
generic_acks_received_);
break;
case static_cast<uint32_t>(RtcEvent::Type::GenericPacketReceived):
RtcEventGenericPacketReceived::Parse(event_fields, batched,
generic_packets_received_);
break;
case static_cast<uint32_t>(RtcEvent::Type::GenericPacketSent):
RtcEventGenericPacketSent::Parse(event_fields, batched,
generic_packets_sent_);
break;
case static_cast<uint32_t>(RtcEvent::Type::IceCandidatePairConfig):
RtcEventIceCandidatePairConfig::Parse(event_fields, batched,
ice_candidate_pair_configs_);
break;
case static_cast<uint32_t>(RtcEvent::Type::IceCandidatePairEvent):
RtcEventIceCandidatePair::Parse(event_fields, batched,
ice_candidate_pair_events_);
break;
case static_cast<uint32_t>(RtcEvent::Type::ProbeClusterCreated):
RtcEventProbeClusterCreated::Parse(event_fields, batched,
bwe_probe_cluster_created_events_);
break;
case static_cast<uint32_t>(RtcEvent::Type::ProbeResultFailure):
RtcEventProbeResultFailure::Parse(event_fields, batched,
bwe_probe_failure_events_);
break;
case static_cast<uint32_t>(RtcEvent::Type::ProbeResultSuccess):
RtcEventProbeResultSuccess::Parse(event_fields, batched,
bwe_probe_success_events_);
break;
case static_cast<uint32_t>(RtcEvent::Type::RemoteEstimateEvent):
RtcEventRemoteEstimate::Parse(event_fields, batched,
remote_estimate_events_);
break;
case static_cast<uint32_t>(RtcEvent::Type::RouteChangeEvent):
RtcEventRouteChange::Parse(event_fields, batched, route_change_events_);
break;
case static_cast<uint32_t>(RtcEvent::Type::RtcpPacketIncoming):
RtcEventRtcpPacketIncoming::Parse(event_fields, batched,
incoming_rtcp_packets_);
break;
case static_cast<uint32_t>(RtcEvent::Type::RtcpPacketOutgoing):
RtcEventRtcpPacketOutgoing::Parse(event_fields, batched,
outgoing_rtcp_packets_);
break;
case static_cast<uint32_t>(RtcEvent::Type::RtpPacketIncoming):
RtcEventRtpPacketIncoming::Parse(event_fields, batched,
incoming_rtp_packets_map_);
break;
case static_cast<uint32_t>(RtcEvent::Type::RtpPacketOutgoing):
RtcEventRtpPacketOutgoing::Parse(event_fields, batched,
outgoing_rtp_packets_map_);
break;
case static_cast<uint32_t>(RtcEvent::Type::VideoReceiveStreamConfig):
RtcEventVideoReceiveStreamConfig::Parse(event_fields, batched,
video_recv_configs_);
break;
case static_cast<uint32_t>(RtcEvent::Type::VideoSendStreamConfig):
RtcEventVideoSendStreamConfig::Parse(event_fields, batched,
video_send_configs_);
break;
}
}

View File

@ -21,6 +21,7 @@
#include "api/rtc_event_log/rtc_event_log.h"
#include "call/video_receive_stream.h"
#include "call/video_send_stream.h"
#include "logging/rtc_event_log/events/logged_rtp_rtcp.h"
#include "logging/rtc_event_log/events/rtc_event_alr_state.h"
#include "logging/rtc_event_log/events/rtc_event_audio_network_adaptation.h"
#include "logging/rtc_event_log/events/rtc_event_audio_playout.h"
@ -43,9 +44,12 @@
#include "logging/rtc_event_log/events/rtc_event_probe_result_success.h"
#include "logging/rtc_event_log/events/rtc_event_remote_estimate.h"
#include "logging/rtc_event_log/events/rtc_event_route_change.h"
#include "logging/rtc_event_log/events/rtc_event_rtcp_packet_incoming.h"
#include "logging/rtc_event_log/events/rtc_event_rtcp_packet_outgoing.h"
#include "logging/rtc_event_log/events/rtc_event_rtp_packet_incoming.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_send_stream_config.h"
#include "logging/rtc_event_log/logged_events.h"
#include "modules/rtp_rtcp/include/rtp_header_extension_map.h"
#include "modules/rtp_rtcp/source/rtcp_packet/common_header.h"
#include "rtc_base/ignore_wundef.h"
@ -65,6 +69,80 @@ namespace webrtc {
enum PacketDirection { kIncomingPacket = 0, kOutgoingPacket };
enum class LoggedMediaType : uint8_t { kUnknown, kAudio, kVideo };
struct LoggedPacketInfo {
LoggedPacketInfo(const LoggedRtpPacket& rtp,
LoggedMediaType media_type,
bool rtx,
Timestamp capture_time);
LoggedPacketInfo(const LoggedPacketInfo&);
~LoggedPacketInfo();
int64_t log_time_ms() const { return log_packet_time.ms(); }
int64_t log_time_us() const { return log_packet_time.us(); }
uint32_t ssrc;
uint16_t stream_seq_no;
uint16_t size;
uint16_t payload_size;
uint16_t padding_size;
uint16_t overhead = 0;
uint8_t payload_type;
LoggedMediaType media_type = LoggedMediaType::kUnknown;
bool rtx = false;
bool marker_bit = false;
bool has_transport_seq_no = false;
bool last_in_feedback = false;
uint16_t transport_seq_no = 0;
// The RTP header timestamp unwrapped and converted from tick count to seconds
// based timestamp.
Timestamp capture_time;
// The time the packet was logged. This is the receive time for incoming
// packets and send time for outgoing.
Timestamp log_packet_time;
// Send time as reported by abs-send-time extension, For outgoing packets this
// corresponds to log_packet_time, but might be measured using another clock.
Timestamp reported_send_time;
// The receive time that was reported in feedback. For incoming packets this
// corresponds to log_packet_time, but might be measured using another clock.
// PlusInfinity indicates that the packet was lost.
Timestamp reported_recv_time = Timestamp::MinusInfinity();
// The time feedback message was logged. This is the feedback send time for
// incoming packets and feedback receive time for outgoing.
// PlusInfinity indicates that feedback was expected but not received.
Timestamp log_feedback_time = Timestamp::MinusInfinity();
// The delay betweeen receiving an RTP packet and sending feedback for
// incoming packets. For outgoing packets we don't know the feedback send
// time, and this is instead calculated as the difference in reported receive
// time between this packet and the last packet in the same feedback message.
TimeDelta feedback_hold_duration = TimeDelta::MinusInfinity();
};
struct InferredRouteChangeEvent {
int64_t log_time_ms() const { return log_time.ms(); }
int64_t log_time_us() const { return log_time.us(); }
uint32_t route_id;
Timestamp log_time = Timestamp::MinusInfinity();
uint16_t send_overhead;
uint16_t return_overhead;
};
enum class LoggedIceEventType {
kAdded,
kUpdated,
kDestroyed,
kSelected,
kCheckSent,
kCheckReceived,
kCheckResponseSent,
kCheckResponseReceived,
};
struct LoggedIceEvent {
uint32_t candidate_pair_id;
Timestamp log_time;
LoggedIceEventType event_type;
};
// This class is used to process lists of LoggedRtpPacketIncoming
// and LoggedRtpPacketOutgoing without duplicating the code.
// TODO(terelius): Remove this class. Instead use e.g. a vector of pointers