Replace ArrayView with std::span in logging/
Search&Replace MakeArrayView and ArrayView with std::span Search&Replace include "api/array_view.h" with include <span> Remove build dependencies on array_view target Bug: webrtc:439801349 Change-Id: I9bdaea50fd34abff83cc7571a7fadc55a940df1d Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/455500 Reviewed-by: Harald Alvestrand <hta@webrtc.org> Auto-Submit: Danil Chapovalov <danilchap@webrtc.org> Commit-Queue: Harald Alvestrand <hta@webrtc.org> Cr-Commit-Position: refs/heads/main@{#47112}
This commit is contained in:
parent
8281b933c9
commit
c4e1adff96
@ -58,7 +58,6 @@ rtc_library("rtc_event_field") {
|
||||
deps = [
|
||||
":rtc_event_log_parse_status",
|
||||
":rtc_event_number_encodings",
|
||||
"../api:array_view",
|
||||
"../api/rtc_event_log",
|
||||
"../api/units:timestamp",
|
||||
"../rtc_base:bitstream_reader",
|
||||
@ -92,7 +91,6 @@ rtc_library("rtc_event_pacing") {
|
||||
deps = [
|
||||
":rtc_event_field",
|
||||
":rtc_event_log_parse_status",
|
||||
"../api:array_view",
|
||||
"../api/rtc_event_log",
|
||||
"../api/units:timestamp",
|
||||
"//third_party/abseil-cpp/absl/memory",
|
||||
@ -119,7 +117,6 @@ rtc_library("rtc_event_audio") {
|
||||
":rtc_event_field",
|
||||
":rtc_event_log_parse_status",
|
||||
":rtc_stream_config",
|
||||
"../api:array_view",
|
||||
"../api/rtc_event_log",
|
||||
"../api/units:timestamp",
|
||||
"../modules/audio_coding:audio_network_adaptor_config",
|
||||
@ -140,7 +137,6 @@ rtc_library("rtc_event_begin_end") {
|
||||
deps = [
|
||||
":rtc_event_field",
|
||||
":rtc_event_log_parse_status",
|
||||
"../api:array_view",
|
||||
"../api/rtc_event_log",
|
||||
"../api/units:timestamp",
|
||||
"//third_party/abseil-cpp/absl/strings:string_view",
|
||||
@ -168,7 +164,6 @@ rtc_library("rtc_event_bwe") {
|
||||
deps = [
|
||||
":rtc_event_field",
|
||||
":rtc_event_log_parse_status",
|
||||
"../api:array_view",
|
||||
"../api/rtc_event_log",
|
||||
"../api/transport:bandwidth_usage",
|
||||
"../api/units:data_rate",
|
||||
@ -188,7 +183,6 @@ rtc_library("rtc_event_bwe_update_scream") {
|
||||
|
||||
deps = [
|
||||
":rtc_event_log_parse_status",
|
||||
"../api:array_view",
|
||||
"../api/rtc_event_log",
|
||||
"../api/units:data_rate",
|
||||
"../api/units:data_size",
|
||||
@ -209,7 +203,6 @@ rtc_library("rtc_event_frame_events") {
|
||||
deps = [
|
||||
":rtc_event_field",
|
||||
":rtc_event_log_parse_status",
|
||||
"../api:array_view",
|
||||
"../api/rtc_event_log",
|
||||
"../api/units:timestamp",
|
||||
"../api/video:video_frame",
|
||||
@ -236,7 +229,6 @@ rtc_library("rtc_event_rtp_rtcp") {
|
||||
deps = [
|
||||
":rtc_event_field",
|
||||
":rtc_event_log_parse_status",
|
||||
"../api:array_view",
|
||||
"../api:rtp_headers",
|
||||
"../api/rtc_event_log",
|
||||
"../api/units:timestamp",
|
||||
@ -261,7 +253,6 @@ rtc_library("rtc_event_video") {
|
||||
":rtc_event_field",
|
||||
":rtc_event_log_parse_status",
|
||||
":rtc_stream_config",
|
||||
"../api:array_view",
|
||||
"../api/rtc_event_log",
|
||||
"../api/units:timestamp",
|
||||
"../rtc_base:checks",
|
||||
@ -373,7 +364,6 @@ rtc_library("rtc_event_log_impl_encoder") {
|
||||
":rtc_event_rtp_rtcp",
|
||||
":rtc_event_video",
|
||||
":rtc_stream_config",
|
||||
"../api:array_view",
|
||||
"../api:candidate",
|
||||
"../api:dtls_transport_interface",
|
||||
"../api/rtc_event_log",
|
||||
@ -407,7 +397,6 @@ if (rtc_enable_protobuf) {
|
||||
":rtc_event_log_optional_blob_encoding",
|
||||
":rtc_event_log_parse_status",
|
||||
":rtc_event_log_proto", # Why does this need to be included here?
|
||||
"../api:array_view",
|
||||
"../rtc_base:bitstream_reader",
|
||||
"../rtc_base:checks",
|
||||
"../rtc_base:logging",
|
||||
@ -598,7 +587,6 @@ if (rtc_enable_protobuf) {
|
||||
":rtc_event_rtp_rtcp",
|
||||
":rtc_event_video",
|
||||
":rtc_stream_config",
|
||||
"../api:array_view",
|
||||
"../api:candidate",
|
||||
"../api:dtls_transport_interface",
|
||||
"../api:field_trials",
|
||||
@ -650,7 +638,6 @@ if (rtc_enable_protobuf) {
|
||||
deps = [
|
||||
":rtc_event_log_parser",
|
||||
":rtc_event_rtp_rtcp",
|
||||
"../api:array_view",
|
||||
"../api:rtp_headers",
|
||||
"../api/rtc_event_log",
|
||||
"../modules/rtp_rtcp",
|
||||
@ -688,7 +675,6 @@ rtc_library("ice_log") {
|
||||
deps = [
|
||||
":rtc_event_field",
|
||||
":rtc_event_log_parse_status",
|
||||
"../api:array_view",
|
||||
"../api:candidate",
|
||||
"../api:dtls_transport_interface",
|
||||
"../api:libjingle_logging_api",
|
||||
|
||||
@ -13,11 +13,11 @@
|
||||
#include <cstddef>
|
||||
#include <cstdint>
|
||||
#include <optional>
|
||||
#include <span>
|
||||
#include <string>
|
||||
#include <vector>
|
||||
|
||||
#include "absl/strings/string_view.h"
|
||||
#include "api/array_view.h"
|
||||
#include "logging/rtc_event_log/encoder/delta_encoding.h"
|
||||
#include "logging/rtc_event_log/encoder/optional_blob_encoding.h"
|
||||
#include "logging/rtc_event_log/events/rtc_event_log_parse_status.h"
|
||||
@ -30,7 +30,7 @@ namespace webrtc {
|
||||
// static
|
||||
std::optional<rtclog2::DependencyDescriptorsWireInfo>
|
||||
RtcEventLogDependencyDescriptorEncoderDecoder::Encode(
|
||||
const std::vector<ArrayView<const uint8_t>>& raw_dd_data) {
|
||||
const std::vector<std::span<const uint8_t>>& raw_dd_data) {
|
||||
if (raw_dd_data.empty()) {
|
||||
return {};
|
||||
}
|
||||
@ -43,9 +43,8 @@ RtcEventLogDependencyDescriptorEncoderDecoder::Encode(
|
||||
}
|
||||
|
||||
rtclog2::DependencyDescriptorsWireInfo res;
|
||||
const ArrayView<const uint8_t>& base_dd = raw_dd_data[0];
|
||||
auto delta_dds =
|
||||
MakeArrayView(raw_dd_data.data(), raw_dd_data.size()).subspan(1);
|
||||
const std::span<const uint8_t>& base_dd = raw_dd_data[0];
|
||||
auto delta_dds = std::span(raw_dd_data.data(), raw_dd_data.size()).subspan(1);
|
||||
|
||||
// Start and end bit.
|
||||
{
|
||||
|
||||
@ -14,9 +14,9 @@
|
||||
#include <cstddef>
|
||||
#include <cstdint>
|
||||
#include <optional>
|
||||
#include <span>
|
||||
#include <vector>
|
||||
|
||||
#include "api/array_view.h"
|
||||
#include "logging/rtc_event_log/events/rtc_event_log_parse_status.h"
|
||||
#include "logging/rtc_event_log/rtc_event_log2_proto_include.h" // IWYU pragma: keep
|
||||
|
||||
@ -25,7 +25,7 @@ namespace webrtc {
|
||||
class RtcEventLogDependencyDescriptorEncoderDecoder {
|
||||
public:
|
||||
static std::optional<rtclog2::DependencyDescriptorsWireInfo> Encode(
|
||||
const std::vector<ArrayView<const uint8_t>>& raw_dd_data);
|
||||
const std::vector<std::span<const uint8_t>>& raw_dd_data);
|
||||
static RtcEventLogParseStatusOr<std::vector<std::vector<uint8_t>>> Decode(
|
||||
const rtclog2::DependencyDescriptorsWireInfo& dd_wire_info,
|
||||
size_t num_packets);
|
||||
|
||||
@ -15,10 +15,10 @@
|
||||
#include <deque>
|
||||
#include <memory>
|
||||
#include <optional>
|
||||
#include <span>
|
||||
#include <string>
|
||||
#include <vector>
|
||||
|
||||
#include "api/array_view.h"
|
||||
#include "api/candidate.h"
|
||||
#include "api/rtc_event_log/rtc_event.h"
|
||||
#include "api/rtp_headers.h"
|
||||
@ -753,7 +753,7 @@ std::string RtcEventLogEncoderLegacy::EncodeRtcpPacket(int64_t timestamp_us,
|
||||
|
||||
std::string RtcEventLogEncoderLegacy::EncodeRtpPacket(
|
||||
int64_t timestamp_us,
|
||||
ArrayView<const uint8_t> header,
|
||||
std::span<const uint8_t> header,
|
||||
size_t packet_length,
|
||||
int probe_cluster_id,
|
||||
bool is_incoming) {
|
||||
|
||||
@ -15,9 +15,9 @@
|
||||
#include <cstdint>
|
||||
#include <deque>
|
||||
#include <memory>
|
||||
#include <span>
|
||||
#include <string>
|
||||
|
||||
#include "api/array_view.h"
|
||||
#include "api/rtc_event_log/rtc_event.h"
|
||||
#include "logging/rtc_event_log/encoder/rtc_event_log_encoder.h"
|
||||
#include "rtc_base/buffer.h"
|
||||
@ -100,7 +100,7 @@ class RtcEventLogEncoderLegacy final : public RtcEventLogEncoder {
|
||||
const Buffer& packet,
|
||||
bool is_incoming);
|
||||
std::string EncodeRtpPacket(int64_t timestamp_us,
|
||||
ArrayView<const uint8_t> header,
|
||||
std::span<const uint8_t> header,
|
||||
size_t packet_length,
|
||||
int probe_cluster_id,
|
||||
bool is_incoming);
|
||||
|
||||
@ -17,11 +17,11 @@
|
||||
#include <map>
|
||||
#include <memory>
|
||||
#include <optional>
|
||||
#include <span>
|
||||
#include <string>
|
||||
#include <type_traits>
|
||||
#include <vector>
|
||||
|
||||
#include "api/array_view.h"
|
||||
#include "api/candidate.h"
|
||||
#include "api/dtls_transport_interface.h"
|
||||
#include "api/field_trials_view.h"
|
||||
@ -340,7 +340,7 @@ size_t RemoveNonAllowlistedRtcpBlocks(const Buffer& packet, uint8_t* buffer) {
|
||||
}
|
||||
|
||||
template <typename EventType, typename ProtoType>
|
||||
void EncodeRtcpPacket(ArrayView<const EventType*> batch,
|
||||
void EncodeRtcpPacket(std::span<const EventType*> batch,
|
||||
ProtoType* proto_batch) {
|
||||
if (batch.empty()) {
|
||||
return;
|
||||
@ -468,7 +468,7 @@ void RtcEventLogEncoderNewFormat::EncodeRtpPacket(const Batch& batch,
|
||||
// TODO(webrtc:14975) Remove this kill switch after DD in RTC event log has
|
||||
// been rolled out.
|
||||
if (encode_dependency_descriptor_) {
|
||||
std::vector<ArrayView<const uint8_t>> raw_dds(batch.size());
|
||||
std::vector<std::span<const uint8_t>> raw_dds(batch.size());
|
||||
bool has_dd = false;
|
||||
for (size_t i = 0; i < batch.size(); ++i) {
|
||||
raw_dds[i] =
|
||||
@ -973,7 +973,7 @@ std::string RtcEventLogEncoderNewFormat::EncodeBatch(
|
||||
}
|
||||
|
||||
void RtcEventLogEncoderNewFormat::EncodeAlrState(
|
||||
ArrayView<const RtcEventAlrState*> batch,
|
||||
std::span<const RtcEventAlrState*> batch,
|
||||
rtclog2::EventStream* event_stream) {
|
||||
for (const RtcEventAlrState* base_event : batch) {
|
||||
rtclog2::AlrState* proto_batch = event_stream->add_alr_states();
|
||||
@ -984,7 +984,7 @@ void RtcEventLogEncoderNewFormat::EncodeAlrState(
|
||||
}
|
||||
|
||||
void RtcEventLogEncoderNewFormat::EncodeAudioNetworkAdaptation(
|
||||
ArrayView<const RtcEventAudioNetworkAdaptation*> batch,
|
||||
std::span<const RtcEventAudioNetworkAdaptation*> batch,
|
||||
rtclog2::EventStream* event_stream) {
|
||||
if (batch.empty())
|
||||
return;
|
||||
@ -1135,7 +1135,7 @@ void RtcEventLogEncoderNewFormat::EncodeAudioNetworkAdaptation(
|
||||
}
|
||||
|
||||
void RtcEventLogEncoderNewFormat::EncodeAudioPlayout(
|
||||
ArrayView<const RtcEventAudioPlayout*> batch,
|
||||
std::span<const RtcEventAudioPlayout*> batch,
|
||||
rtclog2::EventStream* event_stream) {
|
||||
if (batch.empty())
|
||||
return;
|
||||
@ -1177,7 +1177,7 @@ void RtcEventLogEncoderNewFormat::EncodeAudioPlayout(
|
||||
}
|
||||
|
||||
void RtcEventLogEncoderNewFormat::EncodeNetEqSetMinimumDelay(
|
||||
ArrayView<const RtcEventNetEqSetMinimumDelay*> batch,
|
||||
std::span<const RtcEventNetEqSetMinimumDelay*> batch,
|
||||
rtclog2::EventStream* event_stream) {
|
||||
if (encode_neteq_set_minimum_delay_kill_switch_) {
|
||||
return;
|
||||
@ -1235,7 +1235,7 @@ void RtcEventLogEncoderNewFormat::EncodeNetEqSetMinimumDelay(
|
||||
}
|
||||
|
||||
void RtcEventLogEncoderNewFormat::EncodeAudioRecvStreamConfig(
|
||||
ArrayView<const RtcEventAudioReceiveStreamConfig*> batch,
|
||||
std::span<const RtcEventAudioReceiveStreamConfig*> batch,
|
||||
rtclog2::EventStream* event_stream) {
|
||||
for (const RtcEventAudioReceiveStreamConfig* base_event : batch) {
|
||||
rtclog2::AudioRecvStreamConfig* proto_batch =
|
||||
@ -1254,7 +1254,7 @@ void RtcEventLogEncoderNewFormat::EncodeAudioRecvStreamConfig(
|
||||
}
|
||||
|
||||
void RtcEventLogEncoderNewFormat::EncodeAudioSendStreamConfig(
|
||||
ArrayView<const RtcEventAudioSendStreamConfig*> batch,
|
||||
std::span<const RtcEventAudioSendStreamConfig*> batch,
|
||||
rtclog2::EventStream* event_stream) {
|
||||
for (const RtcEventAudioSendStreamConfig* base_event : batch) {
|
||||
rtclog2::AudioSendStreamConfig* proto_batch =
|
||||
@ -1272,7 +1272,7 @@ void RtcEventLogEncoderNewFormat::EncodeAudioSendStreamConfig(
|
||||
}
|
||||
|
||||
void RtcEventLogEncoderNewFormat::EncodeBweUpdateDelayBased(
|
||||
ArrayView<const RtcEventBweUpdateDelayBased*> batch,
|
||||
std::span<const RtcEventBweUpdateDelayBased*> batch,
|
||||
rtclog2::EventStream* event_stream) {
|
||||
if (batch.empty())
|
||||
return;
|
||||
@ -1329,7 +1329,7 @@ void RtcEventLogEncoderNewFormat::EncodeBweUpdateDelayBased(
|
||||
}
|
||||
|
||||
void RtcEventLogEncoderNewFormat::EncodeBweUpdateLossBased(
|
||||
ArrayView<const RtcEventBweUpdateLossBased*> batch,
|
||||
std::span<const RtcEventBweUpdateLossBased*> batch,
|
||||
rtclog2::EventStream* event_stream) {
|
||||
if (batch.empty())
|
||||
return;
|
||||
@ -1393,7 +1393,7 @@ void RtcEventLogEncoderNewFormat::EncodeBweUpdateLossBased(
|
||||
}
|
||||
|
||||
void RtcEventLogEncoderNewFormat::EncodeBweUpdateScream(
|
||||
ArrayView<const RtcEventBweUpdateScream*> batch,
|
||||
std::span<const RtcEventBweUpdateScream*> batch,
|
||||
rtclog2::EventStream* event_stream) {
|
||||
if (batch.empty())
|
||||
return;
|
||||
@ -1490,7 +1490,7 @@ void RtcEventLogEncoderNewFormat::EncodeBweUpdateScream(
|
||||
}
|
||||
|
||||
void RtcEventLogEncoderNewFormat::EncodeDtlsTransportState(
|
||||
ArrayView<const RtcEventDtlsTransportState*> batch,
|
||||
std::span<const RtcEventDtlsTransportState*> batch,
|
||||
rtclog2::EventStream* event_stream) {
|
||||
for (const RtcEventDtlsTransportState* base_event : batch) {
|
||||
rtclog2::DtlsTransportStateEvent* proto_batch =
|
||||
@ -1502,7 +1502,7 @@ void RtcEventLogEncoderNewFormat::EncodeDtlsTransportState(
|
||||
}
|
||||
|
||||
void RtcEventLogEncoderNewFormat::EncodeDtlsWritableState(
|
||||
ArrayView<const RtcEventDtlsWritableState*> batch,
|
||||
std::span<const RtcEventDtlsWritableState*> batch,
|
||||
rtclog2::EventStream* event_stream) {
|
||||
for (const RtcEventDtlsWritableState* base_event : batch) {
|
||||
rtclog2::DtlsWritableState* proto_batch =
|
||||
@ -1513,7 +1513,7 @@ void RtcEventLogEncoderNewFormat::EncodeDtlsWritableState(
|
||||
}
|
||||
|
||||
void RtcEventLogEncoderNewFormat::EncodeProbeClusterCreated(
|
||||
ArrayView<const RtcEventProbeClusterCreated*> batch,
|
||||
std::span<const RtcEventProbeClusterCreated*> batch,
|
||||
rtclog2::EventStream* event_stream) {
|
||||
for (const RtcEventProbeClusterCreated* base_event : batch) {
|
||||
rtclog2::BweProbeCluster* proto_batch = event_stream->add_probe_clusters();
|
||||
@ -1526,7 +1526,7 @@ void RtcEventLogEncoderNewFormat::EncodeProbeClusterCreated(
|
||||
}
|
||||
|
||||
void RtcEventLogEncoderNewFormat::EncodeProbeResultFailure(
|
||||
ArrayView<const RtcEventProbeResultFailure*> batch,
|
||||
std::span<const RtcEventProbeResultFailure*> batch,
|
||||
rtclog2::EventStream* event_stream) {
|
||||
for (const RtcEventProbeResultFailure* base_event : batch) {
|
||||
rtclog2::BweProbeResultFailure* proto_batch =
|
||||
@ -1540,7 +1540,7 @@ void RtcEventLogEncoderNewFormat::EncodeProbeResultFailure(
|
||||
}
|
||||
|
||||
void RtcEventLogEncoderNewFormat::EncodeProbeResultSuccess(
|
||||
ArrayView<const RtcEventProbeResultSuccess*> batch,
|
||||
std::span<const RtcEventProbeResultSuccess*> batch,
|
||||
rtclog2::EventStream* event_stream) {
|
||||
for (const RtcEventProbeResultSuccess* base_event : batch) {
|
||||
rtclog2::BweProbeResultSuccess* proto_batch =
|
||||
@ -1553,7 +1553,7 @@ void RtcEventLogEncoderNewFormat::EncodeProbeResultSuccess(
|
||||
}
|
||||
|
||||
void RtcEventLogEncoderNewFormat::EncodeRouteChange(
|
||||
ArrayView<const RtcEventRouteChange*> batch,
|
||||
std::span<const RtcEventRouteChange*> batch,
|
||||
rtclog2::EventStream* event_stream) {
|
||||
for (const RtcEventRouteChange* base_event : batch) {
|
||||
rtclog2::RouteChange* proto_batch = event_stream->add_route_changes();
|
||||
@ -1565,7 +1565,7 @@ void RtcEventLogEncoderNewFormat::EncodeRouteChange(
|
||||
}
|
||||
|
||||
void RtcEventLogEncoderNewFormat::EncodeRemoteEstimate(
|
||||
ArrayView<const RtcEventRemoteEstimate*> batch,
|
||||
std::span<const RtcEventRemoteEstimate*> batch,
|
||||
rtclog2::EventStream* event_stream) {
|
||||
if (batch.empty())
|
||||
return;
|
||||
@ -1637,7 +1637,7 @@ void RtcEventLogEncoderNewFormat::EncodeRemoteEstimate(
|
||||
}
|
||||
|
||||
void RtcEventLogEncoderNewFormat::EncodeRtcpPacketIncoming(
|
||||
ArrayView<const RtcEventRtcpPacketIncoming*> batch,
|
||||
std::span<const RtcEventRtcpPacketIncoming*> batch,
|
||||
rtclog2::EventStream* event_stream) {
|
||||
if (batch.empty()) {
|
||||
return;
|
||||
@ -1646,7 +1646,7 @@ void RtcEventLogEncoderNewFormat::EncodeRtcpPacketIncoming(
|
||||
}
|
||||
|
||||
void RtcEventLogEncoderNewFormat::EncodeRtcpPacketOutgoing(
|
||||
ArrayView<const RtcEventRtcpPacketOutgoing*> batch,
|
||||
std::span<const RtcEventRtcpPacketOutgoing*> batch,
|
||||
rtclog2::EventStream* event_stream) {
|
||||
if (batch.empty()) {
|
||||
return;
|
||||
@ -1665,7 +1665,7 @@ void RtcEventLogEncoderNewFormat::EncodeRtpPacketIncoming(
|
||||
}
|
||||
|
||||
void RtcEventLogEncoderNewFormat::EncodeFramesDecoded(
|
||||
ArrayView<const RtcEventFrameDecoded* const> batch,
|
||||
std::span<const RtcEventFrameDecoded* const> batch,
|
||||
rtclog2::EventStream* event_stream) {
|
||||
if (batch.empty()) {
|
||||
return;
|
||||
@ -1774,7 +1774,7 @@ void RtcEventLogEncoderNewFormat::EncodeRtpPacketOutgoing(
|
||||
}
|
||||
|
||||
void RtcEventLogEncoderNewFormat::EncodeVideoRecvStreamConfig(
|
||||
ArrayView<const RtcEventVideoReceiveStreamConfig*> batch,
|
||||
std::span<const RtcEventVideoReceiveStreamConfig*> batch,
|
||||
rtclog2::EventStream* event_stream) {
|
||||
for (const RtcEventVideoReceiveStreamConfig* base_event : batch) {
|
||||
rtclog2::VideoRecvStreamConfig* proto_batch =
|
||||
@ -1794,7 +1794,7 @@ void RtcEventLogEncoderNewFormat::EncodeVideoRecvStreamConfig(
|
||||
}
|
||||
|
||||
void RtcEventLogEncoderNewFormat::EncodeVideoSendStreamConfig(
|
||||
ArrayView<const RtcEventVideoSendStreamConfig*> batch,
|
||||
std::span<const RtcEventVideoSendStreamConfig*> batch,
|
||||
rtclog2::EventStream* event_stream) {
|
||||
for (const RtcEventVideoSendStreamConfig* base_event : batch) {
|
||||
rtclog2::VideoSendStreamConfig* proto_batch =
|
||||
@ -1813,7 +1813,7 @@ void RtcEventLogEncoderNewFormat::EncodeVideoSendStreamConfig(
|
||||
}
|
||||
|
||||
void RtcEventLogEncoderNewFormat::EncodeIceCandidatePairConfig(
|
||||
ArrayView<const RtcEventIceCandidatePairConfig*> batch,
|
||||
std::span<const RtcEventIceCandidatePairConfig*> batch,
|
||||
rtclog2::EventStream* event_stream) {
|
||||
for (const RtcEventIceCandidatePairConfig* base_event : batch) {
|
||||
rtclog2::IceCandidatePairConfig* proto_batch =
|
||||
@ -1842,7 +1842,7 @@ void RtcEventLogEncoderNewFormat::EncodeIceCandidatePairConfig(
|
||||
}
|
||||
|
||||
void RtcEventLogEncoderNewFormat::EncodeIceCandidatePairEvent(
|
||||
ArrayView<const RtcEventIceCandidatePair*> batch,
|
||||
std::span<const RtcEventIceCandidatePair*> batch,
|
||||
rtclog2::EventStream* event_stream) {
|
||||
for (const RtcEventIceCandidatePair* base_event : batch) {
|
||||
rtclog2::IceCandidatePairEvent* proto_batch =
|
||||
|
||||
@ -15,10 +15,10 @@
|
||||
#include <deque>
|
||||
#include <map>
|
||||
#include <memory>
|
||||
#include <span>
|
||||
#include <string>
|
||||
#include <vector>
|
||||
|
||||
#include "api/array_view.h"
|
||||
#include "api/field_trials_view.h"
|
||||
#include "api/rtc_event_log/rtc_event.h"
|
||||
#include "logging/rtc_event_log/encoder/rtc_event_log_encoder.h"
|
||||
@ -73,66 +73,66 @@ class RtcEventLogEncoderNewFormat final : public RtcEventLogEncoder {
|
||||
|
||||
private:
|
||||
// Encoding entry-point for the various RtcEvent subclasses.
|
||||
void EncodeAlrState(ArrayView<const RtcEventAlrState*> batch,
|
||||
void EncodeAlrState(std::span<const RtcEventAlrState*> batch,
|
||||
rtclog2::EventStream* event_stream);
|
||||
void EncodeAudioNetworkAdaptation(
|
||||
ArrayView<const RtcEventAudioNetworkAdaptation*> batch,
|
||||
std::span<const RtcEventAudioNetworkAdaptation*> batch,
|
||||
rtclog2::EventStream* event_stream);
|
||||
void EncodeAudioPlayout(ArrayView<const RtcEventAudioPlayout*> batch,
|
||||
void EncodeAudioPlayout(std::span<const RtcEventAudioPlayout*> batch,
|
||||
rtclog2::EventStream* event_stream);
|
||||
void EncodeAudioRecvStreamConfig(
|
||||
ArrayView<const RtcEventAudioReceiveStreamConfig*> batch,
|
||||
std::span<const RtcEventAudioReceiveStreamConfig*> batch,
|
||||
rtclog2::EventStream* event_stream);
|
||||
void EncodeAudioSendStreamConfig(
|
||||
ArrayView<const RtcEventAudioSendStreamConfig*> batch,
|
||||
std::span<const RtcEventAudioSendStreamConfig*> batch,
|
||||
rtclog2::EventStream* event_stream);
|
||||
void EncodeBweUpdateDelayBased(
|
||||
ArrayView<const RtcEventBweUpdateDelayBased*> batch,
|
||||
std::span<const RtcEventBweUpdateDelayBased*> batch,
|
||||
rtclog2::EventStream* event_stream);
|
||||
void EncodeBweUpdateLossBased(
|
||||
ArrayView<const RtcEventBweUpdateLossBased*> batch,
|
||||
std::span<const RtcEventBweUpdateLossBased*> batch,
|
||||
rtclog2::EventStream* event_stream);
|
||||
void EncodeBweUpdateScream(ArrayView<const RtcEventBweUpdateScream*> batch,
|
||||
void EncodeBweUpdateScream(std::span<const RtcEventBweUpdateScream*> batch,
|
||||
rtclog2::EventStream* event_stream);
|
||||
void EncodeDtlsTransportState(
|
||||
ArrayView<const RtcEventDtlsTransportState*> batch,
|
||||
std::span<const RtcEventDtlsTransportState*> batch,
|
||||
rtclog2::EventStream* event_stream);
|
||||
void EncodeDtlsWritableState(
|
||||
ArrayView<const RtcEventDtlsWritableState*> batch,
|
||||
std::span<const RtcEventDtlsWritableState*> batch,
|
||||
rtclog2::EventStream* event_stream);
|
||||
void EncodeFramesDecoded(ArrayView<const RtcEventFrameDecoded* const> batch,
|
||||
void EncodeFramesDecoded(std::span<const RtcEventFrameDecoded* const> batch,
|
||||
rtclog2::EventStream* event_stream);
|
||||
void EncodeIceCandidatePairConfig(
|
||||
ArrayView<const RtcEventIceCandidatePairConfig*> batch,
|
||||
std::span<const RtcEventIceCandidatePairConfig*> batch,
|
||||
rtclog2::EventStream* event_stream);
|
||||
void EncodeIceCandidatePairEvent(
|
||||
ArrayView<const RtcEventIceCandidatePair*> batch,
|
||||
std::span<const RtcEventIceCandidatePair*> batch,
|
||||
rtclog2::EventStream* event_stream);
|
||||
void EncodeLoggingStarted(ArrayView<const RtcEventLoggingStarted*> batch,
|
||||
void EncodeLoggingStarted(std::span<const RtcEventLoggingStarted*> batch,
|
||||
rtclog2::EventStream* event_stream);
|
||||
void EncodeLoggingStopped(ArrayView<const RtcEventLoggingStopped*> batch,
|
||||
void EncodeLoggingStopped(std::span<const RtcEventLoggingStopped*> batch,
|
||||
rtclog2::EventStream* event_stream);
|
||||
void EncodeNetEqSetMinimumDelay(
|
||||
ArrayView<const RtcEventNetEqSetMinimumDelay*> batch,
|
||||
std::span<const RtcEventNetEqSetMinimumDelay*> batch,
|
||||
rtclog2::EventStream* event_stream);
|
||||
void EncodeProbeClusterCreated(
|
||||
ArrayView<const RtcEventProbeClusterCreated*> batch,
|
||||
std::span<const RtcEventProbeClusterCreated*> batch,
|
||||
rtclog2::EventStream* event_stream);
|
||||
void EncodeProbeResultFailure(
|
||||
ArrayView<const RtcEventProbeResultFailure*> batch,
|
||||
std::span<const RtcEventProbeResultFailure*> batch,
|
||||
rtclog2::EventStream* event_stream);
|
||||
void EncodeProbeResultSuccess(
|
||||
ArrayView<const RtcEventProbeResultSuccess*> batch,
|
||||
std::span<const RtcEventProbeResultSuccess*> batch,
|
||||
rtclog2::EventStream* event_stream);
|
||||
void EncodeRouteChange(ArrayView<const RtcEventRouteChange*> batch,
|
||||
void EncodeRouteChange(std::span<const RtcEventRouteChange*> batch,
|
||||
rtclog2::EventStream* event_stream);
|
||||
void EncodeRemoteEstimate(ArrayView<const RtcEventRemoteEstimate*> batch,
|
||||
void EncodeRemoteEstimate(std::span<const RtcEventRemoteEstimate*> batch,
|
||||
rtclog2::EventStream* event_stream);
|
||||
void EncodeRtcpPacketIncoming(
|
||||
ArrayView<const RtcEventRtcpPacketIncoming*> batch,
|
||||
std::span<const RtcEventRtcpPacketIncoming*> batch,
|
||||
rtclog2::EventStream* event_stream);
|
||||
void EncodeRtcpPacketOutgoing(
|
||||
ArrayView<const RtcEventRtcpPacketOutgoing*> batch,
|
||||
std::span<const RtcEventRtcpPacketOutgoing*> batch,
|
||||
rtclog2::EventStream* event_stream);
|
||||
void EncodeRtpPacketIncoming(
|
||||
const std::map<uint32_t, std::vector<const RtcEventRtpPacketIncoming*>>&
|
||||
@ -143,10 +143,10 @@ class RtcEventLogEncoderNewFormat final : public RtcEventLogEncoder {
|
||||
batch,
|
||||
rtclog2::EventStream* event_stream);
|
||||
void EncodeVideoRecvStreamConfig(
|
||||
ArrayView<const RtcEventVideoReceiveStreamConfig*> batch,
|
||||
std::span<const RtcEventVideoReceiveStreamConfig*> batch,
|
||||
rtclog2::EventStream* event_stream);
|
||||
void EncodeVideoSendStreamConfig(
|
||||
ArrayView<const RtcEventVideoSendStreamConfig*> batch,
|
||||
std::span<const RtcEventVideoSendStreamConfig*> batch,
|
||||
rtclog2::EventStream* event_stream);
|
||||
template <typename Batch, typename ProtoType>
|
||||
void EncodeRtpPacket(const Batch& batch, ProtoType* proto_batch);
|
||||
|
||||
@ -16,9 +16,9 @@
|
||||
#include <functional>
|
||||
#include <map>
|
||||
#include <memory>
|
||||
#include <span>
|
||||
#include <string>
|
||||
|
||||
#include "api/array_view.h"
|
||||
#include "api/rtc_event_log/rtc_event.h"
|
||||
#include "logging/rtc_event_log/encoder/rtc_event_log_encoder.h"
|
||||
|
||||
@ -39,7 +39,7 @@ class RtcEventLogEncoderV3 final : public RtcEventLogEncoder {
|
||||
|
||||
private:
|
||||
std::map<RtcEvent::Type,
|
||||
std::function<std::string(webrtc::ArrayView<const RtcEvent*>)>>
|
||||
std::function<std::string(std::span<const RtcEvent*>)>>
|
||||
encoders_;
|
||||
};
|
||||
|
||||
|
||||
@ -13,8 +13,8 @@
|
||||
#include <algorithm>
|
||||
#include <cstdint>
|
||||
#include <optional>
|
||||
#include <span>
|
||||
|
||||
#include "api/array_view.h"
|
||||
#include "logging/rtc_event_log/events/rtc_event_field_extraction.h"
|
||||
#include "rtc_base/checks.h"
|
||||
#include "rtc_base/logging.h"
|
||||
@ -29,7 +29,7 @@ namespace webrtc {
|
||||
FixedLengthEncodingParametersV3
|
||||
FixedLengthEncodingParametersV3::CalculateParameters(
|
||||
uint64_t base,
|
||||
const ArrayView<const uint64_t> values,
|
||||
const std::span<const uint64_t> values,
|
||||
uint64_t value_bit_width,
|
||||
bool values_optional) {
|
||||
// As a special case, if all of the elements are identical to the base
|
||||
|
||||
@ -13,8 +13,8 @@
|
||||
|
||||
#include <cstdint>
|
||||
#include <optional>
|
||||
#include <span>
|
||||
|
||||
#include "api/array_view.h"
|
||||
#include "logging/rtc_event_log/events/rtc_event_field_extraction.h"
|
||||
|
||||
namespace webrtc {
|
||||
@ -34,7 +34,7 @@ class FixedLengthEncodingParametersV3 final {
|
||||
|
||||
static FixedLengthEncodingParametersV3 CalculateParameters(
|
||||
uint64_t base,
|
||||
ArrayView<const uint64_t> values,
|
||||
std::span<const uint64_t> values,
|
||||
uint64_t value_bit_width,
|
||||
bool values_optional);
|
||||
static std::optional<FixedLengthEncodingParametersV3> ParseDeltaHeader(
|
||||
|
||||
@ -13,11 +13,11 @@
|
||||
|
||||
#include <cstdint>
|
||||
#include <memory>
|
||||
#include <span>
|
||||
#include <string>
|
||||
#include <vector>
|
||||
|
||||
#include "absl/strings/string_view.h"
|
||||
#include "api/array_view.h"
|
||||
#include "api/rtc_event_log/rtc_event.h"
|
||||
#include "api/units/timestamp.h"
|
||||
#include "logging/rtc_event_log/events/rtc_event_definition.h"
|
||||
@ -53,7 +53,7 @@ class RtcEventAlrState final : public RtcEvent {
|
||||
|
||||
bool in_alr() const { return in_alr_; }
|
||||
|
||||
static std::string Encode(ArrayView<const RtcEvent*> batch) {
|
||||
static std::string Encode(std::span<const RtcEvent*> batch) {
|
||||
return RtcEventAlrState::definition_.EncodeBatch(batch);
|
||||
}
|
||||
|
||||
|
||||
@ -15,11 +15,11 @@
|
||||
#include <cstdint>
|
||||
#include <memory>
|
||||
#include <optional>
|
||||
#include <span>
|
||||
#include <string>
|
||||
#include <vector>
|
||||
|
||||
#include "absl/strings/string_view.h"
|
||||
#include "api/array_view.h"
|
||||
#include "api/rtc_event_log/rtc_event.h"
|
||||
#include "api/units/timestamp.h"
|
||||
#include "logging/rtc_event_log/events/rtc_event_log_parse_status.h"
|
||||
@ -66,7 +66,7 @@ class RtcEventAudioNetworkAdaptation final : public RtcEvent {
|
||||
const std::optional<bool>& enable_dtx() const { return enable_dtx_; }
|
||||
const std::optional<size_t>& num_channels() const { return num_channels_; }
|
||||
|
||||
static std::string Encode(ArrayView<const RtcEvent*> /* batch */) {
|
||||
static std::string Encode(std::span<const RtcEvent*> /* batch */) {
|
||||
// TODO(terelius): Implement
|
||||
return "";
|
||||
}
|
||||
|
||||
@ -15,11 +15,11 @@
|
||||
|
||||
#include <map>
|
||||
#include <memory>
|
||||
#include <span>
|
||||
#include <string>
|
||||
#include <vector>
|
||||
|
||||
#include "absl/strings/string_view.h"
|
||||
#include "api/array_view.h"
|
||||
#include "api/rtc_event_log/rtc_event.h"
|
||||
#include "api/units/timestamp.h"
|
||||
#include "logging/rtc_event_log/events/rtc_event_definition.h"
|
||||
@ -55,7 +55,7 @@ class RtcEventAudioPlayout final : public RtcEvent {
|
||||
|
||||
uint32_t ssrc() const { return ssrc_; }
|
||||
|
||||
static std::string Encode(ArrayView<const RtcEvent*> batch) {
|
||||
static std::string Encode(std::span<const RtcEvent*> batch) {
|
||||
return RtcEventAudioPlayout::definition_.EncodeBatch(batch);
|
||||
}
|
||||
|
||||
|
||||
@ -13,11 +13,11 @@
|
||||
|
||||
#include <cstdint>
|
||||
#include <memory>
|
||||
#include <span>
|
||||
#include <string>
|
||||
#include <vector>
|
||||
|
||||
#include "absl/strings/string_view.h"
|
||||
#include "api/array_view.h"
|
||||
#include "api/rtc_event_log/rtc_event.h"
|
||||
#include "api/units/timestamp.h"
|
||||
#include "logging/rtc_event_log/events/rtc_event_log_parse_status.h"
|
||||
@ -53,7 +53,7 @@ class RtcEventAudioReceiveStreamConfig final : public RtcEvent {
|
||||
|
||||
const rtclog::StreamConfig& config() const { return *config_; }
|
||||
|
||||
static std::string Encode(ArrayView<const RtcEvent*> /* batch */) {
|
||||
static std::string Encode(std::span<const RtcEvent*> /* batch */) {
|
||||
// TODO(terelius): Implement
|
||||
return "";
|
||||
}
|
||||
|
||||
@ -13,11 +13,11 @@
|
||||
|
||||
#include <cstdint>
|
||||
#include <memory>
|
||||
#include <span>
|
||||
#include <string>
|
||||
#include <vector>
|
||||
|
||||
#include "absl/strings/string_view.h"
|
||||
#include "api/array_view.h"
|
||||
#include "api/rtc_event_log/rtc_event.h"
|
||||
#include "api/units/timestamp.h"
|
||||
#include "logging/rtc_event_log/events/rtc_event_log_parse_status.h"
|
||||
@ -53,7 +53,7 @@ class RtcEventAudioSendStreamConfig final : public RtcEvent {
|
||||
|
||||
const rtclog::StreamConfig& config() const { return *config_; }
|
||||
|
||||
static std::string Encode(ArrayView<const RtcEvent*> /* batch */) {
|
||||
static std::string Encode(std::span<const RtcEvent*> /* batch */) {
|
||||
// TODO(terelius): Implement
|
||||
return "";
|
||||
}
|
||||
|
||||
@ -11,11 +11,11 @@
|
||||
#include "logging/rtc_event_log/events/rtc_event_begin_log.h"
|
||||
|
||||
#include <cstdint>
|
||||
#include <span>
|
||||
#include <string>
|
||||
#include <vector>
|
||||
|
||||
#include "absl/strings/string_view.h"
|
||||
#include "api/array_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.h"
|
||||
@ -30,7 +30,7 @@ RtcEventBeginLog::RtcEventBeginLog(Timestamp timestamp,
|
||||
|
||||
RtcEventBeginLog::~RtcEventBeginLog() = default;
|
||||
|
||||
std::string RtcEventBeginLog::Encode(ArrayView<const RtcEvent*> batch) {
|
||||
std::string RtcEventBeginLog::Encode(std::span<const RtcEvent*> batch) {
|
||||
EventEncoder encoder(event_params_, batch);
|
||||
|
||||
encoder.EncodeField(
|
||||
@ -49,7 +49,7 @@ RtcEventLogParseStatus RtcEventBeginLog::Parse(
|
||||
if (!status.ok())
|
||||
return status;
|
||||
|
||||
ArrayView<LoggedStartEvent> output_batch =
|
||||
std::span<LoggedStartEvent> output_batch =
|
||||
ExtendLoggedBatch(output, parser.NumEventsInBatch());
|
||||
|
||||
constexpr FieldParameters timestamp_params{
|
||||
@ -57,7 +57,7 @@ RtcEventLogParseStatus RtcEventBeginLog::Parse(
|
||||
.field_id = FieldParameters::kTimestampField,
|
||||
.field_type = FieldType::kVarInt,
|
||||
.value_width = 64};
|
||||
RtcEventLogParseStatusOr<ArrayView<uint64_t>> result =
|
||||
RtcEventLogParseStatusOr<std::span<uint64_t>> result =
|
||||
parser.ParseNumericField(timestamp_params);
|
||||
if (!result.ok())
|
||||
return result.status();
|
||||
|
||||
@ -12,11 +12,11 @@
|
||||
#define LOGGING_RTC_EVENT_LOG_EVENTS_RTC_EVENT_BEGIN_LOG_H_
|
||||
|
||||
#include <cstdint>
|
||||
#include <span>
|
||||
#include <string>
|
||||
#include <vector>
|
||||
|
||||
#include "absl/strings/string_view.h"
|
||||
#include "api/array_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.h"
|
||||
@ -53,7 +53,7 @@ class RtcEventBeginLog final : public RtcEvent {
|
||||
Type GetType() const override { return kType; }
|
||||
bool IsConfigEvent() const override { return false; }
|
||||
|
||||
static std::string Encode(ArrayView<const RtcEvent*> batch);
|
||||
static std::string Encode(std::span<const RtcEvent*> batch);
|
||||
|
||||
static RtcEventLogParseStatus Parse(absl::string_view encoded_bytes,
|
||||
bool batched,
|
||||
|
||||
@ -15,11 +15,11 @@
|
||||
|
||||
#include <limits>
|
||||
#include <memory>
|
||||
#include <span>
|
||||
#include <string>
|
||||
#include <vector>
|
||||
|
||||
#include "absl/strings/string_view.h"
|
||||
#include "api/array_view.h"
|
||||
#include "api/rtc_event_log/rtc_event.h"
|
||||
#include "api/transport/bandwidth_usage.h"
|
||||
#include "api/units/timestamp.h"
|
||||
@ -104,7 +104,7 @@ class RtcEventBweUpdateDelayBased final : public RtcEvent {
|
||||
int32_t bitrate_bps() const { return bitrate_bps_; }
|
||||
BandwidthUsage detector_state() const { return detector_state_; }
|
||||
|
||||
static std::string Encode(ArrayView<const RtcEvent*> batch) {
|
||||
static std::string Encode(std::span<const RtcEvent*> batch) {
|
||||
return RtcEventBweUpdateDelayBased::definition_.EncodeBatch(batch);
|
||||
}
|
||||
|
||||
|
||||
@ -14,11 +14,11 @@
|
||||
#include <stdint.h>
|
||||
|
||||
#include <memory>
|
||||
#include <span>
|
||||
#include <string>
|
||||
#include <vector>
|
||||
|
||||
#include "absl/strings/string_view.h"
|
||||
#include "api/array_view.h"
|
||||
#include "api/rtc_event_log/rtc_event.h"
|
||||
#include "api/units/timestamp.h"
|
||||
#include "logging/rtc_event_log/events/rtc_event_log_parse_status.h"
|
||||
@ -64,7 +64,7 @@ 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(ArrayView<const RtcEvent*> /* batch */) {
|
||||
static std::string Encode(std::span<const RtcEvent*> /* batch */) {
|
||||
// TODO(terelius): Implement
|
||||
return "";
|
||||
}
|
||||
|
||||
@ -14,11 +14,11 @@
|
||||
#include <stdint.h>
|
||||
|
||||
#include <memory>
|
||||
#include <span>
|
||||
#include <string>
|
||||
#include <vector>
|
||||
|
||||
#include "absl/strings/string_view.h"
|
||||
#include "api/array_view.h"
|
||||
#include "api/rtc_event_log/rtc_event.h"
|
||||
#include "api/units/data_rate.h"
|
||||
#include "api/units/data_size.h"
|
||||
@ -82,7 +82,7 @@ class RtcEventBweUpdateScream final : public RtcEvent {
|
||||
uint32_t avg_queue_delay_ms() const { return avg_queue_delay_ms_; }
|
||||
uint32_t l4s_marked_permille() const { return l4s_marked_permille_; }
|
||||
|
||||
static std::string Encode(ArrayView<const RtcEvent*> batch) {
|
||||
static std::string Encode(std::span<const RtcEvent*> batch) {
|
||||
// TODO(terelius): Implement
|
||||
return "";
|
||||
}
|
||||
|
||||
@ -12,11 +12,11 @@
|
||||
#define LOGGING_RTC_EVENT_LOG_EVENTS_RTC_EVENT_DEFINITION_H_
|
||||
|
||||
#include <cstdint>
|
||||
#include <span>
|
||||
#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/rtc_event_field_encoding.h"
|
||||
#include "logging/rtc_event_log/events/rtc_event_field_encoding_parser.h"
|
||||
@ -35,8 +35,8 @@ struct RtcEventFieldDefinition {
|
||||
template <typename EventType, typename LoggedType, typename... Ts>
|
||||
class RtcEventDefinitionImpl {
|
||||
public:
|
||||
void EncodeImpl(EventEncoder&, ArrayView<const RtcEvent*>) const {}
|
||||
RtcEventLogParseStatus ParseImpl(EventParser&, ArrayView<LoggedType>) const {
|
||||
void EncodeImpl(EventEncoder&, std::span<const RtcEvent*>) const {}
|
||||
RtcEventLogParseStatus ParseImpl(EventParser&, std::span<LoggedType>) const {
|
||||
return RtcEventLogParseStatus::Success();
|
||||
}
|
||||
};
|
||||
@ -51,15 +51,15 @@ class RtcEventDefinitionImpl<EventType, LoggedType, T, Ts...> {
|
||||
: field_(field), rest_(rest...) {}
|
||||
|
||||
void EncodeImpl(EventEncoder& encoder,
|
||||
ArrayView<const RtcEvent*> batch) const {
|
||||
std::span<const RtcEvent*> batch) const {
|
||||
auto values = ExtractRtcEventMember(batch, field_.event_member);
|
||||
encoder.EncodeField(field_.params, values);
|
||||
rest_.EncodeImpl(encoder, batch);
|
||||
}
|
||||
|
||||
RtcEventLogParseStatus ParseImpl(EventParser& parser,
|
||||
ArrayView<LoggedType> output_batch) const {
|
||||
RtcEventLogParseStatusOr<ArrayView<uint64_t>> result =
|
||||
std::span<LoggedType> output_batch) const {
|
||||
RtcEventLogParseStatusOr<std::span<uint64_t>> result =
|
||||
parser.ParseNumericField(field_.params);
|
||||
if (!result.ok())
|
||||
return result.status();
|
||||
@ -106,7 +106,7 @@ class RtcEventDefinition {
|
||||
RtcEventFieldDefinition<EventType, LoggedType, Ts>... fields)
|
||||
: params_(params), fields_(fields...) {}
|
||||
|
||||
std::string EncodeBatch(ArrayView<const RtcEvent*> batch) const {
|
||||
std::string EncodeBatch(std::span<const RtcEvent*> batch) const {
|
||||
EventEncoder encoder(params_, batch);
|
||||
fields_.EncodeImpl(encoder, batch);
|
||||
return encoder.AsString();
|
||||
@ -120,7 +120,7 @@ class RtcEventDefinition {
|
||||
if (!status.ok())
|
||||
return status;
|
||||
|
||||
ArrayView<LoggedType> output_batch =
|
||||
std::span<LoggedType> output_batch =
|
||||
ExtendLoggedBatch(output, parser.NumEventsInBatch());
|
||||
|
||||
constexpr FieldParameters timestamp_params{
|
||||
@ -128,7 +128,7 @@ class RtcEventDefinition {
|
||||
.field_id = FieldParameters::kTimestampField,
|
||||
.field_type = FieldType::kVarInt,
|
||||
.value_width = 64};
|
||||
RtcEventLogParseStatusOr<ArrayView<uint64_t>> result =
|
||||
RtcEventLogParseStatusOr<std::span<uint64_t>> result =
|
||||
parser.ParseNumericField(timestamp_params);
|
||||
if (!result.ok())
|
||||
return result.status();
|
||||
|
||||
@ -13,11 +13,11 @@
|
||||
|
||||
#include <cstdint>
|
||||
#include <memory>
|
||||
#include <span>
|
||||
#include <string>
|
||||
#include <vector>
|
||||
|
||||
#include "absl/strings/string_view.h"
|
||||
#include "api/array_view.h"
|
||||
#include "api/dtls_transport_interface.h"
|
||||
#include "api/rtc_event_log/rtc_event.h"
|
||||
#include "api/units/timestamp.h"
|
||||
@ -50,7 +50,7 @@ class RtcEventDtlsTransportState : public RtcEvent {
|
||||
return dtls_transport_state_;
|
||||
}
|
||||
|
||||
static std::string Encode(ArrayView<const RtcEvent*> /* batch */) {
|
||||
static std::string Encode(std::span<const RtcEvent*> /* batch */) {
|
||||
// TODO(terelius): Implement
|
||||
return "";
|
||||
}
|
||||
|
||||
@ -13,11 +13,11 @@
|
||||
|
||||
#include <cstdint>
|
||||
#include <memory>
|
||||
#include <span>
|
||||
#include <string>
|
||||
#include <vector>
|
||||
|
||||
#include "absl/strings/string_view.h"
|
||||
#include "api/array_view.h"
|
||||
#include "api/rtc_event_log/rtc_event.h"
|
||||
#include "api/units/timestamp.h"
|
||||
#include "logging/rtc_event_log/events/rtc_event_log_parse_status.h"
|
||||
@ -50,7 +50,7 @@ class RtcEventDtlsWritableState : public RtcEvent {
|
||||
|
||||
bool writable() const { return writable_; }
|
||||
|
||||
static std::string Encode(ArrayView<const RtcEvent*> /* batch */) {
|
||||
static std::string Encode(std::span<const RtcEvent*> /* batch */) {
|
||||
// TODO(terelius): Implement
|
||||
return "";
|
||||
}
|
||||
|
||||
@ -11,11 +11,11 @@
|
||||
#include "logging/rtc_event_log/events/rtc_event_end_log.h"
|
||||
|
||||
#include <cstdint>
|
||||
#include <span>
|
||||
#include <string>
|
||||
#include <vector>
|
||||
|
||||
#include "absl/strings/string_view.h"
|
||||
#include "api/array_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.h"
|
||||
@ -29,7 +29,7 @@ RtcEventEndLog::RtcEventEndLog(Timestamp timestamp)
|
||||
|
||||
RtcEventEndLog::~RtcEventEndLog() = default;
|
||||
|
||||
std::string RtcEventEndLog::Encode(ArrayView<const RtcEvent*> batch) {
|
||||
std::string RtcEventEndLog::Encode(std::span<const RtcEvent*> batch) {
|
||||
EventEncoder encoder(event_params_, batch);
|
||||
return encoder.AsString();
|
||||
}
|
||||
@ -43,7 +43,7 @@ RtcEventLogParseStatus RtcEventEndLog::Parse(
|
||||
if (!status.ok())
|
||||
return status;
|
||||
|
||||
ArrayView<LoggedStopEvent> output_batch =
|
||||
std::span<LoggedStopEvent> output_batch =
|
||||
ExtendLoggedBatch(output, parser.NumEventsInBatch());
|
||||
|
||||
constexpr FieldParameters timestamp_params{
|
||||
@ -51,7 +51,7 @@ RtcEventLogParseStatus RtcEventEndLog::Parse(
|
||||
.field_id = FieldParameters::kTimestampField,
|
||||
.field_type = FieldType::kVarInt,
|
||||
.value_width = 64};
|
||||
RtcEventLogParseStatusOr<ArrayView<uint64_t>> result =
|
||||
RtcEventLogParseStatusOr<std::span<uint64_t>> result =
|
||||
parser.ParseNumericField(timestamp_params);
|
||||
if (!result.ok())
|
||||
return result.status();
|
||||
|
||||
@ -12,11 +12,11 @@
|
||||
#define LOGGING_RTC_EVENT_LOG_EVENTS_RTC_EVENT_END_LOG_H_
|
||||
|
||||
#include <cstdint>
|
||||
#include <span>
|
||||
#include <string>
|
||||
#include <vector>
|
||||
|
||||
#include "absl/strings/string_view.h"
|
||||
#include "api/array_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.h"
|
||||
@ -46,7 +46,7 @@ class RtcEventEndLog final : public RtcEvent {
|
||||
Type GetType() const override { return kType; }
|
||||
bool IsConfigEvent() const override { return false; }
|
||||
|
||||
static std::string Encode(ArrayView<const RtcEvent*> batch);
|
||||
static std::string Encode(std::span<const RtcEvent*> batch);
|
||||
|
||||
static RtcEventLogParseStatus Parse(absl::string_view encoded_bytes,
|
||||
bool batched,
|
||||
|
||||
@ -14,11 +14,11 @@
|
||||
#include <cstdint>
|
||||
#include <limits>
|
||||
#include <optional>
|
||||
#include <span>
|
||||
#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/encoder/bit_writer.h"
|
||||
#include "logging/rtc_event_log/encoder/var_int.h"
|
||||
@ -107,7 +107,7 @@ std::optional<FieldType> ConvertFieldType(uint64_t value) {
|
||||
|
||||
std::string EncodeDeltasV3(FixedLengthEncodingParametersV3 params,
|
||||
uint64_t base,
|
||||
ArrayView<const uint64_t> values) {
|
||||
std::span<const uint64_t> values) {
|
||||
size_t outputbound = (values.size() * params.delta_bit_width() + 7) / 8;
|
||||
BitWriter writer(outputbound);
|
||||
|
||||
@ -142,7 +142,7 @@ std::string EncodeDeltasV3(FixedLengthEncodingParametersV3 params,
|
||||
}
|
||||
|
||||
EventEncoder::EventEncoder(EventParameters params,
|
||||
ArrayView<const RtcEvent*> batch) {
|
||||
std::span<const RtcEvent*> batch) {
|
||||
batch_size_ = batch.size();
|
||||
if (!batch.empty()) {
|
||||
// Encode event type.
|
||||
@ -212,9 +212,9 @@ void EventEncoder::EncodeField(const FieldParameters& params,
|
||||
const bool values_optional = values.size() != batch_size_;
|
||||
|
||||
// Compute delta parameters
|
||||
ArrayView<const uint64_t> all_values(values);
|
||||
std::span<const uint64_t> all_values(values);
|
||||
uint64_t base = values[0];
|
||||
ArrayView<const uint64_t> remaining_values = all_values.subspan(1);
|
||||
std::span<const uint64_t> remaining_values = all_values.subspan(1);
|
||||
|
||||
FixedLengthEncodingParametersV3 delta_params =
|
||||
FixedLengthEncodingParametersV3::CalculateParameters(
|
||||
|
||||
@ -14,12 +14,12 @@
|
||||
#include <cstddef>
|
||||
#include <cstdint>
|
||||
#include <optional>
|
||||
#include <span>
|
||||
#include <string>
|
||||
#include <type_traits>
|
||||
#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/fixed_length_encoding_parameters_v3.h"
|
||||
#include "logging/rtc_event_log/events/rtc_event_field_extraction.h"
|
||||
@ -71,7 +71,7 @@ struct FieldParameters {
|
||||
// The EventEncoder is used to encode a batch of events.
|
||||
class EventEncoder {
|
||||
public:
|
||||
EventEncoder(EventParameters params, ArrayView<const RtcEvent*> batch);
|
||||
EventEncoder(EventParameters params, std::span<const RtcEvent*> batch);
|
||||
|
||||
void EncodeField(const FieldParameters& params,
|
||||
const std::vector<uint64_t>& values,
|
||||
@ -94,7 +94,7 @@ class EventEncoder {
|
||||
std::string EncodeSingleValue(uint64_t value, FieldType field_type);
|
||||
std::string EncodeDeltasV3(FixedLengthEncodingParametersV3 params,
|
||||
uint64_t base,
|
||||
ArrayView<const uint64_t> values);
|
||||
std::span<const uint64_t> values);
|
||||
|
||||
// Given a batch of RtcEvents and a member pointer, extract that
|
||||
// member from each event in the batch. Signed integer members are
|
||||
@ -107,7 +107,7 @@ std::string EncodeDeltasV3(FixedLengthEncodingParametersV3 params,
|
||||
template <typename T,
|
||||
typename E,
|
||||
std::enable_if_t<std::is_integral<T>::value, bool> = true>
|
||||
std::vector<uint64_t> ExtractRtcEventMember(ArrayView<const RtcEvent*> batch,
|
||||
std::vector<uint64_t> ExtractRtcEventMember(std::span<const RtcEvent*> batch,
|
||||
const T E::* member) {
|
||||
std::vector<uint64_t> values;
|
||||
values.reserve(batch.size());
|
||||
@ -128,7 +128,7 @@ std::vector<uint64_t> ExtractRtcEventMember(ArrayView<const RtcEvent*> batch,
|
||||
template <typename T,
|
||||
typename E,
|
||||
std::enable_if_t<std::is_integral<T>::value, bool> = true>
|
||||
ValuesWithPositions ExtractRtcEventMember(ArrayView<const RtcEvent*> batch,
|
||||
ValuesWithPositions ExtractRtcEventMember(std::span<const RtcEvent*> batch,
|
||||
const std::optional<T> E::* member) {
|
||||
ValuesWithPositions result;
|
||||
result.position_mask.reserve(batch.size());
|
||||
@ -149,7 +149,7 @@ ValuesWithPositions ExtractRtcEventMember(ArrayView<const RtcEvent*> batch,
|
||||
template <typename T,
|
||||
typename E,
|
||||
std::enable_if_t<std::is_enum<T>::value, bool> = true>
|
||||
std::vector<uint64_t> ExtractRtcEventMember(ArrayView<const RtcEvent*> batch,
|
||||
std::vector<uint64_t> ExtractRtcEventMember(std::span<const RtcEvent*> batch,
|
||||
const T E::* member) {
|
||||
std::vector<uint64_t> values;
|
||||
values.reserve(batch.size());
|
||||
@ -164,7 +164,7 @@ std::vector<uint64_t> ExtractRtcEventMember(ArrayView<const RtcEvent*> batch,
|
||||
// Extract a string field from a batch of RtcEvents.
|
||||
template <typename E>
|
||||
std::vector<absl::string_view> ExtractRtcEventMember(
|
||||
ArrayView<const RtcEvent*> batch,
|
||||
std::span<const RtcEvent*> batch,
|
||||
const std::string E::* member) {
|
||||
std::vector<absl::string_view> values;
|
||||
values.reserve(batch.size());
|
||||
|
||||
@ -14,10 +14,10 @@
|
||||
#include <cstddef>
|
||||
#include <cstdint>
|
||||
#include <optional>
|
||||
#include <span>
|
||||
#include <tuple>
|
||||
|
||||
#include "absl/strings/string_view.h"
|
||||
#include "api/array_view.h"
|
||||
#include "logging/rtc_event_log/encoder/var_int.h"
|
||||
#include "logging/rtc_event_log/events/fixed_length_encoding_parameters_v3.h"
|
||||
#include "logging/rtc_event_log/events/rtc_event_field_encoding.h"
|
||||
@ -355,15 +355,15 @@ RtcEventLogParseStatus EventParser::ParseField(const FieldParameters& params) {
|
||||
return RtcEventLogParseStatus::Success();
|
||||
}
|
||||
|
||||
RtcEventLogParseStatusOr<ArrayView<absl::string_view>>
|
||||
RtcEventLogParseStatusOr<std::span<absl::string_view>>
|
||||
EventParser::ParseStringField(const FieldParameters& params,
|
||||
bool required_field) {
|
||||
using StatusOr = RtcEventLogParseStatusOr<ArrayView<absl::string_view>>;
|
||||
using StatusOr = RtcEventLogParseStatusOr<std::span<absl::string_view>>;
|
||||
RTC_DCHECK_EQ(params.field_type, FieldType::kString);
|
||||
auto status = ParseField(params);
|
||||
if (!status.ok())
|
||||
return StatusOr(status);
|
||||
ArrayView<absl::string_view> strings = GetStrings();
|
||||
std::span<absl::string_view> strings = GetStrings();
|
||||
if (required_field && strings.size() != NumEventsInBatch()) {
|
||||
return StatusOr::Error("Required string field not found", __FILE__,
|
||||
__LINE__);
|
||||
@ -371,15 +371,15 @@ EventParser::ParseStringField(const FieldParameters& params,
|
||||
return StatusOr(strings);
|
||||
}
|
||||
|
||||
RtcEventLogParseStatusOr<ArrayView<uint64_t>> EventParser::ParseNumericField(
|
||||
RtcEventLogParseStatusOr<std::span<uint64_t>> EventParser::ParseNumericField(
|
||||
const FieldParameters& params,
|
||||
bool required_field) {
|
||||
using StatusOr = RtcEventLogParseStatusOr<ArrayView<uint64_t>>;
|
||||
using StatusOr = RtcEventLogParseStatusOr<std::span<uint64_t>>;
|
||||
RTC_DCHECK_NE(params.field_type, FieldType::kString);
|
||||
auto status = ParseField(params);
|
||||
if (!status.ok())
|
||||
return StatusOr(status);
|
||||
ArrayView<uint64_t> values = GetValues();
|
||||
std::span<uint64_t> values = GetValues();
|
||||
if (required_field && values.size() != NumEventsInBatch()) {
|
||||
return StatusOr::Error("Required numerical field not found", __FILE__,
|
||||
__LINE__);
|
||||
|
||||
@ -14,13 +14,13 @@
|
||||
#include <cstddef>
|
||||
#include <cstdint>
|
||||
#include <optional>
|
||||
#include <span>
|
||||
#include <string>
|
||||
#include <type_traits>
|
||||
#include <vector>
|
||||
|
||||
#include "absl/base/attributes.h"
|
||||
#include "absl/strings/string_view.h"
|
||||
#include "api/array_view.h"
|
||||
#include "api/units/timestamp.h"
|
||||
#include "logging/rtc_event_log/events/fixed_length_encoding_parameters_v3.h"
|
||||
#include "logging/rtc_event_log/events/rtc_event_field_encoding.h"
|
||||
@ -33,8 +33,8 @@ namespace webrtc {
|
||||
class EventParser {
|
||||
public:
|
||||
struct ValueAndPostionView {
|
||||
ArrayView<uint64_t> values;
|
||||
ArrayView<uint8_t> positions;
|
||||
std::span<uint64_t> values;
|
||||
std::span<uint8_t> positions;
|
||||
};
|
||||
|
||||
EventParser() = default;
|
||||
@ -48,10 +48,10 @@ class EventParser {
|
||||
// other fields that may occur before it. If 'required_field == true',
|
||||
// then failing to find the field is an error, otherwise the functions
|
||||
// return success, but with an empty view of values.
|
||||
RtcEventLogParseStatusOr<ArrayView<absl::string_view>> ParseStringField(
|
||||
RtcEventLogParseStatusOr<std::span<absl::string_view>> ParseStringField(
|
||||
const FieldParameters& params,
|
||||
bool required_field = true);
|
||||
RtcEventLogParseStatusOr<ArrayView<uint64_t>> ParseNumericField(
|
||||
RtcEventLogParseStatusOr<std::span<uint64_t>> ParseNumericField(
|
||||
const FieldParameters& params,
|
||||
bool required_field = true);
|
||||
RtcEventLogParseStatusOr<ValueAndPostionView> ParseOptionalNumericField(
|
||||
@ -90,9 +90,9 @@ class EventParser {
|
||||
void SetError() { error_ = true; }
|
||||
bool Ok() const { return !error_; }
|
||||
|
||||
ArrayView<uint64_t> GetValues() { return values_; }
|
||||
ArrayView<uint8_t> GetPositions() { return positions_; }
|
||||
ArrayView<absl::string_view> GetStrings() { return strings_; }
|
||||
std::span<uint64_t> GetValues() { return values_; }
|
||||
std::span<uint8_t> GetPositions() { return positions_; }
|
||||
std::span<absl::string_view> GetStrings() { return strings_; }
|
||||
|
||||
void ClearTemporaries() {
|
||||
positions_.clear();
|
||||
@ -122,9 +122,9 @@ template <typename T,
|
||||
typename E,
|
||||
std::enable_if_t<std::is_integral<T>::value, bool> = true>
|
||||
ABSL_MUST_USE_RESULT RtcEventLogParseStatus
|
||||
PopulateRtcEventMember(const ArrayView<uint64_t> values,
|
||||
PopulateRtcEventMember(const std::span<uint64_t> values,
|
||||
T E::* member,
|
||||
ArrayView<E> output) {
|
||||
std::span<E> output) {
|
||||
size_t batch_size = values.size();
|
||||
RTC_CHECK_EQ(output.size(), batch_size);
|
||||
for (size_t i = 0; i < batch_size; ++i) {
|
||||
@ -138,10 +138,10 @@ template <typename T,
|
||||
typename E,
|
||||
std::enable_if_t<std::is_integral<T>::value, bool> = true>
|
||||
ABSL_MUST_USE_RESULT RtcEventLogParseStatus
|
||||
PopulateRtcEventMember(const ArrayView<uint8_t> positions,
|
||||
const ArrayView<uint64_t> values,
|
||||
PopulateRtcEventMember(const std::span<uint8_t> positions,
|
||||
const std::span<uint64_t> values,
|
||||
std::optional<T> E::* member,
|
||||
ArrayView<E> output) {
|
||||
std::span<E> output) {
|
||||
size_t batch_size = positions.size();
|
||||
RTC_CHECK_EQ(output.size(), batch_size);
|
||||
RTC_CHECK_LE(values.size(), batch_size);
|
||||
@ -164,9 +164,9 @@ template <typename T,
|
||||
typename E,
|
||||
std::enable_if_t<std::is_enum<T>::value, bool> = true>
|
||||
ABSL_MUST_USE_RESULT RtcEventLogParseStatus
|
||||
PopulateRtcEventMember(const ArrayView<uint64_t> values,
|
||||
PopulateRtcEventMember(const std::span<uint64_t> values,
|
||||
T E::* member,
|
||||
ArrayView<E> output) {
|
||||
std::span<E> output) {
|
||||
size_t batch_size = values.size();
|
||||
RTC_CHECK_EQ(output.size(), batch_size);
|
||||
for (size_t i = 0; i < batch_size; ++i) {
|
||||
@ -182,9 +182,9 @@ PopulateRtcEventMember(const ArrayView<uint64_t> values,
|
||||
// Same as above, but for string fields.
|
||||
template <typename E>
|
||||
ABSL_MUST_USE_RESULT RtcEventLogParseStatus
|
||||
PopulateRtcEventMember(const ArrayView<absl::string_view> values,
|
||||
PopulateRtcEventMember(const std::span<absl::string_view> values,
|
||||
std::string E::* member,
|
||||
ArrayView<E> output) {
|
||||
std::span<E> output) {
|
||||
size_t batch_size = values.size();
|
||||
RTC_CHECK_EQ(output.size(), batch_size);
|
||||
for (size_t i = 0; i < batch_size; ++i) {
|
||||
@ -197,9 +197,9 @@ PopulateRtcEventMember(const ArrayView<absl::string_view> values,
|
||||
// N.B. Assumes that the encoded value uses millisecond precision.
|
||||
template <typename E>
|
||||
ABSL_MUST_USE_RESULT RtcEventLogParseStatus
|
||||
PopulateRtcEventTimestamp(const ArrayView<uint64_t>& values,
|
||||
PopulateRtcEventTimestamp(const std::span<uint64_t>& values,
|
||||
Timestamp E::* timestamp,
|
||||
ArrayView<E> output) {
|
||||
std::span<E> output) {
|
||||
size_t batch_size = values.size();
|
||||
RTC_CHECK_EQ(batch_size, output.size());
|
||||
for (size_t i = 0; i < batch_size; ++i) {
|
||||
@ -210,10 +210,10 @@ PopulateRtcEventTimestamp(const ArrayView<uint64_t>& values,
|
||||
}
|
||||
|
||||
template <typename E>
|
||||
ArrayView<E> ExtendLoggedBatch(std::vector<E>& output, size_t new_elements) {
|
||||
std::span<E> ExtendLoggedBatch(std::vector<E>& output, size_t new_elements) {
|
||||
size_t old_size = output.size();
|
||||
output.resize(old_size + new_elements);
|
||||
ArrayView<E> output_batch = output;
|
||||
std::span<E> output_batch = output;
|
||||
output_batch = output_batch.subspan(old_size);
|
||||
RTC_DCHECK_EQ(output_batch.size(), new_elements);
|
||||
return output_batch;
|
||||
|
||||
@ -14,13 +14,13 @@
|
||||
#include <cstdio>
|
||||
#include <limits>
|
||||
#include <optional>
|
||||
#include <span>
|
||||
#include <string>
|
||||
#include <tuple>
|
||||
#include <type_traits>
|
||||
#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/encoder/var_int.h"
|
||||
#include "logging/rtc_event_log/events/rtc_event_field_encoding_parser.h"
|
||||
@ -366,8 +366,8 @@ class RtcEventFieldTest : public ::testing::Test {
|
||||
size_t size_before = parser_.RemainingBytes();
|
||||
auto result = parser_.ParseOptionalNumericField(params);
|
||||
ASSERT_TRUE(result.ok()) << result.message().c_str();
|
||||
ArrayView<uint64_t> values = result.value().values;
|
||||
ArrayView<uint8_t> positions = result.value().positions;
|
||||
std::span<uint64_t> values = result.value().values;
|
||||
std::span<uint8_t> positions = result.value().positions;
|
||||
ASSERT_EQ(positions.size(), expected_values.size());
|
||||
auto value_it = values.begin();
|
||||
for (size_t i = 0; i < expected_values.size(); i++) {
|
||||
@ -396,8 +396,8 @@ class RtcEventFieldTest : public ::testing::Test {
|
||||
auto result =
|
||||
parser_.ParseOptionalNumericField(params, /*required_field=*/false);
|
||||
ASSERT_TRUE(result.ok()) << result.message().c_str();
|
||||
ArrayView<uint64_t> values = result.value().values;
|
||||
ArrayView<uint8_t> positions = result.value().positions;
|
||||
std::span<uint64_t> values = result.value().values;
|
||||
std::span<uint8_t> positions = result.value().positions;
|
||||
EXPECT_EQ(positions.size(), 0u);
|
||||
EXPECT_EQ(values.size(), 0u);
|
||||
}
|
||||
|
||||
@ -15,11 +15,11 @@
|
||||
|
||||
#include <map>
|
||||
#include <memory>
|
||||
#include <span>
|
||||
#include <string>
|
||||
#include <vector>
|
||||
|
||||
#include "absl/strings/string_view.h"
|
||||
#include "api/array_view.h"
|
||||
#include "api/rtc_event_log/rtc_event.h"
|
||||
#include "api/units/timestamp.h"
|
||||
#include "api/video/video_codec_type.h"
|
||||
@ -65,7 +65,7 @@ class RtcEventFrameDecoded final : public RtcEvent {
|
||||
VideoCodecType codec() const { return codec_; }
|
||||
uint8_t qp() const { return qp_; }
|
||||
|
||||
static std::string Encode(ArrayView<const RtcEvent*> /* batch */) {
|
||||
static std::string Encode(std::span<const RtcEvent*> /* batch */) {
|
||||
// TODO(terelius): Implement
|
||||
return "";
|
||||
}
|
||||
|
||||
@ -14,11 +14,11 @@
|
||||
#include <stdint.h>
|
||||
|
||||
#include <memory>
|
||||
#include <span>
|
||||
#include <string>
|
||||
#include <vector>
|
||||
|
||||
#include "absl/strings/string_view.h"
|
||||
#include "api/array_view.h"
|
||||
#include "api/rtc_event_log/rtc_event.h"
|
||||
#include "api/units/timestamp.h"
|
||||
#include "logging/rtc_event_log/events/rtc_event_log_parse_status.h"
|
||||
@ -73,7 +73,7 @@ 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(ArrayView<const RtcEvent*> /* batch */) {
|
||||
static std::string Encode(std::span<const RtcEvent*> /* batch */) {
|
||||
// TODO(terelius): Implement
|
||||
return "";
|
||||
}
|
||||
|
||||
@ -14,11 +14,11 @@
|
||||
#include <stdint.h>
|
||||
|
||||
#include <memory>
|
||||
#include <span>
|
||||
#include <string>
|
||||
#include <vector>
|
||||
|
||||
#include "absl/strings/string_view.h"
|
||||
#include "api/array_view.h"
|
||||
#include "api/candidate.h"
|
||||
#include "api/rtc_event_log/rtc_event.h"
|
||||
#include "api/units/timestamp.h"
|
||||
@ -118,7 +118,7 @@ class RtcEventIceCandidatePairConfig final : public RtcEvent {
|
||||
return candidate_pair_desc_;
|
||||
}
|
||||
|
||||
static std::string Encode(ArrayView<const RtcEvent*> /* batch */) {
|
||||
static std::string Encode(std::span<const RtcEvent*> /* batch */) {
|
||||
// TODO(terelius): Implement
|
||||
return "";
|
||||
}
|
||||
|
||||
@ -14,11 +14,11 @@
|
||||
#include <stdint.h>
|
||||
|
||||
#include <memory>
|
||||
#include <span>
|
||||
#include <string>
|
||||
#include <vector>
|
||||
|
||||
#include "absl/strings/string_view.h"
|
||||
#include "api/array_view.h"
|
||||
#include "api/rtc_event_log/rtc_event.h"
|
||||
#include "api/units/timestamp.h"
|
||||
#include "logging/rtc_event_log/events/rtc_event_log_parse_status.h"
|
||||
@ -69,7 +69,7 @@ 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(ArrayView<const RtcEvent*> /* batch */) {
|
||||
static std::string Encode(std::span<const RtcEvent*> /* batch */) {
|
||||
// TODO(terelius): Implement
|
||||
return "";
|
||||
}
|
||||
|
||||
@ -14,11 +14,11 @@
|
||||
#include <stdint.h>
|
||||
|
||||
#include <memory>
|
||||
#include <span>
|
||||
#include <string>
|
||||
#include <vector>
|
||||
|
||||
#include "absl/strings/string_view.h"
|
||||
#include "api/array_view.h"
|
||||
#include "api/rtc_event_log/rtc_event.h"
|
||||
#include "api/units/timestamp.h"
|
||||
#include "logging/rtc_event_log/events/rtc_event_log_parse_status.h"
|
||||
@ -63,7 +63,7 @@ class RtcEventProbeResultFailure final : public RtcEvent {
|
||||
int32_t id() const { return id_; }
|
||||
ProbeFailureReason failure_reason() const { return failure_reason_; }
|
||||
|
||||
static std::string Encode(ArrayView<const RtcEvent*> /* batch */) {
|
||||
static std::string Encode(std::span<const RtcEvent*> /* batch */) {
|
||||
// TODO(terelius): Implement
|
||||
return "";
|
||||
}
|
||||
|
||||
@ -14,11 +14,11 @@
|
||||
#include <stdint.h>
|
||||
|
||||
#include <memory>
|
||||
#include <span>
|
||||
#include <string>
|
||||
#include <vector>
|
||||
|
||||
#include "absl/strings/string_view.h"
|
||||
#include "api/array_view.h"
|
||||
#include "api/rtc_event_log/rtc_event.h"
|
||||
#include "api/units/timestamp.h"
|
||||
#include "logging/rtc_event_log/events/rtc_event_log_parse_status.h"
|
||||
@ -56,7 +56,7 @@ class RtcEventProbeResultSuccess final : public RtcEvent {
|
||||
int32_t id() const { return id_; }
|
||||
int32_t bitrate_bps() const { return bitrate_bps_; }
|
||||
|
||||
static std::string Encode(ArrayView<const RtcEvent*> /* batch */) {
|
||||
static std::string Encode(std::span<const RtcEvent*> /* batch */) {
|
||||
// TODO(terelius): Implement
|
||||
return "";
|
||||
}
|
||||
|
||||
@ -12,11 +12,11 @@
|
||||
|
||||
#include <cstdint>
|
||||
#include <optional>
|
||||
#include <span>
|
||||
#include <string>
|
||||
#include <vector>
|
||||
|
||||
#include "absl/strings/string_view.h"
|
||||
#include "api/array_view.h"
|
||||
#include "api/rtc_event_log/rtc_event.h"
|
||||
#include "api/units/data_rate.h"
|
||||
#include "api/units/timestamp.h"
|
||||
@ -48,7 +48,7 @@ class RtcEventRemoteEstimate final : public RtcEvent {
|
||||
Type GetType() const override { return kType; }
|
||||
bool IsConfigEvent() const override { return false; }
|
||||
|
||||
static std::string Encode(ArrayView<const RtcEvent*> /* batch */) {
|
||||
static std::string Encode(std::span<const RtcEvent*> /* batch */) {
|
||||
// TODO(terelius): Implement
|
||||
return "";
|
||||
}
|
||||
|
||||
@ -13,11 +13,11 @@
|
||||
|
||||
#include <cstdint>
|
||||
#include <memory>
|
||||
#include <span>
|
||||
#include <string>
|
||||
#include <vector>
|
||||
|
||||
#include "absl/strings/string_view.h"
|
||||
#include "api/array_view.h"
|
||||
#include "api/rtc_event_log/rtc_event.h"
|
||||
#include "api/units/timestamp.h"
|
||||
#include "logging/rtc_event_log/events/rtc_event_log_parse_status.h"
|
||||
@ -53,7 +53,7 @@ class RtcEventRouteChange final : public RtcEvent {
|
||||
bool connected() const { return connected_; }
|
||||
uint32_t overhead() const { return overhead_; }
|
||||
|
||||
static std::string Encode(ArrayView<const RtcEvent*> /* batch */) {
|
||||
static std::string Encode(std::span<const RtcEvent*> /* batch */) {
|
||||
// TODO(terelius): Implement
|
||||
return "";
|
||||
}
|
||||
|
||||
@ -12,15 +12,15 @@
|
||||
|
||||
#include <cstdint>
|
||||
#include <memory>
|
||||
#include <span>
|
||||
|
||||
#include "absl/memory/memory.h"
|
||||
#include "api/array_view.h"
|
||||
#include "api/rtc_event_log/rtc_event.h"
|
||||
|
||||
namespace webrtc {
|
||||
|
||||
RtcEventRtcpPacketIncoming::RtcEventRtcpPacketIncoming(
|
||||
ArrayView<const uint8_t> packet)
|
||||
std::span<const uint8_t> packet)
|
||||
: packet_(packet.data(), packet.size()) {}
|
||||
|
||||
RtcEventRtcpPacketIncoming::RtcEventRtcpPacketIncoming(
|
||||
|
||||
@ -14,11 +14,11 @@
|
||||
#include <stdint.h>
|
||||
|
||||
#include <memory>
|
||||
#include <span>
|
||||
#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_log_parse_status.h"
|
||||
@ -30,7 +30,7 @@ class RtcEventRtcpPacketIncoming final : public RtcEvent {
|
||||
public:
|
||||
static constexpr Type kType = Type::RtcpPacketIncoming;
|
||||
|
||||
explicit RtcEventRtcpPacketIncoming(ArrayView<const uint8_t> packet);
|
||||
explicit RtcEventRtcpPacketIncoming(std::span<const uint8_t> packet);
|
||||
~RtcEventRtcpPacketIncoming() override;
|
||||
|
||||
Type GetType() const override { return kType; }
|
||||
@ -40,7 +40,7 @@ class RtcEventRtcpPacketIncoming final : public RtcEvent {
|
||||
|
||||
const Buffer& packet() const { return packet_; }
|
||||
|
||||
static std::string Encode(ArrayView<const RtcEvent*> /* batch */) {
|
||||
static std::string Encode(std::span<const RtcEvent*> /* batch */) {
|
||||
// TODO(terelius): Implement
|
||||
return "";
|
||||
}
|
||||
|
||||
@ -12,15 +12,15 @@
|
||||
|
||||
#include <cstdint>
|
||||
#include <memory>
|
||||
#include <span>
|
||||
|
||||
#include "absl/memory/memory.h"
|
||||
#include "api/array_view.h"
|
||||
#include "api/rtc_event_log/rtc_event.h"
|
||||
|
||||
namespace webrtc {
|
||||
|
||||
RtcEventRtcpPacketOutgoing::RtcEventRtcpPacketOutgoing(
|
||||
ArrayView<const uint8_t> packet)
|
||||
std::span<const uint8_t> packet)
|
||||
: packet_(packet.data(), packet.size()) {}
|
||||
|
||||
RtcEventRtcpPacketOutgoing::RtcEventRtcpPacketOutgoing(
|
||||
|
||||
@ -14,11 +14,11 @@
|
||||
#include <stdint.h>
|
||||
|
||||
#include <memory>
|
||||
#include <span>
|
||||
#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_log_parse_status.h"
|
||||
@ -30,7 +30,7 @@ class RtcEventRtcpPacketOutgoing final : public RtcEvent {
|
||||
public:
|
||||
static constexpr Type kType = Type::RtcpPacketOutgoing;
|
||||
|
||||
explicit RtcEventRtcpPacketOutgoing(ArrayView<const uint8_t> packet);
|
||||
explicit RtcEventRtcpPacketOutgoing(std::span<const uint8_t> packet);
|
||||
~RtcEventRtcpPacketOutgoing() override;
|
||||
|
||||
Type GetType() const override { return kType; }
|
||||
@ -40,7 +40,7 @@ class RtcEventRtcpPacketOutgoing final : public RtcEvent {
|
||||
|
||||
const Buffer& packet() const { return packet_; }
|
||||
|
||||
static std::string Encode(ArrayView<const RtcEvent*> /* batch */) {
|
||||
static std::string Encode(std::span<const RtcEvent*> /* batch */) {
|
||||
// TODO(terelius): Implement
|
||||
return "";
|
||||
}
|
||||
|
||||
@ -16,12 +16,12 @@
|
||||
#include <map>
|
||||
#include <memory>
|
||||
#include <optional>
|
||||
#include <span>
|
||||
#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_log_parse_status.h"
|
||||
@ -47,8 +47,8 @@ class RtcEventRtpPacketIncoming final : public RtcEvent {
|
||||
|
||||
size_t packet_length() const { return packet_.size(); }
|
||||
|
||||
ArrayView<const uint8_t> RawHeader() const {
|
||||
return MakeArrayView(packet_.data(), header_length());
|
||||
std::span<const uint8_t> RawHeader() const {
|
||||
return std::span(packet_.data(), header_length());
|
||||
}
|
||||
uint32_t Ssrc() const { return packet_.Ssrc(); }
|
||||
uint32_t Timestamp() const { return packet_.Timestamp(); }
|
||||
@ -60,7 +60,7 @@ class RtcEventRtpPacketIncoming final : public RtcEvent {
|
||||
return packet_.GetExtension<ExtensionTrait>(std::forward<Args>(args)...);
|
||||
}
|
||||
template <typename ExtensionTrait>
|
||||
ArrayView<const uint8_t> GetRawExtension() const {
|
||||
std::span<const uint8_t> GetRawExtension() const {
|
||||
return packet_.GetRawExtension<ExtensionTrait>();
|
||||
}
|
||||
template <typename ExtensionTrait>
|
||||
@ -75,7 +75,7 @@ class RtcEventRtpPacketIncoming final : public RtcEvent {
|
||||
return rtx_original_sequence_number_;
|
||||
}
|
||||
|
||||
static std::string Encode(ArrayView<const RtcEvent*> /* batch */) {
|
||||
static std::string Encode(std::span<const RtcEvent*> /* batch */) {
|
||||
// TODO(terelius): Implement
|
||||
return "";
|
||||
}
|
||||
|
||||
@ -16,12 +16,12 @@
|
||||
#include <map>
|
||||
#include <memory>
|
||||
#include <optional>
|
||||
#include <span>
|
||||
#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_log_parse_status.h"
|
||||
@ -48,8 +48,8 @@ class RtcEventRtpPacketOutgoing final : public RtcEvent {
|
||||
|
||||
size_t packet_length() const { return packet_.size(); }
|
||||
|
||||
ArrayView<const uint8_t> RawHeader() const {
|
||||
return MakeArrayView(packet_.data(), header_length());
|
||||
std::span<const uint8_t> RawHeader() const {
|
||||
return std::span(packet_.data(), header_length());
|
||||
}
|
||||
uint32_t Ssrc() const { return packet_.Ssrc(); }
|
||||
uint32_t Timestamp() const { return packet_.Timestamp(); }
|
||||
@ -61,7 +61,7 @@ class RtcEventRtpPacketOutgoing final : public RtcEvent {
|
||||
return packet_.GetExtension<ExtensionTrait>(std::forward<Args>(args)...);
|
||||
}
|
||||
template <typename ExtensionTrait>
|
||||
ArrayView<const uint8_t> GetRawExtension() const {
|
||||
std::span<const uint8_t> GetRawExtension() const {
|
||||
return packet_.GetRawExtension<ExtensionTrait>();
|
||||
}
|
||||
template <typename ExtensionTrait>
|
||||
@ -77,7 +77,7 @@ class RtcEventRtpPacketOutgoing final : public RtcEvent {
|
||||
return rtx_original_sequence_number_;
|
||||
}
|
||||
|
||||
static std::string Encode(ArrayView<const RtcEvent*> /* batch */) {
|
||||
static std::string Encode(std::span<const RtcEvent*> /* batch */) {
|
||||
// TODO(terelius): Implement
|
||||
return "";
|
||||
}
|
||||
|
||||
@ -13,11 +13,11 @@
|
||||
|
||||
#include <cstdint>
|
||||
#include <memory>
|
||||
#include <span>
|
||||
#include <string>
|
||||
#include <vector>
|
||||
|
||||
#include "absl/strings/string_view.h"
|
||||
#include "api/array_view.h"
|
||||
#include "api/rtc_event_log/rtc_event.h"
|
||||
#include "api/units/timestamp.h"
|
||||
#include "logging/rtc_event_log/events/rtc_event_log_parse_status.h"
|
||||
@ -53,7 +53,7 @@ class RtcEventVideoReceiveStreamConfig final : public RtcEvent {
|
||||
|
||||
const rtclog::StreamConfig& config() const { return *config_; }
|
||||
|
||||
static std::string Encode(ArrayView<const RtcEvent*> /* batch */) {
|
||||
static std::string Encode(std::span<const RtcEvent*> /* batch */) {
|
||||
// TODO(terelius): Implement
|
||||
return "";
|
||||
}
|
||||
|
||||
@ -13,11 +13,11 @@
|
||||
|
||||
#include <cstdint>
|
||||
#include <memory>
|
||||
#include <span>
|
||||
#include <string>
|
||||
#include <vector>
|
||||
|
||||
#include "absl/strings/string_view.h"
|
||||
#include "api/array_view.h"
|
||||
#include "api/rtc_event_log/rtc_event.h"
|
||||
#include "api/units/timestamp.h"
|
||||
#include "logging/rtc_event_log/events/rtc_event_log_parse_status.h"
|
||||
@ -53,7 +53,7 @@ class RtcEventVideoSendStreamConfig final : public RtcEvent {
|
||||
|
||||
const rtclog::StreamConfig& config() const { return *config_; }
|
||||
|
||||
static std::string Encode(ArrayView<const RtcEvent*> /* batch */) {
|
||||
static std::string Encode(std::span<const RtcEvent*> /* batch */) {
|
||||
// TODO(terelius): Implement
|
||||
return "";
|
||||
}
|
||||
|
||||
@ -13,6 +13,7 @@
|
||||
#include <iostream>
|
||||
#include <memory>
|
||||
#include <optional>
|
||||
#include <span>
|
||||
#include <string>
|
||||
#include <vector>
|
||||
|
||||
@ -20,7 +21,6 @@
|
||||
#include "absl/flags/parse.h"
|
||||
#include "absl/flags/usage.h"
|
||||
#include "absl/strings/string_view.h"
|
||||
#include "api/array_view.h"
|
||||
#include "api/rtp_headers.h"
|
||||
#include "logging/rtc_event_log/events/logged_rtp_rtcp.h"
|
||||
#include "logging/rtc_event_log/rtc_event_log_parser.h"
|
||||
@ -108,7 +108,7 @@ void ConvertRtpPacket(
|
||||
reconstructed_packet.SetTimestamp(incoming.rtp.header.timestamp);
|
||||
reconstructed_packet.SetSsrc(incoming.rtp.header.ssrc);
|
||||
if (incoming.rtp.header.numCSRCs > 0) {
|
||||
reconstructed_packet.SetCsrcs(webrtc::ArrayView<const uint32_t>(
|
||||
reconstructed_packet.SetCsrcs(std::span<const uint32_t>(
|
||||
incoming.rtp.header.arrOfCSRCs, incoming.rtp.header.numCSRCs));
|
||||
}
|
||||
|
||||
|
||||
@ -17,12 +17,12 @@
|
||||
#include <memory>
|
||||
#include <numeric>
|
||||
#include <optional>
|
||||
#include <span>
|
||||
#include <utility>
|
||||
#include <vector>
|
||||
|
||||
#include "absl/algorithm/container.h"
|
||||
#include "absl/strings/string_view.h"
|
||||
#include "api/array_view.h"
|
||||
#include "api/candidate.h"
|
||||
#include "api/dtls_transport_interface.h"
|
||||
#include "api/rtc_event_log/rtc_event_log.h"
|
||||
@ -127,7 +127,7 @@ constexpr ExtensionPair kExtensions[kMaxNumExtensions] = {
|
||||
.name = RtpExtension::kDependencyDescriptorUri}};
|
||||
|
||||
template <typename T>
|
||||
void ShuffleInPlace(Random* prng, ArrayView<T> array) {
|
||||
void ShuffleInPlace(Random* prng, std::span<T> array) {
|
||||
RTC_DCHECK_LE(array.size(), std::numeric_limits<uint32_t>::max());
|
||||
for (uint32_t i = 0; i + 1 < array.size(); i++) {
|
||||
uint32_t other = prng->Rand(i, static_cast<uint32_t>(array.size() - 1));
|
||||
@ -657,7 +657,7 @@ RtpHeaderExtensionMap EventGenerator::NewRtpHeaderExtensionMap(
|
||||
std::vector<int> id(RtpExtension::kOneByteHeaderExtensionMaxId -
|
||||
RtpExtension::kMinId + 1);
|
||||
std::iota(id.begin(), id.end(), RtpExtension::kMinId);
|
||||
ShuffleInPlace(&prng_, ArrayView<int>(id));
|
||||
ShuffleInPlace(&prng_, std::span<int>(id));
|
||||
|
||||
auto not_excluded = [&](RTPExtensionType type) -> bool {
|
||||
return !absl::c_linear_search(excluded_extensions, type);
|
||||
@ -1031,7 +1031,7 @@ void EventVerifier::VerifyLoggedDependencyDescriptor(
|
||||
const Event& packet,
|
||||
const std::vector<uint8_t>& logged_dd) const {
|
||||
if (expect_dependency_descriptor_rtp_header_extension_is_set_) {
|
||||
ArrayView<const uint8_t> original =
|
||||
std::span<const uint8_t> original =
|
||||
packet.template GetRawExtension<RtpDependencyDescriptorExtension>();
|
||||
EXPECT_THAT(logged_dd, ElementsAreArray(original));
|
||||
} else {
|
||||
|
||||
Loading…
Reference in New Issue
Block a user