blob: 6d8da3d621edbfefdd85c68157f94f9b7ab7e478 [file] [log] [blame]
Artem Titov503d7232019-12-04 12:37:13 +01001/*
2 * Copyright (c) 2019 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 API_TEST_FRAME_GENERATOR_INTERFACE_H_
12#define API_TEST_FRAME_GENERATOR_INTERFACE_H_
13
14#include <utility>
15
16#include "absl/types/optional.h"
17#include "api/scoped_refptr.h"
18#include "api/video/video_frame.h"
19#include "api/video/video_frame_buffer.h"
20
21namespace webrtc {
22namespace test {
23
24class FrameGeneratorInterface {
25 public:
26 struct VideoFrameData {
27 VideoFrameData(rtc::scoped_refptr<VideoFrameBuffer> buffer,
28 absl::optional<VideoFrame::UpdateRect> update_rect)
29 : buffer(std::move(buffer)), update_rect(update_rect) {}
30
31 rtc::scoped_refptr<VideoFrameBuffer> buffer;
32 absl::optional<VideoFrame::UpdateRect> update_rect;
33 };
34
Evan Shrubsole55c17862020-09-28 10:16:00 +020035 enum class OutputType { kI420, kI420A, kI010, kNV12 };
Artem Titov503d7232019-12-04 12:37:13 +010036
37 virtual ~FrameGeneratorInterface() = default;
38
39 // Returns VideoFrameBuffer and area where most of update was done to set them
40 // on the VideoFrame object.
41 virtual VideoFrameData NextFrame() = 0;
42
43 // Change the capture resolution.
44 virtual void ChangeResolution(size_t width, size_t height) = 0;
45};
46
47} // namespace test
48} // namespace webrtc
49
50#endif // API_TEST_FRAME_GENERATOR_INTERFACE_H_