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