pbos@webrtc.org | 29d5839 | 2013-05-16 12:08:03 +0000 | [diff] [blame] | 1 | /* |
| 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 | |
Peter Boström | 7623ce4 | 2015-12-09 12:13:30 +0100 | [diff] [blame] | 11 | #ifndef WEBRTC_TEST_LINUX_GLX_RENDERER_H_ |
| 12 | #define WEBRTC_TEST_LINUX_GLX_RENDERER_H_ |
pbos@webrtc.org | 29d5839 | 2013-05-16 12:08:03 +0000 | [diff] [blame] | 13 | |
pbos@webrtc.org | 29d5839 | 2013-05-16 12:08:03 +0000 | [diff] [blame] | 14 | #include <GL/glx.h> |
pbos@webrtc.org | f5d4cb1 | 2013-05-17 13:44:48 +0000 | [diff] [blame] | 15 | #include <X11/Xlib.h> |
pbos@webrtc.org | 29d5839 | 2013-05-16 12:08:03 +0000 | [diff] [blame] | 16 | |
pbos@webrtc.org | 16e03b7 | 2013-10-28 16:32:01 +0000 | [diff] [blame] | 17 | #include "webrtc/test/gl/gl_renderer.h" |
pbos@webrtc.org | 1ecee9a | 2013-05-29 11:34:32 +0000 | [diff] [blame] | 18 | #include "webrtc/typedefs.h" |
pbos@webrtc.org | 29d5839 | 2013-05-16 12:08:03 +0000 | [diff] [blame] | 19 | |
| 20 | namespace webrtc { |
| 21 | namespace test { |
| 22 | |
| 23 | class GlxRenderer : public GlRenderer { |
| 24 | public: |
| 25 | static GlxRenderer* Create(const char* window_title, size_t width, |
| 26 | size_t height); |
| 27 | virtual ~GlxRenderer(); |
| 28 | |
nisse | eb83a1a | 2016-03-21 01:27:56 -0700 | [diff] [blame^] | 29 | void OnFrame(const webrtc::VideoFrame& frame) override; |
pbos@webrtc.org | 0d852d5 | 2015-02-09 15:14:36 +0000 | [diff] [blame] | 30 | |
pbos@webrtc.org | 29d5839 | 2013-05-16 12:08:03 +0000 | [diff] [blame] | 31 | private: |
| 32 | GlxRenderer(size_t width, size_t height); |
| 33 | |
| 34 | bool Init(const char* window_title); |
| 35 | void Resize(size_t width, size_t height); |
| 36 | void Destroy(); |
| 37 | |
pbos@webrtc.org | 29d5839 | 2013-05-16 12:08:03 +0000 | [diff] [blame] | 38 | size_t width_, height_; |
| 39 | |
| 40 | Display* display_; |
| 41 | Window window_; |
| 42 | GLXContext context_; |
| 43 | }; |
| 44 | } // test |
| 45 | } // webrtc |
| 46 | |
Peter Boström | 7623ce4 | 2015-12-09 12:13:30 +0100 | [diff] [blame] | 47 | #endif // WEBRTC_TEST_LINUX_GLX_RENDERER_H_ |