OLD | NEW |
1 /* | 1 /* |
2 * Copyright (c) 2013 The WebRTC project authors. All Rights Reserved. | 2 * Copyright (c) 2013 The WebRTC project authors. All Rights Reserved. |
3 * | 3 * |
4 * Use of this source code is governed by a BSD-style license | 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 | 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 | 6 * tree. An additional intellectual property rights grant can be found |
7 * in the file PATENTS. All contributing project authors may | 7 * in the file PATENTS. All contributing project authors may |
8 * be found in the AUTHORS file in the root of the source tree. | 8 * be found in the AUTHORS file in the root of the source tree. |
9 */ | 9 */ |
10 | 10 |
11 #ifndef WEBRTC_TEST_GL_GL_RENDERER_H_ | 11 #ifndef WEBRTC_TEST_GL_GL_RENDERER_H_ |
12 #define WEBRTC_TEST_GL_GL_RENDERER_H_ | 12 #define WEBRTC_TEST_GL_GL_RENDERER_H_ |
13 | 13 |
14 #ifdef WEBRTC_MAC | 14 #ifdef WEBRTC_MAC |
15 #include <OpenGL/gl.h> | 15 #include <OpenGL/gl.h> |
16 #else | 16 #else |
17 #include <GL/gl.h> | 17 #include <GL/gl.h> |
18 #endif | 18 #endif |
19 | 19 |
20 #include "webrtc/test/video_renderer.h" | 20 #include "webrtc/test/video_renderer.h" |
21 #include "webrtc/typedefs.h" | 21 #include "webrtc/typedefs.h" |
22 | 22 |
23 | 23 |
24 namespace webrtc { | 24 namespace webrtc { |
25 namespace test { | 25 namespace test { |
26 | 26 |
27 class GlRenderer : public VideoRenderer { | 27 class GlRenderer : public VideoRenderer { |
28 public: | 28 public: |
29 void RenderFrame(const webrtc::VideoFrame& frame, | 29 void OnFrame(const webrtc::VideoFrame& frame) override; |
30 int time_to_render_ms) override; | |
31 | 30 |
32 protected: | 31 protected: |
33 GlRenderer(); | 32 GlRenderer(); |
34 | 33 |
35 void Init(); | 34 void Init(); |
36 void Destroy(); | 35 void Destroy(); |
37 | 36 |
38 void ResizeViewport(size_t width, size_t height); | 37 void ResizeViewport(size_t width, size_t height); |
39 | 38 |
40 private: | 39 private: |
41 bool is_init_; | 40 bool is_init_; |
42 uint8_t* buffer_; | 41 uint8_t* buffer_; |
43 GLuint texture_; | 42 GLuint texture_; |
44 size_t width_, height_, buffer_size_; | 43 size_t width_, height_, buffer_size_; |
45 | 44 |
46 void ResizeVideo(size_t width, size_t height); | 45 void ResizeVideo(size_t width, size_t height); |
47 }; | 46 }; |
48 } // test | 47 } // test |
49 } // webrtc | 48 } // webrtc |
50 | 49 |
51 #endif // WEBRTC_TEST_GL_GL_RENDERER_H_ | 50 #endif // WEBRTC_TEST_GL_GL_RENDERER_H_ |
OLD | NEW |