blob: 4c56204e69b7b306a567748c73a5a0f2e212f734 [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
Steve Anton10542f22019-01-11 09:11:00 -080011#ifndef MEDIA_BASE_FAKE_FRAME_SOURCE_H_
12#define MEDIA_BASE_FAKE_FRAME_SOURCE_H_
Niels Möllera6cc0f92018-02-12 17:14:55 +010013
14#include "api/video/video_frame.h"
Steve Anton10542f22019-01-11 09:11:00 -080015#include "rtc_base/time_utils.h"
Niels Möllera6cc0f92018-02-12 17:14:55 +010016
17namespace cricket {
18
19class FakeFrameSource {
20 public:
Johannes Kron965e7942018-09-13 15:36:20 +020021 FakeFrameSource(int width,
22 int height,
23 int interval_us,
24 int64_t timestamp_offset_us);
Niels Möllera6cc0f92018-02-12 17:14:55 +010025 FakeFrameSource(int width, int height, int interval_us);
26
Niels Möller5c7efe72018-05-11 10:34:46 +020027 webrtc::VideoRotation GetRotation() const;
Niels Möllera6cc0f92018-02-12 17:14:55 +010028 void SetRotation(webrtc::VideoRotation rotation);
29
30 webrtc::VideoFrame GetFrame();
Niels Möller5c7efe72018-05-11 10:34:46 +020031 webrtc::VideoFrame GetFrameRotationApplied();
32
33 // Override configuration.
34 webrtc::VideoFrame GetFrame(int width,
35 int height,
36 webrtc::VideoRotation rotation,
37 int interval_us);
Niels Möllera6cc0f92018-02-12 17:14:55 +010038
39 private:
40 const int width_;
41 const int height_;
42 const int interval_us_;
43
44 webrtc::VideoRotation rotation_ = webrtc::kVideoRotation_0;
Johannes Kron965e7942018-09-13 15:36:20 +020045 int64_t next_timestamp_us_;
Niels Möllera6cc0f92018-02-12 17:14:55 +010046};
47
48} // namespace cricket
49
Steve Anton10542f22019-01-11 09:11:00 -080050#endif // MEDIA_BASE_FAKE_FRAME_SOURCE_H_