From d8bbc7858622b6d9c278469aab701ca0b609cddf Mon Sep 17 00:00:00 2001 From: Daniel Baumann Date: Wed, 15 May 2024 05:35:49 +0200 Subject: Merging upstream version 126.0. Signed-off-by: Daniel Baumann --- .../audio/default_audio_quality_analyzer.cc | 24 ++++++++++------------ .../video/video_quality_metrics_reporter.cc | 16 ++++++++------- 2 files changed, 20 insertions(+), 20 deletions(-) (limited to 'third_party/libwebrtc/test/pc/e2e/analyzer') diff --git a/third_party/libwebrtc/test/pc/e2e/analyzer/audio/default_audio_quality_analyzer.cc b/third_party/libwebrtc/test/pc/e2e/analyzer/audio/default_audio_quality_analyzer.cc index bca52d9bfc..93d8906d6a 100644 --- a/third_party/libwebrtc/test/pc/e2e/analyzer/audio/default_audio_quality_analyzer.cc +++ b/third_party/libwebrtc/test/pc/e2e/analyzer/audio/default_audio_quality_analyzer.cc @@ -42,29 +42,27 @@ void DefaultAudioQualityAnalyzer::OnStatsReports( auto stats = report->GetStatsOfType(); for (auto& stat : stats) { - if (!stat->kind.is_defined() || !(*stat->kind == "audio")) { + if (!stat->kind.has_value() || !(*stat->kind == "audio")) { continue; } StatsSample sample; - sample.total_samples_received = - stat->total_samples_received.ValueOrDefault(0ul); - sample.concealed_samples = stat->concealed_samples.ValueOrDefault(0ul); + sample.total_samples_received = stat->total_samples_received.value_or(0ul); + sample.concealed_samples = stat->concealed_samples.value_or(0ul); sample.removed_samples_for_acceleration = - stat->removed_samples_for_acceleration.ValueOrDefault(0ul); + stat->removed_samples_for_acceleration.value_or(0ul); sample.inserted_samples_for_deceleration = - stat->inserted_samples_for_deceleration.ValueOrDefault(0ul); + stat->inserted_samples_for_deceleration.value_or(0ul); sample.silent_concealed_samples = - stat->silent_concealed_samples.ValueOrDefault(0ul); + stat->silent_concealed_samples.value_or(0ul); sample.jitter_buffer_delay = - TimeDelta::Seconds(stat->jitter_buffer_delay.ValueOrDefault(0.)); + TimeDelta::Seconds(stat->jitter_buffer_delay.value_or(0.)); sample.jitter_buffer_target_delay = - TimeDelta::Seconds(stat->jitter_buffer_target_delay.ValueOrDefault(0.)); + TimeDelta::Seconds(stat->jitter_buffer_target_delay.value_or(0.)); sample.jitter_buffer_emitted_count = - stat->jitter_buffer_emitted_count.ValueOrDefault(0ul); - sample.total_samples_duration = - stat->total_samples_duration.ValueOrDefault(0.); - sample.total_audio_energy = stat->total_audio_energy.ValueOrDefault(0.); + stat->jitter_buffer_emitted_count.value_or(0ul); + sample.total_samples_duration = stat->total_samples_duration.value_or(0.); + sample.total_audio_energy = stat->total_audio_energy.value_or(0.); TrackIdStreamInfoMap::StreamInfo stream_info = analyzer_helper_->GetStreamInfoFromTrackId(*stat->track_identifier); diff --git a/third_party/libwebrtc/test/pc/e2e/analyzer/video/video_quality_metrics_reporter.cc b/third_party/libwebrtc/test/pc/e2e/analyzer/video/video_quality_metrics_reporter.cc index 817b3caad0..87f1590cb0 100644 --- a/third_party/libwebrtc/test/pc/e2e/analyzer/video/video_quality_metrics_reporter.cc +++ b/third_party/libwebrtc/test/pc/e2e/analyzer/video/video_quality_metrics_reporter.cc @@ -58,12 +58,14 @@ void VideoQualityMetricsReporter::OnStatsReports( auto transport_stats = report->GetStatsOfType(); if (transport_stats.size() == 0u || - !transport_stats[0]->selected_candidate_pair_id.is_defined()) { + !transport_stats[0]->selected_candidate_pair_id.has_value()) { return; } RTC_DCHECK_EQ(transport_stats.size(), 1); std::string selected_ice_id = - transport_stats[0]->selected_candidate_pair_id.ValueToString(); + transport_stats[0] + ->GetAttribute(transport_stats[0]->selected_candidate_pair_id) + .ToString(); // Use the selected ICE candidate pair ID to get the appropriate ICE stats. const RTCIceCandidatePairStats ice_candidate_pair_stats = report->Get(selected_ice_id)->cast_to(); @@ -71,7 +73,7 @@ void VideoQualityMetricsReporter::OnStatsReports( auto outbound_rtp_stats = report->GetStatsOfType(); StatsSample sample; for (auto& s : outbound_rtp_stats) { - if (!s->kind.is_defined()) { + if (!s->kind.has_value()) { continue; } if (!(*s->kind == "video")) { @@ -81,15 +83,15 @@ void VideoQualityMetricsReporter::OnStatsReports( sample.sample_time = s->timestamp(); } sample.retransmitted_bytes_sent += - DataSize::Bytes(s->retransmitted_bytes_sent.ValueOrDefault(0ul)); - sample.bytes_sent += DataSize::Bytes(s->bytes_sent.ValueOrDefault(0ul)); + DataSize::Bytes(s->retransmitted_bytes_sent.value_or(0ul)); + sample.bytes_sent += DataSize::Bytes(s->bytes_sent.value_or(0ul)); sample.header_bytes_sent += - DataSize::Bytes(s->header_bytes_sent.ValueOrDefault(0ul)); + DataSize::Bytes(s->header_bytes_sent.value_or(0ul)); } MutexLock lock(&video_bwe_stats_lock_); VideoBweStats& video_bwe_stats = video_bwe_stats_[std::string(pc_label)]; - if (ice_candidate_pair_stats.available_outgoing_bitrate.is_defined()) { + if (ice_candidate_pair_stats.available_outgoing_bitrate.has_value()) { video_bwe_stats.available_send_bandwidth.AddSample( DataRate::BitsPerSec( *ice_candidate_pair_stats.available_outgoing_bitrate) -- cgit v1.2.3