Post corruption score aggregation to worker thread.
Bug: webrtc:358039777 Change-Id: Ia7196436aaa024019869a7521243da0576dbb148 Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/365600 Reviewed-by: Erik Språng <sprang@webrtc.org> Commit-Queue: Åsa Persson <asapersson@webrtc.org> Auto-Submit: Emil Vardar (xWF) <vardar@google.com> Reviewed-by: Åsa Persson <asapersson@webrtc.org> Cr-Commit-Position: refs/heads/main@{#43238}
This commit is contained in:
parent
6f99dba4c2
commit
129f228f59
@ -825,6 +825,8 @@ void ReceiveStatisticsProxy::OnRttUpdate(int64_t avg_rtt_ms) {
|
|||||||
|
|
||||||
void ReceiveStatisticsProxy::OnCorruptionScore(double corruption_score,
|
void ReceiveStatisticsProxy::OnCorruptionScore(double corruption_score,
|
||||||
VideoContentType content_type) {
|
VideoContentType content_type) {
|
||||||
|
worker_thread_->PostTask(SafeTask(task_safety_.flag(), [corruption_score,
|
||||||
|
content_type, this] {
|
||||||
RTC_DCHECK_RUN_ON(&main_thread_);
|
RTC_DCHECK_RUN_ON(&main_thread_);
|
||||||
|
|
||||||
if (!stats_.corruption_score_sum.has_value()) {
|
if (!stats_.corruption_score_sum.has_value()) {
|
||||||
@ -840,6 +842,7 @@ void ReceiveStatisticsProxy::OnCorruptionScore(double corruption_score,
|
|||||||
ContentSpecificStats* content_specific_stats =
|
ContentSpecificStats* content_specific_stats =
|
||||||
&content_specific_stats_[content_type];
|
&content_specific_stats_[content_type];
|
||||||
content_specific_stats->corruption_score.AddSample(corruption_score);
|
content_specific_stats->corruption_score.AddSample(corruption_score);
|
||||||
|
}));
|
||||||
}
|
}
|
||||||
|
|
||||||
void ReceiveStatisticsProxy::DecoderThreadStarting() {
|
void ReceiveStatisticsProxy::DecoderThreadStarting() {
|
||||||
|
|||||||
@ -555,6 +555,8 @@ TEST_F(ReceiveStatisticsProxyTest, GetStatsReportsOnCorruptionScore) {
|
|||||||
VideoContentType::UNSPECIFIED);
|
VideoContentType::UNSPECIFIED);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
time_controller_.AdvanceTime(TimeDelta::Zero());
|
||||||
|
|
||||||
VideoReceiveStreamInterface::Stats stats = statistics_proxy_->GetStats();
|
VideoReceiveStreamInterface::Stats stats = statistics_proxy_->GetStats();
|
||||||
EXPECT_THAT(kExpectedCorruptionScoreSum,
|
EXPECT_THAT(kExpectedCorruptionScoreSum,
|
||||||
DoubleEq(*stats.corruption_score_sum));
|
DoubleEq(*stats.corruption_score_sum));
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user