Removes unused factories and constructor from FrameGeneratorCapturer.
to remove dependency on GlobalTaskQueueFactory Bug: webrtc:10284 Change-Id: I9a7e4431cd62df20bec706b0ffcc677bd3c7d311 Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/133903 Commit-Queue: Danil Chapovalov <danilchap@webrtc.org> Reviewed-by: Sebastian Jansson <srte@webrtc.org> Cr-Commit-Position: refs/heads/master@{#27718}
This commit is contained in:

committed by
Commit Bot

parent
d51ec589d6
commit
59b64d32fc
@ -55,7 +55,6 @@ rtc_source_set("video_test_common") {
|
||||
"../api:libjingle_peerconnection_api",
|
||||
"../api:scoped_refptr",
|
||||
"../api/task_queue",
|
||||
"../api/task_queue:global_task_queue_factory",
|
||||
"../api/video:video_frame",
|
||||
"../api/video:video_frame_i010",
|
||||
"../api/video:video_frame_i420",
|
||||
|
@ -16,8 +16,6 @@
|
||||
#include <utility>
|
||||
#include <vector>
|
||||
|
||||
#include "absl/memory/memory.h"
|
||||
#include "api/task_queue/global_task_queue_factory.h"
|
||||
#include "rtc_base/checks.h"
|
||||
#include "rtc_base/critical_section.h"
|
||||
#include "rtc_base/logging.h"
|
||||
@ -29,77 +27,6 @@
|
||||
namespace webrtc {
|
||||
namespace test {
|
||||
|
||||
FrameGeneratorCapturer* FrameGeneratorCapturer::Create(
|
||||
int width,
|
||||
int height,
|
||||
absl::optional<FrameGenerator::OutputType> type,
|
||||
absl::optional<int> num_squares,
|
||||
int target_fps,
|
||||
Clock* clock) {
|
||||
auto capturer = absl::make_unique<FrameGeneratorCapturer>(
|
||||
clock,
|
||||
FrameGenerator::CreateSquareGenerator(width, height, type, num_squares),
|
||||
target_fps);
|
||||
if (!capturer->Init())
|
||||
return nullptr;
|
||||
|
||||
return capturer.release();
|
||||
}
|
||||
|
||||
FrameGeneratorCapturer* FrameGeneratorCapturer::CreateFromYuvFile(
|
||||
const std::string& file_name,
|
||||
size_t width,
|
||||
size_t height,
|
||||
int target_fps,
|
||||
Clock* clock) {
|
||||
auto capturer = absl::make_unique<FrameGeneratorCapturer>(
|
||||
clock,
|
||||
FrameGenerator::CreateFromYuvFile(std::vector<std::string>(1, file_name),
|
||||
width, height, 1),
|
||||
target_fps);
|
||||
if (!capturer->Init())
|
||||
return nullptr;
|
||||
|
||||
return capturer.release();
|
||||
}
|
||||
|
||||
FrameGeneratorCapturer* FrameGeneratorCapturer::CreateSlideGenerator(
|
||||
int width,
|
||||
int height,
|
||||
int frame_repeat_count,
|
||||
int target_fps,
|
||||
Clock* clock) {
|
||||
auto capturer = absl::make_unique<FrameGeneratorCapturer>(
|
||||
clock,
|
||||
FrameGenerator::CreateSlideGenerator(width, height, frame_repeat_count),
|
||||
target_fps);
|
||||
if (!capturer->Init())
|
||||
return nullptr;
|
||||
|
||||
return capturer.release();
|
||||
}
|
||||
|
||||
FrameGeneratorCapturer* FrameGeneratorCapturer::Create(
|
||||
std::unique_ptr<FrameGenerator> frame_generator,
|
||||
int target_fps,
|
||||
Clock* clock) {
|
||||
auto capturer = absl::make_unique<FrameGeneratorCapturer>(
|
||||
clock, std::move(frame_generator), target_fps);
|
||||
if (!capturer->Init())
|
||||
return nullptr;
|
||||
|
||||
return capturer.release();
|
||||
}
|
||||
|
||||
FrameGeneratorCapturer::FrameGeneratorCapturer(
|
||||
Clock* clock,
|
||||
std::unique_ptr<FrameGenerator> frame_generator,
|
||||
int target_fps)
|
||||
: FrameGeneratorCapturer(clock,
|
||||
std::move(frame_generator),
|
||||
target_fps,
|
||||
GlobalTaskQueueFactory()) {}
|
||||
|
||||
FrameGeneratorCapturer::FrameGeneratorCapturer(
|
||||
Clock* clock,
|
||||
std::unique_ptr<FrameGenerator> frame_generator,
|
||||
|
@ -39,33 +39,10 @@ class FrameGeneratorCapturer : public TestVideoCapturer {
|
||||
virtual ~SinkWantsObserver() {}
|
||||
};
|
||||
|
||||
// |type| has the default value OutputType::I420. |num_squares| has the
|
||||
// default value 10.
|
||||
static FrameGeneratorCapturer* Create(
|
||||
int width,
|
||||
int height,
|
||||
absl::optional<FrameGenerator::OutputType> type,
|
||||
absl::optional<int> num_squares,
|
||||
int target_fps,
|
||||
Clock* clock);
|
||||
|
||||
static FrameGeneratorCapturer* CreateFromYuvFile(const std::string& file_name,
|
||||
size_t width,
|
||||
size_t height,
|
||||
int target_fps,
|
||||
Clock* clock);
|
||||
|
||||
static FrameGeneratorCapturer* CreateSlideGenerator(int width,
|
||||
int height,
|
||||
int frame_repeat_count,
|
||||
int target_fps,
|
||||
Clock* clock);
|
||||
|
||||
static FrameGeneratorCapturer* Create(
|
||||
std::unique_ptr<FrameGenerator> frame_generator,
|
||||
int target_fps,
|
||||
Clock* clock);
|
||||
|
||||
FrameGeneratorCapturer(Clock* clock,
|
||||
std::unique_ptr<FrameGenerator> frame_generator,
|
||||
int target_fps,
|
||||
TaskQueueFactory& task_queue_factory);
|
||||
virtual ~FrameGeneratorCapturer();
|
||||
|
||||
void Start();
|
||||
@ -85,13 +62,6 @@ class FrameGeneratorCapturer : public TestVideoCapturer {
|
||||
|
||||
int64_t first_frame_capture_time() const { return first_frame_capture_time_; }
|
||||
|
||||
FrameGeneratorCapturer(Clock* clock,
|
||||
std::unique_ptr<FrameGenerator> frame_generator,
|
||||
int target_fps);
|
||||
FrameGeneratorCapturer(Clock* clock,
|
||||
std::unique_ptr<FrameGenerator> frame_generator,
|
||||
int target_fps,
|
||||
TaskQueueFactory& task_queue_factory);
|
||||
bool Init();
|
||||
|
||||
private:
|
||||
|
Reference in New Issue
Block a user