Use explicit TaskQueueFactory for FrameGeneratorCapturer in test/pc/e2e
This replaces the implicit usage of GlobalTaskQueueFactory Bug: webrtc:10284 Change-Id: I04f04208c852d9e4917a9b1dc555c72bfc28fb7c Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/133577 Reviewed-by: Artem Titov <titovartem@webrtc.org> Commit-Queue: Danil Chapovalov <danilchap@webrtc.org> Cr-Commit-Position: refs/heads/master@{#27707}
This commit is contained in:
parent
b4a70ed643
commit
d0e0ed82af
@ -243,6 +243,8 @@ if (rtc_include_tests) {
|
||||
"../../../api:peer_connection_quality_test_fixture_api",
|
||||
"../../../api:scoped_refptr",
|
||||
"../../../api:video_quality_analyzer_api",
|
||||
"../../../api/task_queue",
|
||||
"../../../api/task_queue:default_task_queue_factory",
|
||||
"../../../api/units:time_delta",
|
||||
"../../../api/units:timestamp",
|
||||
"../../../logging:rtc_event_log_api",
|
||||
|
||||
@ -17,6 +17,7 @@
|
||||
#include "api/media_stream_interface.h"
|
||||
#include "api/peer_connection_interface.h"
|
||||
#include "api/scoped_refptr.h"
|
||||
#include "api/task_queue/default_task_queue_factory.h"
|
||||
#include "api/test/video_quality_analyzer_interface.h"
|
||||
#include "api/units/time_delta.h"
|
||||
#include "logging/rtc_event_log/output/rtc_event_log_output_file.h"
|
||||
@ -102,6 +103,7 @@ PeerConnectionE2EQualityTest::PeerConnectionE2EQualityTest(
|
||||
std::unique_ptr<AudioQualityAnalyzerInterface> audio_quality_analyzer,
|
||||
std::unique_ptr<VideoQualityAnalyzerInterface> video_quality_analyzer)
|
||||
: clock_(Clock::GetRealTimeClock()),
|
||||
task_queue_factory_(CreateDefaultTaskQueueFactory()),
|
||||
test_case_name_(std::move(test_case_name)) {
|
||||
// Create default video quality analyzer. We will always create an analyzer,
|
||||
// even if there are no video streams, because it will be installed into video
|
||||
@ -549,12 +551,13 @@ PeerConnectionE2EQualityTest::MaybeAddVideo(TestPeer* peer) {
|
||||
writer);
|
||||
|
||||
// Setup FrameGenerator into peer connection.
|
||||
std::unique_ptr<test::FrameGeneratorCapturer> capturer =
|
||||
absl::WrapUnique(test::FrameGeneratorCapturer::Create(
|
||||
std::move(frame_generator), video_config.fps, clock_));
|
||||
auto capturer = absl::make_unique<test::FrameGeneratorCapturer>(
|
||||
clock_, std::move(frame_generator), video_config.fps,
|
||||
*task_queue_factory_);
|
||||
capturer->Init();
|
||||
rtc::scoped_refptr<FrameGeneratorCapturerVideoTrackSource> source =
|
||||
new rtc::RefCountedObject<FrameGeneratorCapturerVideoTrackSource>(
|
||||
move(capturer));
|
||||
std::move(capturer));
|
||||
out.push_back(source);
|
||||
RTC_LOG(INFO) << "Adding video with video_config.stream_label="
|
||||
<< video_config.stream_label.value();
|
||||
|
||||
@ -16,6 +16,7 @@
|
||||
#include <vector>
|
||||
|
||||
#include "absl/memory/memory.h"
|
||||
#include "api/task_queue/task_queue_factory.h"
|
||||
#include "api/test/audio_quality_analyzer_interface.h"
|
||||
#include "api/test/peerconnection_quality_test_fixture.h"
|
||||
#include "api/units/time_delta.h"
|
||||
@ -219,6 +220,7 @@ class PeerConnectionE2EQualityTest
|
||||
Timestamp Now() const;
|
||||
|
||||
Clock* const clock_;
|
||||
const std::unique_ptr<TaskQueueFactory> task_queue_factory_;
|
||||
std::string test_case_name_;
|
||||
std::unique_ptr<VideoQualityAnalyzerInjectionHelper>
|
||||
video_quality_analyzer_injection_helper_;
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user