Switch to SendTask instead of manually waiting for event.
Bug: webrtc:10349 Change-Id: I128856d2baf221d67e957ce0614b075ecef3c5fc Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/131140 Reviewed-by: Mirta Dvornicic <mirtad@webrtc.org> Commit-Queue: Rasmus Brandt <brandtr@webrtc.org> Cr-Commit-Position: refs/heads/master@{#27439}
This commit is contained in:

committed by
Commit Bot

parent
0682850c77
commit
fd720b2406
@ -652,7 +652,6 @@ if (rtc_include_tests) {
|
|||||||
"../../rtc_base:checks",
|
"../../rtc_base:checks",
|
||||||
"../../rtc_base:rtc_base_approved",
|
"../../rtc_base:rtc_base_approved",
|
||||||
"../../rtc_base:rtc_base_tests_utils",
|
"../../rtc_base:rtc_base_tests_utils",
|
||||||
"../../rtc_base:rtc_event",
|
|
||||||
"../../rtc_base:task_queue_for_test",
|
"../../rtc_base:task_queue_for_test",
|
||||||
"../../system_wrappers",
|
"../../system_wrappers",
|
||||||
"../../test:fileutils",
|
"../../test:fileutils",
|
||||||
|
@ -37,7 +37,6 @@
|
|||||||
#include "modules/video_coding/utility/ivf_file_writer.h"
|
#include "modules/video_coding/utility/ivf_file_writer.h"
|
||||||
#include "rtc_base/checks.h"
|
#include "rtc_base/checks.h"
|
||||||
#include "rtc_base/cpu_time.h"
|
#include "rtc_base/cpu_time.h"
|
||||||
#include "rtc_base/event.h"
|
|
||||||
#include "rtc_base/strings/string_builder.h"
|
#include "rtc_base/strings/string_builder.h"
|
||||||
#include "rtc_base/time_utils.h"
|
#include "rtc_base/time_utils.h"
|
||||||
#include "system_wrappers/include/cpu_info.h"
|
#include "system_wrappers/include/cpu_info.h"
|
||||||
@ -418,7 +417,7 @@ void VideoCodecTestFixtureImpl::RunTest(
|
|||||||
}
|
}
|
||||||
|
|
||||||
void VideoCodecTestFixtureImpl::ProcessAllFrames(
|
void VideoCodecTestFixtureImpl::ProcessAllFrames(
|
||||||
rtc::TaskQueue* task_queue,
|
TaskQueueForTest* task_queue,
|
||||||
const std::vector<RateProfile>& rate_profiles) {
|
const std::vector<RateProfile>& rate_profiles) {
|
||||||
// Set initial rates.
|
// Set initial rates.
|
||||||
auto rate_profile = rate_profiles.begin();
|
auto rate_profile = rate_profiles.begin();
|
||||||
@ -450,9 +449,7 @@ void VideoCodecTestFixtureImpl::ProcessAllFrames(
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Wait until we know that the last frame has been sent for encode.
|
// Wait until we know that the last frame has been sent for encode.
|
||||||
rtc::Event sync_event;
|
task_queue->SendTask([] {});
|
||||||
task_queue->PostTask([&sync_event] { sync_event.Set(); });
|
|
||||||
sync_event.Wait(rtc::Event::kForever);
|
|
||||||
|
|
||||||
// Give the VideoProcessor pipeline some time to process the last frame,
|
// Give the VideoProcessor pipeline some time to process the last frame,
|
||||||
// and then release the codecs.
|
// and then release the codecs.
|
||||||
|
@ -66,7 +66,7 @@ class VideoCodecTestFixtureImpl : public VideoCodecTestFixture {
|
|||||||
int initial_framerate_fps);
|
int initial_framerate_fps);
|
||||||
void ReleaseAndCloseObjects(TaskQueueForTest* task_queue);
|
void ReleaseAndCloseObjects(TaskQueueForTest* task_queue);
|
||||||
|
|
||||||
void ProcessAllFrames(rtc::TaskQueue* task_queue,
|
void ProcessAllFrames(TaskQueueForTest* task_queue,
|
||||||
const std::vector<RateProfile>& rate_profiles);
|
const std::vector<RateProfile>& rate_profiles);
|
||||||
void AnalyzeAllFrames(
|
void AnalyzeAllFrames(
|
||||||
const std::vector<RateProfile>& rate_profiles,
|
const std::vector<RateProfile>& rate_profiles,
|
||||||
|
Reference in New Issue
Block a user