blob: 517f22a03801fcff0d25f8c96553d20fabbaf3d9 [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 */
10
kjellander8237abf2015-12-08 07:12:06 -080011#ifndef WEBRTC_VIDEO_ENGINE_TEST_COMMON_LINUX_GLX_RENDERER_H_
12#define WEBRTC_VIDEO_ENGINE_TEST_COMMON_LINUX_GLX_RENDERER_H_
pbos@webrtc.org29d58392013-05-16 12:08:03 +000013
pbos@webrtc.org29d58392013-05-16 12:08:03 +000014#include <GL/glx.h>
pbos@webrtc.orgf5d4cb12013-05-17 13:44:48 +000015#include <X11/Xlib.h>
pbos@webrtc.org29d58392013-05-16 12:08:03 +000016
pbos@webrtc.org16e03b72013-10-28 16:32:01 +000017#include "webrtc/test/gl/gl_renderer.h"
pbos@webrtc.org1ecee9a2013-05-29 11:34:32 +000018#include "webrtc/typedefs.h"
pbos@webrtc.org29d58392013-05-16 12:08:03 +000019
20namespace webrtc {
21namespace test {
22
23class GlxRenderer : public GlRenderer {
24 public:
25 static GlxRenderer* Create(const char* window_title, size_t width,
26 size_t height);
27 virtual ~GlxRenderer();
28
Miguel Casas-Sanchez47650702015-05-29 17:21:40 -070029 void RenderFrame(const webrtc::VideoFrame& frame, int delta) override;
kjellander@webrtc.org14665ff2015-03-04 12:58:35 +000030 bool IsTextureSupported() const override { return false; }
pbos@webrtc.org0d852d52015-02-09 15:14:36 +000031
pbos@webrtc.org29d58392013-05-16 12:08:03 +000032 private:
33 GlxRenderer(size_t width, size_t height);
34
35 bool Init(const char* window_title);
36 void Resize(size_t width, size_t height);
37 void Destroy();
38
pbos@webrtc.org29d58392013-05-16 12:08:03 +000039 size_t width_, height_;
40
41 Display* display_;
42 Window window_;
43 GLXContext context_;
44};
45} // test
46} // webrtc
47
kjellander8237abf2015-12-08 07:12:06 -080048#endif // WEBRTC_VIDEO_ENGINE_TEST_COMMON_LINUX_GLX_RENDERER_H_