OLD | NEW |
| (Empty) |
1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. | |
2 // Use of this source code is governed by a BSD-style license that can be | |
3 // found in the LICENSE file. | |
4 | |
5 #ifndef CHROME_BROWSER_RENDERER_HOST_VIDEO_LAYER_X_H_ | |
6 #define CHROME_BROWSER_RENDERER_HOST_VIDEO_LAYER_X_H_ | |
7 #pragma once | |
8 | |
9 #include "app/x11_util.h" | |
10 #include "base/scoped_ptr.h" | |
11 #include "chrome/browser/renderer_host/video_layer.h" | |
12 #include "gfx/rect.h" | |
13 | |
14 // Implements a YUV data layer using X to hold the RGB data. | |
15 class VideoLayerX : public VideoLayer { | |
16 public: | |
17 VideoLayerX(RenderWidgetHost* widget, const gfx::Size& size, void* visual, | |
18 int depth); | |
19 virtual ~VideoLayerX(); | |
20 | |
21 // VideoLayer implementation. | |
22 virtual void CopyTransportDIB(RenderProcessHost* process, | |
23 TransportDIB::Id bitmap, | |
24 const gfx::Rect& bitmap_rect); | |
25 | |
26 // Copy from the server-side video layer to the target window. | |
27 // Unlike BackingStore, we maintain the absolute position and destination | |
28 // size so passing in a rect is not required. | |
29 void XShow(XID target); | |
30 | |
31 private: | |
32 // X Visual to get RGB mask information. | |
33 void* const visual_; | |
34 // Depth of the target window. | |
35 int depth_; | |
36 // Connection to the X server where this video layer will be displayed. | |
37 Display* const display_; | |
38 | |
39 // Handle to the server side pixmap which is our video layer. | |
40 XID pixmap_; | |
41 // Graphics context for painting our video layer. | |
42 void* pixmap_gc_; | |
43 // Server side bits-per-pixel for |pixmap_|. | |
44 int pixmap_bpp_; | |
45 | |
46 // Most recently converted frame stored as 32-bit ARGB. | |
47 scoped_array<uint8> rgb_frame_; | |
48 size_t rgb_frame_size_; | |
49 | |
50 // Destination size and absolution position of the converted frame. | |
51 gfx::Rect rgb_rect_; | |
52 | |
53 DISALLOW_COPY_AND_ASSIGN(VideoLayerX); | |
54 }; | |
55 | |
56 #endif // CHROME_BROWSER_RENDERER_HOST_VIDEO_LAYER_X_H_ | |
OLD | NEW |