Fix CallClient so that it calls Call::GetStats() on the right thread.

Bug: webrtc:10847
Change-Id: Id23a389b4d5bad8f2211b5ec87b37aefc81a9292
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/148065
Commit-Queue: Tommi <tommi@webrtc.org>
Reviewed-by: Mirko Bonadei <mbonadei@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#28772}
This commit is contained in:
Tommi 2019-08-06 12:44:35 +02:00 committed by Commit Bot
parent a22cab8a65
commit e6b7b6678c
2 changed files with 5 additions and 2 deletions

View File

@ -241,7 +241,10 @@ ColumnPrinter CallClient::StatsPrinter() {
}
Call::Stats CallClient::GetStats() {
return call_->GetStats();
// This call needs to be made on the thread that |call_| was constructed on.
Call::Stats stats;
SendTask([this, &stats] { stats = call_->GetStats(); });
return stats;
}
DataRate CallClient::target_rate() const {

View File

@ -78,7 +78,7 @@ TEST(ScenarioAnalyzerTest, PsnrIsLowWhenNetworkIsBad) {
EXPECT_NEAR(stats.call.stats().target_rate.Mean().kbps(), 75, 50);
EXPECT_NEAR(stats.video_send.stats().media_bitrate.Mean().kbps(), 100, 50);
EXPECT_NEAR(stats.video_receive.stats().resolution.Mean(), 180, 10);
EXPECT_NEAR(stats.audio_receive.stats().jitter_buffer.Mean().ms(), 45, 20);
EXPECT_NEAR(stats.audio_receive.stats().jitter_buffer.Mean().ms(), 45, 25);
}
TEST(ScenarioAnalyzerTest, CountsCapturedButNotRendered) {