blob: 9e580f6f59859c18d54d758c53904671f39a79af [file] [log] [blame]
pbos@webrtc.org29d58392013-05-16 12:08:03 +00001/*
2 * Copyright (c) 2013 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 */
Mirko Bonadei92ea95e2017-09-15 06:47:31 +020010#ifndef TEST_VIDEO_RENDERER_H_
11#define TEST_VIDEO_RENDERER_H_
pbos@webrtc.org29d58392013-05-16 12:08:03 +000012
pbos@webrtc.org1ecee9a2013-05-29 11:34:32 +000013#include <stddef.h>
14
Niels Möllerc6ce9c52018-05-11 11:15:30 +020015#include "api/video/video_sink_interface.h"
pbos@webrtc.org29d58392013-05-16 12:08:03 +000016
17namespace webrtc {
nisse7ade7b32016-03-23 04:48:10 -070018class VideoFrame;
19
pbos@webrtc.org29d58392013-05-16 12:08:03 +000020namespace test {
nisse7ade7b32016-03-23 04:48:10 -070021class VideoRenderer : public rtc::VideoSinkInterface<VideoFrame> {
pbos@webrtc.org29d58392013-05-16 12:08:03 +000022 public:
mflodman@webrtc.org7f944f32013-05-27 15:52:38 +000023 // Creates a platform-specific renderer if possible, or a null implementation
24 // if failing.
Yves Gerey665174f2018-06-19 15:03:05 +020025 static VideoRenderer* Create(const char* window_title,
26 size_t width,
pbos@webrtc.org771cdcb2013-05-23 12:20:16 +000027 size_t height);
mflodman@webrtc.org7f944f32013-05-27 15:52:38 +000028 // Returns a renderer rendering to a platform specific window if possible,
29 // NULL if none can be created.
30 // Creates a platform-specific renderer if possible, returns NULL if a
31 // platform renderer could not be created. This occurs, for instance, when
32 // running without an X environment on Linux.
33 static VideoRenderer* CreatePlatformRenderer(const char* window_title,
Yves Gerey665174f2018-06-19 15:03:05 +020034 size_t width,
35 size_t height);
pbos@webrtc.org29d58392013-05-16 12:08:03 +000036 virtual ~VideoRenderer() {}
Yves Gerey665174f2018-06-19 15:03:05 +020037
pbos@webrtc.org9b303482013-05-23 12:37:11 +000038 protected:
39 VideoRenderer() {}
pbos@webrtc.org29d58392013-05-16 12:08:03 +000040};
pbos@webrtc.orgadf23a52013-07-10 14:07:56 +000041} // namespace test
42} // namespace webrtc
pbos@webrtc.org29d58392013-05-16 12:08:03 +000043
Mirko Bonadei92ea95e2017-09-15 06:47:31 +020044#endif // TEST_VIDEO_RENDERER_H_