1 /* 2 * Copyright 2018 The WebRTC project authors. All Rights Reserved. 3 * 4 * Use of this source code is governed by a BSD-style license 5 * that can be found in the LICENSE file in the root of the source 6 * tree. An additional intellectual property rights grant can be found 7 * in the file PATENTS. All contributing project authors may 8 * be found in the AUTHORS file in the root of the source tree. 9 */ 10 11 #ifndef PC_TEST_FAKE_PERIODIC_VIDEO_TRACK_SOURCE_H_ 12 #define PC_TEST_FAKE_PERIODIC_VIDEO_TRACK_SOURCE_H_ 13 14 #include "pc/test/fake_periodic_video_source.h" 15 #include "pc/video_track_source.h" 16 17 namespace webrtc { 18 19 // A VideoTrackSource generating frames with configured size and frame interval. 20 class FakePeriodicVideoTrackSource : public VideoTrackSource { 21 public: FakePeriodicVideoTrackSource(bool remote)22 explicit FakePeriodicVideoTrackSource(bool remote) 23 : FakePeriodicVideoTrackSource(FakePeriodicVideoSource::Config(), 24 remote) {} 25 FakePeriodicVideoTrackSource(FakePeriodicVideoSource::Config config,bool remote)26 FakePeriodicVideoTrackSource(FakePeriodicVideoSource::Config config, 27 bool remote) 28 : VideoTrackSource(remote), source_(config) {} 29 30 ~FakePeriodicVideoTrackSource() = default; 31 fake_periodic_source()32 const FakePeriodicVideoSource& fake_periodic_source() const { 33 return source_; 34 } 35 36 protected: source()37 rtc::VideoSourceInterface<VideoFrame>* source() override { return &source_; } 38 39 private: 40 FakePeriodicVideoSource source_; 41 }; 42 43 } // namespace webrtc 44 45 #endif // PC_TEST_FAKE_PERIODIC_VIDEO_TRACK_SOURCE_H_ 46