#include "logging/rtc_event_log/encoder/rtc_event_log_encoder_legacy.h"
#include <string.h>
#include <cstdint>
#include <deque>
#include <memory>
#include <string>
#include <vector>
#include "absl/types/optional.h"
#include "api/array_view.h"
#include "api/candidate.h"
#include "api/rtc_event_log/rtc_event.h"
#include "api/rtp_headers.h"
#include "api/rtp_parameters.h"
#include "api/transport/bandwidth_usage.h"
#include "api/transport/network_types.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"
#include "logging/rtc_event_log/events/rtc_event_audio_receive_stream_config.h"
#include "logging/rtc_event_log/events/rtc_event_audio_send_stream_config.h"
#include "logging/rtc_event_log/events/rtc_event_bwe_update_delay_based.h"
#include "logging/rtc_event_log/events/rtc_event_bwe_update_loss_based.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_cluster_created.h"
#include "logging/rtc_event_log/events/rtc_event_probe_result_failure.h"
#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_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/rtc_stream_config.h"
#include "modules/audio_coding/audio_network_adaptor/include/audio_network_adaptor_config.h"
#include "modules/rtp_rtcp/source/rtcp_packet/app.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/extended_reports.h"
#include "modules/rtp_rtcp/source/rtcp_packet/psfb.h"
#include "modules/rtp_rtcp/source/rtcp_packet/receiver_report.h"
#include "modules/rtp_rtcp/source/rtcp_packet/rtpfb.h"
#include "modules/rtp_rtcp/source/rtcp_packet/sdes.h"
#include "modules/rtp_rtcp/source/rtcp_packet/sender_report.h"
#include "rtc_base/buffer.h"
#include "rtc_base/checks.h"
#include "rtc_base/logging.h"
#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
namespace webrtc {
namespace {
rtclog::DelayBasedBweUpdate::DetectorState ConvertDetectorState(
BandwidthUsage state) { … }
rtclog::BweProbeResult::ResultType ConvertProbeResultType(
ProbeFailureReason failure_reason) { … }
rtclog::VideoReceiveConfig_RtcpMode ConvertRtcpMode(RtcpMode rtcp_mode) { … }
rtclog::IceCandidatePairConfig::IceCandidatePairConfigType
ConvertIceCandidatePairConfigType(IceCandidatePairConfigType type) { … }
rtclog::IceCandidatePairConfig::IceCandidateType ConvertIceCandidateType(
IceCandidateType type) { … }
rtclog::IceCandidatePairConfig::Protocol ConvertIceCandidatePairProtocol(
IceCandidatePairProtocol protocol) { … }
rtclog::IceCandidatePairConfig::AddressFamily
ConvertIceCandidatePairAddressFamily(
IceCandidatePairAddressFamily address_family) { … }
rtclog::IceCandidatePairConfig::NetworkType ConvertIceCandidateNetworkType(
IceCandidateNetworkType network_type) { … }
rtclog::IceCandidatePairEvent::IceCandidatePairEventType
ConvertIceCandidatePairEventType(IceCandidatePairEventType type) { … }
}
std::string RtcEventLogEncoderLegacy::EncodeLogStart(int64_t timestamp_us,
int64_t utc_time_us) { … }
std::string RtcEventLogEncoderLegacy::EncodeLogEnd(int64_t timestamp_us) { … }
std::string RtcEventLogEncoderLegacy::EncodeBatch(
std::deque<std::unique_ptr<RtcEvent>>::const_iterator begin,
std::deque<std::unique_ptr<RtcEvent>>::const_iterator end) { … }
std::string RtcEventLogEncoderLegacy::Encode(const RtcEvent& event) { … }
std::string RtcEventLogEncoderLegacy::EncodeAlrState(
const RtcEventAlrState& event) { … }
std::string RtcEventLogEncoderLegacy::EncodeAudioNetworkAdaptation(
const RtcEventAudioNetworkAdaptation& event) { … }
std::string RtcEventLogEncoderLegacy::EncodeAudioPlayout(
const RtcEventAudioPlayout& event) { … }
std::string RtcEventLogEncoderLegacy::EncodeAudioReceiveStreamConfig(
const RtcEventAudioReceiveStreamConfig& event) { … }
std::string RtcEventLogEncoderLegacy::EncodeAudioSendStreamConfig(
const RtcEventAudioSendStreamConfig& event) { … }
std::string RtcEventLogEncoderLegacy::EncodeBweUpdateDelayBased(
const RtcEventBweUpdateDelayBased& event) { … }
std::string RtcEventLogEncoderLegacy::EncodeBweUpdateLossBased(
const RtcEventBweUpdateLossBased& event) { … }
std::string RtcEventLogEncoderLegacy::EncodeIceCandidatePairConfig(
const RtcEventIceCandidatePairConfig& event) { … }
std::string RtcEventLogEncoderLegacy::EncodeIceCandidatePairEvent(
const RtcEventIceCandidatePair& event) { … }
std::string RtcEventLogEncoderLegacy::EncodeProbeClusterCreated(
const RtcEventProbeClusterCreated& event) { … }
std::string RtcEventLogEncoderLegacy::EncodeProbeResultFailure(
const RtcEventProbeResultFailure& event) { … }
std::string RtcEventLogEncoderLegacy::EncodeProbeResultSuccess(
const RtcEventProbeResultSuccess& event) { … }
std::string RtcEventLogEncoderLegacy::EncodeRemoteEstimate(
const RtcEventRemoteEstimate& event) { … }
std::string RtcEventLogEncoderLegacy::EncodeRtcpPacketIncoming(
const RtcEventRtcpPacketIncoming& event) { … }
std::string RtcEventLogEncoderLegacy::EncodeRtcpPacketOutgoing(
const RtcEventRtcpPacketOutgoing& event) { … }
std::string RtcEventLogEncoderLegacy::EncodeRtpPacketIncoming(
const RtcEventRtpPacketIncoming& event) { … }
std::string RtcEventLogEncoderLegacy::EncodeRtpPacketOutgoing(
const RtcEventRtpPacketOutgoing& event) { … }
std::string RtcEventLogEncoderLegacy::EncodeVideoReceiveStreamConfig(
const RtcEventVideoReceiveStreamConfig& event) { … }
std::string RtcEventLogEncoderLegacy::EncodeVideoSendStreamConfig(
const RtcEventVideoSendStreamConfig& event) { … }
std::string RtcEventLogEncoderLegacy::EncodeRtcpPacket(
int64_t timestamp_us,
const rtc::Buffer& packet,
bool is_incoming) { … }
std::string RtcEventLogEncoderLegacy::EncodeRtpPacket(
int64_t timestamp_us,
rtc::ArrayView<const uint8_t> header,
size_t packet_length,
int probe_cluster_id,
bool is_incoming) { … }
std::string RtcEventLogEncoderLegacy::Serialize(rtclog::Event* event) { … }
}