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 | |
Mirko Bonadei | 92ea95e | 2017-09-15 06:47:31 +0200 | [diff] [blame] | 11 | #ifndef TEST_GL_GL_RENDERER_H_ |
| 12 | #define TEST_GL_GL_RENDERER_H_ |
pbos@webrtc.org | 29d5839 | 2013-05-16 12:08:03 +0000 | [diff] [blame] | 13 | |
mflodman@webrtc.org | 7f944f3 | 2013-05-27 15:52:38 +0000 | [diff] [blame] | 14 | #ifdef WEBRTC_MAC |
| 15 | #include <OpenGL/gl.h> |
| 16 | #else |
pbos@webrtc.org | 29d5839 | 2013-05-16 12:08:03 +0000 | [diff] [blame] | 17 | #include <GL/gl.h> |
mflodman@webrtc.org | 7f944f3 | 2013-05-27 15:52:38 +0000 | [diff] [blame] | 18 | #endif |
pbos@webrtc.org | 29d5839 | 2013-05-16 12:08:03 +0000 | [diff] [blame] | 19 | |
Mirko Bonadei | 92ea95e | 2017-09-15 06:47:31 +0200 | [diff] [blame] | 20 | #include "test/video_renderer.h" |
Mirko Bonadei | 7120742 | 2017-09-15 13:58:09 +0200 | [diff] [blame] | 21 | #include "typedefs.h" // NOLINT(build/include) |
pbos@webrtc.org | 1ecee9a | 2013-05-29 11:34:32 +0000 | [diff] [blame] | 22 | |
pbos@webrtc.org | 29d5839 | 2013-05-16 12:08:03 +0000 | [diff] [blame] | 23 | |
| 24 | namespace webrtc { |
| 25 | namespace test { |
| 26 | |
| 27 | class GlRenderer : public VideoRenderer { |
| 28 | public: |
nisse | eb83a1a | 2016-03-21 01:27:56 -0700 | [diff] [blame] | 29 | void OnFrame(const webrtc::VideoFrame& frame) override; |
pbos@webrtc.org | 29d5839 | 2013-05-16 12:08:03 +0000 | [diff] [blame] | 30 | |
| 31 | protected: |
| 32 | GlRenderer(); |
| 33 | |
| 34 | void Init(); |
| 35 | void Destroy(); |
| 36 | |
| 37 | void ResizeViewport(size_t width, size_t height); |
| 38 | |
| 39 | private: |
| 40 | bool is_init_; |
| 41 | uint8_t* buffer_; |
| 42 | GLuint texture_; |
| 43 | size_t width_, height_, buffer_size_; |
| 44 | |
| 45 | void ResizeVideo(size_t width, size_t height); |
| 46 | }; |
| 47 | } // test |
| 48 | } // webrtc |
| 49 | |
Mirko Bonadei | 92ea95e | 2017-09-15 06:47:31 +0200 | [diff] [blame] | 50 | #endif // TEST_GL_GL_RENDERER_H_ |