| 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_X11_VIDEO_RENDERER_H_ | 5 #ifndef MEDIA_TOOLS_PLAYER_X11_X11_VIDEO_RENDERER_H_ |
| 6 #define MEDIA_TOOLS_PLAYER_X11_X11_VIDEO_RENDERER_H_ | 6 #define MEDIA_TOOLS_PLAYER_X11_X11_VIDEO_RENDERER_H_ |
| 7 | 7 |
| 8 #include <X11/Xlib.h> | 8 #include <X11/Xlib.h> |
| 9 | 9 |
| 10 #include "base/basictypes.h" | 10 #include "base/basictypes.h" |
| 11 #include "base/memory/ref_counted.h" | 11 #include "base/memory/ref_counted.h" |
| 12 #include "ui/gfx/rect.h" | 12 #include "ui/gfx/rect.h" |
| 13 #include "ui/gfx/size.h" | 13 #include "ui/gfx/size.h" |
| 14 | 14 |
| 15 namespace media { | 15 namespace media { |
| 16 class VideoFrame; | 16 class VideoFrame; |
| 17 } | 17 } |
| 18 | 18 |
| 19 class X11VideoRenderer : public base::RefCountedThreadSafe<X11VideoRenderer> { | 19 class X11VideoRenderer : public base::RefCountedThreadSafe<X11VideoRenderer> { |
| 20 public: | 20 public: |
| 21 X11VideoRenderer(Display* display, Window window); | 21 X11VideoRenderer(Display* display, Window window); |
| 22 | 22 |
| 23 void Paint(media::VideoFrame* video_frame); | 23 void Paint(const scoped_refptr<media::VideoFrame>& video_frame); |
| 24 | 24 |
| 25 private: | 25 private: |
| 26 friend class base::RefCountedThreadSafe<X11VideoRenderer>; | 26 friend class base::RefCountedThreadSafe<X11VideoRenderer>; |
| 27 ~X11VideoRenderer(); | 27 ~X11VideoRenderer(); |
| 28 | 28 |
| 29 // Initializes X11 rendering for the given dimensions. | 29 // Initializes X11 rendering for the given dimensions. |
| 30 void Initialize(gfx::Size coded_size, gfx::Rect visible_rect); | 30 void Initialize(gfx::Size coded_size, gfx::Rect visible_rect); |
| 31 | 31 |
| 32 Display* display_; | 32 Display* display_; |
| 33 Window window_; | 33 Window window_; |
| 34 | 34 |
| 35 // Image in heap that contains the RGBA data of the video frame. | 35 // Image in heap that contains the RGBA data of the video frame. |
| 36 XImage* image_; | 36 XImage* image_; |
| 37 | 37 |
| 38 // Picture represents the paint target. This is a picture located | 38 // Picture represents the paint target. This is a picture located |
| 39 // in the server. | 39 // in the server. |
| 40 unsigned long picture_; | 40 unsigned long picture_; |
| 41 | 41 |
| 42 bool use_render_; | 42 bool use_render_; |
| 43 | 43 |
| 44 DISALLOW_COPY_AND_ASSIGN(X11VideoRenderer); | 44 DISALLOW_COPY_AND_ASSIGN(X11VideoRenderer); |
| 45 }; | 45 }; |
| 46 | 46 |
| 47 #endif // MEDIA_TOOLS_PLAYER_X11_X11_VIDEO_RENDERER_H_ | 47 #endif // MEDIA_TOOLS_PLAYER_X11_X11_VIDEO_RENDERER_H_ |
| OLD | NEW |