From 6f7bc08457fd89868c3bd14335905d4b195065e7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Niels=20M=C3=B6ller?= Date: Thu, 8 Feb 2018 09:44:42 +0100 Subject: [PATCH] Rewrite FakeVideoTrackSource to not use VideoCapturer. Bug: webrtc:6353 Change-Id: I992048868eebca1889e697950003b537b344bb53 Reviewed-on: https://webrtc-review.googlesource.com/49163 Commit-Queue: Niels Moller Reviewed-by: Taylor Brandstetter Reviewed-by: Peter Thatcher Cr-Commit-Position: refs/heads/master@{#21955} --- pc/test/fakevideotracksource.h | 20 +++++++++++++------- 1 file changed, 13 insertions(+), 7 deletions(-) diff --git a/pc/test/fakevideotracksource.h b/pc/test/fakevideotracksource.h index 46216c7366..62e3e50cf6 100644 --- a/pc/test/fakevideotracksource.h +++ b/pc/test/fakevideotracksource.h @@ -12,11 +12,13 @@ #define PC_TEST_FAKEVIDEOTRACKSOURCE_H_ #include "api/mediastreaminterface.h" -#include "media/base/fakevideocapturer.h" +#include "api/videosourceinterface.h" #include "pc/videotracksource.h" namespace webrtc { +// A minimal implementation of VideoTrackSource, which doesn't produce +// any frames. class FakeVideoTrackSource : public VideoTrackSource { public: static rtc::scoped_refptr Create(bool is_screencast) { @@ -27,20 +29,24 @@ class FakeVideoTrackSource : public VideoTrackSource { return Create(false); } - cricket::FakeVideoCapturer* fake_video_capturer() { - return &fake_video_capturer_; - } - bool is_screencast() const override { return is_screencast_; } protected: explicit FakeVideoTrackSource(bool is_screencast) - : VideoTrackSource(&fake_video_capturer_, false /* remote */), + : VideoTrackSource(&source_, false /* remote */), is_screencast_(is_screencast) {} virtual ~FakeVideoTrackSource() {} private: - cricket::FakeVideoCapturer fake_video_capturer_; + class Source : public rtc::VideoSourceInterface { + public: + void AddOrUpdateSink(rtc::VideoSinkInterface* sink, + const rtc::VideoSinkWants& wants) override {} + + void RemoveSink(rtc::VideoSinkInterface* sink) override {} + }; + + Source source_; const bool is_screencast_; };