Chromium Code Reviews| 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 CONTENT_COMMON_GPU_MEDIA_RENDERING_HELPER_H_ | 5 #ifndef CONTENT_COMMON_GPU_MEDIA_RENDERING_HELPER_H_ |
| 6 #define CONTENT_COMMON_GPU_MEDIA_RENDERING_HELPER_H_ | 6 #define CONTENT_COMMON_GPU_MEDIA_RENDERING_HELPER_H_ |
| 7 | 7 |
| 8 #include <map> | 8 #include <map> |
| 9 #include <queue> | 9 #include <queue> |
| 10 #include <vector> | 10 #include <vector> |
| (...skipping 45 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 56 // initialized. | 56 // initialized. |
| 57 int warm_up_iterations; | 57 int warm_up_iterations; |
| 58 | 58 |
| 59 // The desired size of each window. We play each stream in its own window | 59 // The desired size of each window. We play each stream in its own window |
| 60 // on the screen. | 60 // on the screen. |
| 61 std::vector<gfx::Size> window_sizes; | 61 std::vector<gfx::Size> window_sizes; |
| 62 | 62 |
| 63 // The members below are only used for the thumbnail mode where all frames | 63 // The members below are only used for the thumbnail mode where all frames |
| 64 // are rendered in sequence onto one FBO for comparison/verification purposes. | 64 // are rendered in sequence onto one FBO for comparison/verification purposes. |
| 65 | 65 |
| 66 // Whether any rendering will actually happen. | |
| 67 bool suppress_rendering; | |
|
Owen Lin
2014/11/03 06:59:06
Remove this ? Rebase conflict ?
llandwerlin-old
2014/11/03 09:30:10
As you suggested in a different comment, I will us
| |
| 66 // Whether the frames are rendered as scaled thumbnails within a | 68 // Whether the frames are rendered as scaled thumbnails within a |
| 67 // larger FBO that is in turn rendered to the window. | 69 // larger FBO that is in turn rendered to the window. |
| 68 bool render_as_thumbnails; | 70 bool render_as_thumbnails; |
| 69 // The size of the FBO containing all visible thumbnails. | 71 // The size of the FBO containing all visible thumbnails. |
| 70 gfx::Size thumbnails_page_size; | 72 gfx::Size thumbnails_page_size; |
| 71 // The size of each thumbnail within the FBO. | 73 // The size of each thumbnail within the FBO. |
| 72 gfx::Size thumbnail_size; | 74 gfx::Size thumbnail_size; |
| 73 }; | 75 }; |
| 74 | 76 |
| 75 // Creates and draws textures used by the video decoder. | 77 // Creates and draws textures used by the video decoder. |
| (...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 108 // Flushes the pending frames. Notify the rendering_helper there won't be | 110 // Flushes the pending frames. Notify the rendering_helper there won't be |
| 109 // more video frames. | 111 // more video frames. |
| 110 void Flush(size_t window_id); | 112 void Flush(size_t window_id); |
| 111 | 113 |
| 112 // Delete |texture_id|. | 114 // Delete |texture_id|. |
| 113 void DeleteTexture(uint32 texture_id); | 115 void DeleteTexture(uint32 texture_id); |
| 114 | 116 |
| 115 // Get the platform specific handle to the OpenGL display. | 117 // Get the platform specific handle to the OpenGL display. |
| 116 void* GetGLDisplay(); | 118 void* GetGLDisplay(); |
| 117 | 119 |
| 120 // Get the GL context. | |
| 121 scoped_refptr<gfx::GLContext> GetGLContext(); | |
| 122 | |
| 118 // Get the platform specific handle to the OpenGL context. | 123 // Get the platform specific handle to the OpenGL context. |
| 119 void* GetGLContext(); | 124 void* GetGLContextHandle(); |
| 120 | 125 |
| 121 // Get rendered thumbnails as RGB. | 126 // Get rendered thumbnails as RGB. |
| 122 // Sets alpha_solid to true if the alpha channel is entirely 0xff. | 127 // Sets alpha_solid to true if the alpha channel is entirely 0xff. |
| 123 void GetThumbnailsAsRGB(std::vector<unsigned char>* rgb, | 128 void GetThumbnailsAsRGB(std::vector<unsigned char>* rgb, |
| 124 bool* alpha_solid, | 129 bool* alpha_solid, |
| 125 base::WaitableEvent* done); | 130 base::WaitableEvent* done); |
| 126 | 131 |
| 127 private: | 132 private: |
| 128 struct RenderedVideo { | 133 struct RenderedVideo { |
| 129 // The rect on the screen where the video will be rendered. | 134 // The rect on the screen where the video will be rendered. |
| (...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 163 | 168 |
| 164 // Render |texture_id| to the current view port of the screen using target | 169 // Render |texture_id| to the current view port of the screen using target |
| 165 // |texture_target|. | 170 // |texture_target|. |
| 166 void RenderTexture(uint32 texture_target, uint32 texture_id); | 171 void RenderTexture(uint32 texture_target, uint32 texture_id); |
| 167 | 172 |
| 168 base::MessageLoop* message_loop_; | 173 base::MessageLoop* message_loop_; |
| 169 | 174 |
| 170 scoped_refptr<gfx::GLContext> gl_context_; | 175 scoped_refptr<gfx::GLContext> gl_context_; |
| 171 scoped_refptr<gfx::GLSurface> gl_surface_; | 176 scoped_refptr<gfx::GLSurface> gl_surface_; |
| 172 | 177 |
| 178 #if defined(USE_OZONE) | |
| 179 class StubOzoneDelegate; | |
| 180 scoped_ptr<StubOzoneDelegate> platform_window_delegate_; | |
| 181 #endif | |
| 182 | |
| 173 gfx::AcceleratedWidget window_; | 183 gfx::AcceleratedWidget window_; |
| 174 | 184 |
| 175 gfx::Size screen_size_; | 185 gfx::Size screen_size_; |
| 176 | 186 |
| 177 std::vector<RenderedVideo> videos_; | 187 std::vector<RenderedVideo> videos_; |
| 178 | 188 |
| 179 bool render_as_thumbnails_; | 189 bool render_as_thumbnails_; |
| 180 int frame_count_; | 190 int frame_count_; |
| 181 GLuint thumbnails_fbo_id_; | 191 GLuint thumbnails_fbo_id_; |
| 182 GLuint thumbnails_texture_id_; | 192 GLuint thumbnails_texture_id_; |
| 183 gfx::Size thumbnails_fbo_size_; | 193 gfx::Size thumbnails_fbo_size_; |
| 184 gfx::Size thumbnail_size_; | 194 gfx::Size thumbnail_size_; |
| 185 GLuint program_; | 195 GLuint program_; |
| 186 base::TimeDelta frame_duration_; | 196 base::TimeDelta frame_duration_; |
| 187 base::TimeTicks scheduled_render_time_; | 197 base::TimeTicks scheduled_render_time_; |
| 188 base::CancelableClosure render_task_; | 198 base::CancelableClosure render_task_; |
| 189 base::TimeTicks vsync_timebase_; | 199 base::TimeTicks vsync_timebase_; |
| 190 base::TimeDelta vsync_interval_; | 200 base::TimeDelta vsync_interval_; |
| 191 | 201 |
| 192 DISALLOW_COPY_AND_ASSIGN(RenderingHelper); | 202 DISALLOW_COPY_AND_ASSIGN(RenderingHelper); |
| 193 }; | 203 }; |
| 194 | 204 |
| 195 } // namespace content | 205 } // namespace content |
| 196 | 206 |
| 197 #endif // CONTENT_COMMON_GPU_MEDIA_RENDERING_HELPER_H_ | 207 #endif // CONTENT_COMMON_GPU_MEDIA_RENDERING_HELPER_H_ |
| OLD | NEW |