blob: fb433ae436395b6d0bb6aafd0afb1c754f46106d [file] [log] [blame]
Niels Möllera6cc0f92018-02-12 17:14:55 +01001/*
2 * Copyright (c) 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 MEDIA_BASE_FAKEFRAMESOURCE_H_
12#define MEDIA_BASE_FAKEFRAMESOURCE_H_
13
14#include "api/video/video_frame.h"
15
16#include "rtc_base/timeutils.h"
17
18namespace cricket {
19
20class FakeFrameSource {
21 public:
Johannes Kron965e7942018-09-13 15:36:20 +020022 FakeFrameSource(int width,
23 int height,
24 int interval_us,
25 int64_t timestamp_offset_us);
Niels Möllera6cc0f92018-02-12 17:14:55 +010026 FakeFrameSource(int width, int height, int interval_us);
27
Niels Möller5c7efe72018-05-11 10:34:46 +020028 webrtc::VideoRotation GetRotation() const;
Niels Möllera6cc0f92018-02-12 17:14:55 +010029 void SetRotation(webrtc::VideoRotation rotation);
30
31 webrtc::VideoFrame GetFrame();
Niels Möller5c7efe72018-05-11 10:34:46 +020032 webrtc::VideoFrame GetFrameRotationApplied();
33
34 // Override configuration.
35 webrtc::VideoFrame GetFrame(int width,
36 int height,
37 webrtc::VideoRotation rotation,
38 int interval_us);
Niels Möllera6cc0f92018-02-12 17:14:55 +010039
40 private:
41 const int width_;
42 const int height_;
43 const int interval_us_;
44
45 webrtc::VideoRotation rotation_ = webrtc::kVideoRotation_0;
Johannes Kron965e7942018-09-13 15:36:20 +020046 int64_t next_timestamp_us_;
Niels Möllera6cc0f92018-02-12 17:14:55 +010047};
48
49} // namespace cricket
50
51#endif // MEDIA_BASE_FAKEFRAMESOURCE_H_