mirror of
https://github.com/mollyim/webrtc.git
synced 2025-05-20 09:07:52 +01:00
Fix CallPerfTests to call Call::GetStats() from the right thread.
Bug: webrtc:10847 Change-Id: Ic44d9b644aff981ec570c98c2486bb8be787ac68 Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/148066 Reviewed-by: Magnus Flodman <mflodman@webrtc.org> Commit-Queue: Tommi <tommi@webrtc.org> Cr-Commit-Position: refs/heads/master@{#28785}
This commit is contained in:
parent
c653172e74
commit
c24a5b18ba
1 changed files with 19 additions and 13 deletions
|
@ -860,19 +860,22 @@ void CallPerfTest::TestMinAudioVideoBitrate(int test_bitrate_from,
|
|||
|
||||
class MinVideoAndAudioBitrateTester : public test::EndToEndTest {
|
||||
public:
|
||||
MinVideoAndAudioBitrateTester(int test_bitrate_from,
|
||||
int test_bitrate_to,
|
||||
int test_bitrate_step,
|
||||
int min_bwe,
|
||||
int start_bwe,
|
||||
int max_bwe)
|
||||
MinVideoAndAudioBitrateTester(
|
||||
int test_bitrate_from,
|
||||
int test_bitrate_to,
|
||||
int test_bitrate_step,
|
||||
int min_bwe,
|
||||
int start_bwe,
|
||||
int max_bwe,
|
||||
test::SingleThreadedTaskQueueForTesting* task_queue)
|
||||
: EndToEndTest(),
|
||||
test_bitrate_from_(test_bitrate_from),
|
||||
test_bitrate_to_(test_bitrate_to),
|
||||
test_bitrate_step_(test_bitrate_step),
|
||||
min_bwe_(min_bwe),
|
||||
start_bwe_(start_bwe),
|
||||
max_bwe_(max_bwe) {}
|
||||
max_bwe_(max_bwe),
|
||||
task_queue_(task_queue) {}
|
||||
|
||||
protected:
|
||||
BuiltInNetworkBehaviorConfig GetFakeNetworkPipeConfig() {
|
||||
|
@ -922,15 +925,17 @@ void CallPerfTest::TestMinAudioVideoBitrate(int test_bitrate_from,
|
|||
send_simulated_network_->SetConfig(pipe_config);
|
||||
receive_simulated_network_->SetConfig(pipe_config);
|
||||
|
||||
rtc::ThreadManager::Instance()->CurrentThread()->SleepMs(
|
||||
quick_perf_test ? kShortDelayMs : kBitrateStabilizationMs);
|
||||
rtc::Thread::SleepMs(quick_perf_test ? kShortDelayMs
|
||||
: kBitrateStabilizationMs);
|
||||
|
||||
int64_t avg_rtt = 0;
|
||||
for (int i = 0; i < kBitrateMeasurements; i++) {
|
||||
Call::Stats call_stats = sender_call_->GetStats();
|
||||
Call::Stats call_stats;
|
||||
task_queue_->SendTask(
|
||||
[this, &call_stats]() { call_stats = sender_call_->GetStats(); });
|
||||
avg_rtt += call_stats.rtt_ms;
|
||||
rtc::ThreadManager::Instance()->CurrentThread()->SleepMs(
|
||||
quick_perf_test ? kShortDelayMs : kBitrateMeasurementMs);
|
||||
rtc::Thread::SleepMs(quick_perf_test ? kShortDelayMs
|
||||
: kBitrateMeasurementMs);
|
||||
}
|
||||
avg_rtt = avg_rtt / kBitrateMeasurements;
|
||||
if (avg_rtt > kMinGoodRttMs) {
|
||||
|
@ -976,8 +981,9 @@ void CallPerfTest::TestMinAudioVideoBitrate(int test_bitrate_from,
|
|||
SimulatedNetwork* send_simulated_network_;
|
||||
SimulatedNetwork* receive_simulated_network_;
|
||||
Call* sender_call_;
|
||||
test::SingleThreadedTaskQueueForTesting* const task_queue_;
|
||||
} test(test_bitrate_from, test_bitrate_to, test_bitrate_step, min_bwe,
|
||||
start_bwe, max_bwe);
|
||||
start_bwe, max_bwe, &task_queue_);
|
||||
|
||||
RunBaseTest(&test);
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue