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_GPU_RENDERING_HELPER_H_ | 5 #ifndef MEDIA_GPU_RENDERING_HELPER_H_ |
6 #define MEDIA_GPU_RENDERING_HELPER_H_ | 6 #define MEDIA_GPU_RENDERING_HELPER_H_ |
7 | 7 |
8 #include <stddef.h> | 8 #include <stddef.h> |
9 #include <stdint.h> | 9 #include <stdint.h> |
10 | 10 |
(...skipping 121 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
132 | 132 |
133 // Delete |texture_id|. | 133 // Delete |texture_id|. |
134 void DeleteTexture(uint32_t texture_id); | 134 void DeleteTexture(uint32_t texture_id); |
135 | 135 |
136 // Get the platform specific handle to the OpenGL display. | 136 // Get the platform specific handle to the OpenGL display. |
137 void* GetGLDisplay(); | 137 void* GetGLDisplay(); |
138 | 138 |
139 // Get the GL context. | 139 // Get the GL context. |
140 gl::GLContext* GetGLContext(); | 140 gl::GLContext* GetGLContext(); |
141 | 141 |
142 // Get rendered thumbnails as RGB. | 142 // Get rendered thumbnails as RGBA. |
143 // Sets alpha_solid to true if the alpha channel is entirely 0xff. | 143 void GetThumbnailsAsRGBA(std::vector<unsigned char>* rgba, |
144 void GetThumbnailsAsRGB(std::vector<unsigned char>* rgb, | 144 base::WaitableEvent* done); |
145 bool* alpha_solid, | |
146 base::WaitableEvent* done); | |
147 | 145 |
148 private: | 146 private: |
149 struct RenderedVideo { | 147 struct RenderedVideo { |
150 // The rect on the screen where the video will be rendered. | 148 // The rect on the screen where the video will be rendered. |
151 gfx::Rect render_area; | 149 gfx::Rect render_area; |
152 | 150 |
153 // True if there won't be any new video frames comming. | 151 // True if there won't be any new video frames comming. |
154 bool is_flushing; | 152 bool is_flushing; |
155 | 153 |
156 // The number of frames need to be dropped to catch up the rendering. We | 154 // The number of frames need to be dropped to catch up the rendering. We |
(...skipping 65 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
222 base::CancelableClosure render_task_; | 220 base::CancelableClosure render_task_; |
223 base::TimeTicks vsync_timebase_; | 221 base::TimeTicks vsync_timebase_; |
224 base::TimeDelta vsync_interval_; | 222 base::TimeDelta vsync_interval_; |
225 | 223 |
226 DISALLOW_COPY_AND_ASSIGN(RenderingHelper); | 224 DISALLOW_COPY_AND_ASSIGN(RenderingHelper); |
227 }; | 225 }; |
228 | 226 |
229 } // namespace media | 227 } // namespace media |
230 | 228 |
231 #endif // MEDIA_GPU_RENDERING_HELPER_H_ | 229 #endif // MEDIA_GPU_RENDERING_HELPER_H_ |
OLD | NEW |