blob: ab428d806a506df20ba9a94f364b2b2ec84c004d [file] [log] [blame]
Niels Möller0f405822018-05-17 09:16:41 +02001/*
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_FAKEPERIODICVIDEOTRACKSOURCE_H_
12#define PC_TEST_FAKEPERIODICVIDEOTRACKSOURCE_H_
13
Niels Möller0f405822018-05-17 09:16:41 +020014#include "pc/test/fakeperiodicvideosource.h"
Yves Gerey665174f2018-06-19 15:03:05 +020015#include "pc/videotracksource.h"
Niels Möller0f405822018-05-17 09:16:41 +020016
17namespace webrtc {
18
19// A VideoTrackSource generating frames with configured size and frame interval.
20class FakePeriodicVideoTrackSource : public VideoTrackSource {
21 public:
22 explicit FakePeriodicVideoTrackSource(bool remote)
23 : FakePeriodicVideoTrackSource(FakePeriodicVideoSource::Config(),
24 remote) {}
25
26 FakePeriodicVideoTrackSource(FakePeriodicVideoSource::Config config,
27 bool remote)
Niels Möller5d67f822018-05-23 16:28:17 +020028 : VideoTrackSource(remote), source_(config) {}
Niels Möller0f405822018-05-17 09:16:41 +020029
30 ~FakePeriodicVideoTrackSource() = default;
31
Niels Möller5d67f822018-05-23 16:28:17 +020032 protected:
33 rtc::VideoSourceInterface<VideoFrame>* source() override { return &source_; }
34
Niels Möller0f405822018-05-17 09:16:41 +020035 private:
36 FakePeriodicVideoSource source_;
37};
38
39} // namespace webrtc
40
41#endif // PC_TEST_FAKEPERIODICVIDEOTRACKSOURCE_H_