| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #ifndef MEDIA_TOOLS_PLAYER_X11_GL_VIDEO_RENDERER_H_ | 5 #ifndef MEDIA_TOOLS_PLAYER_X11_GL_VIDEO_RENDERER_H_ |
| 6 #define MEDIA_TOOLS_PLAYER_X11_GL_VIDEO_RENDERER_H_ | 6 #define MEDIA_TOOLS_PLAYER_X11_GL_VIDEO_RENDERER_H_ |
| 7 | 7 |
| 8 #include "base/basictypes.h" | 8 #include "base/basictypes.h" |
| 9 #include "base/memory/ref_counted.h" | 9 #include "base/memory/ref_counted.h" |
| 10 #include "ui/gfx/rect.h" |
| 11 #include "ui/gfx/size.h" |
| 10 #include "ui/gl/gl_bindings.h" | 12 #include "ui/gl/gl_bindings.h" |
| 11 | 13 |
| 12 class MessageLoop; | 14 class MessageLoop; |
| 13 | 15 |
| 14 namespace media { | 16 namespace media { |
| 15 class VideoFrame; | 17 class VideoFrame; |
| 16 } | 18 } |
| 17 | 19 |
| 18 class GlVideoRenderer : public base::RefCountedThreadSafe<GlVideoRenderer> { | 20 class GlVideoRenderer : public base::RefCountedThreadSafe<GlVideoRenderer> { |
| 19 public: | 21 public: |
| 20 GlVideoRenderer(Display* display, Window window); | 22 GlVideoRenderer(Display* display, Window window); |
| 21 | 23 |
| 22 void Paint(media::VideoFrame* video_frame); | 24 void Paint(media::VideoFrame* video_frame); |
| 23 | 25 |
| 24 protected: | 26 protected: |
| 25 friend class base::RefCountedThreadSafe<GlVideoRenderer>; | 27 friend class base::RefCountedThreadSafe<GlVideoRenderer>; |
| 26 ~GlVideoRenderer(); | 28 ~GlVideoRenderer(); |
| 27 | 29 |
| 28 private: | 30 private: |
| 29 // Initializes GL rendering for the given dimensions. | 31 // Initializes GL rendering for the given dimensions. |
| 30 void Initialize(int width, int height); | 32 void Initialize(gfx::Size coded_size, gfx::Rect visible_rect); |
| 31 | 33 |
| 32 Display* display_; | 34 Display* display_; |
| 33 Window window_; | 35 Window window_; |
| 34 | 36 |
| 35 // GL context. | 37 // GL context. |
| 36 GLXContext gl_context_; | 38 GLXContext gl_context_; |
| 37 | 39 |
| 38 // 3 textures, one for each plane. | 40 // 3 textures, one for each plane. |
| 39 GLuint textures_[3]; | 41 GLuint textures_[3]; |
| 40 | 42 |
| 41 DISALLOW_COPY_AND_ASSIGN(GlVideoRenderer); | 43 DISALLOW_COPY_AND_ASSIGN(GlVideoRenderer); |
| 42 }; | 44 }; |
| 43 | 45 |
| 44 #endif // MEDIA_TOOLS_PLAYER_X11_GL_VIDEO_RENDERER_H_ | 46 #endif // MEDIA_TOOLS_PLAYER_X11_GL_VIDEO_RENDERER_H_ |
| OLD | NEW |