Rewrite FakeVideoTrackSource to not use VideoCapturer.
Bug: webrtc:6353
Change-Id: I992048868eebca1889e697950003b537b344bb53
Reviewed-on: https://webrtc-review.googlesource.com/49163
Commit-Queue: Niels Moller <nisse@webrtc.org>
Reviewed-by: Taylor Brandstetter <deadbeef@webrtc.org>
Reviewed-by: Peter Thatcher <pthatcher@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#21955}
diff --git a/pc/test/fakevideotracksource.h b/pc/test/fakevideotracksource.h
index 46216c7..62e3e50 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<FakeVideoTrackSource> Create(bool is_screencast) {
@@ -27,20 +29,24 @@
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<VideoFrame> {
+ public:
+ void AddOrUpdateSink(rtc::VideoSinkInterface<VideoFrame>* sink,
+ const rtc::VideoSinkWants& wants) override {}
+
+ void RemoveSink(rtc::VideoSinkInterface<VideoFrame>* sink) override {}
+ };
+
+ Source source_;
const bool is_screencast_;
};