| 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 34 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 45 ~VideoFrameTexture(); | 45 ~VideoFrameTexture(); |
| 46 }; | 46 }; |
| 47 | 47 |
| 48 struct RenderingHelperParams { | 48 struct RenderingHelperParams { |
| 49 RenderingHelperParams(); | 49 RenderingHelperParams(); |
| 50 ~RenderingHelperParams(); | 50 ~RenderingHelperParams(); |
| 51 | 51 |
| 52 // The rendering FPS. | 52 // The rendering FPS. |
| 53 int rendering_fps; | 53 int rendering_fps; |
| 54 | 54 |
| 55 // The number of empty frames rendered when the rendering helper is |
| 56 // initialized. |
| 57 int warm_up_iterations; |
| 58 |
| 55 // 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 |
| 56 // on the screen. | 60 // on the screen. |
| 57 std::vector<gfx::Size> window_sizes; | 61 std::vector<gfx::Size> window_sizes; |
| 58 | 62 |
| 59 // 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 |
| 60 // are rendered in sequence onto one FBO for comparison/verification purposes. | 64 // are rendered in sequence onto one FBO for comparison/verification purposes. |
| 61 | 65 |
| 62 // Whether the frames are rendered as scaled thumbnails within a | 66 // Whether the frames are rendered as scaled thumbnails within a |
| 63 // larger FBO that is in turn rendered to the window. | 67 // larger FBO that is in turn rendered to the window. |
| 64 bool render_as_thumbnails; | 68 bool render_as_thumbnails; |
| (...skipping 77 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 142 std::queue<scoped_refptr<VideoFrameTexture> > pending_frames; | 146 std::queue<scoped_refptr<VideoFrameTexture> > pending_frames; |
| 143 | 147 |
| 144 RenderedVideo(); | 148 RenderedVideo(); |
| 145 ~RenderedVideo(); | 149 ~RenderedVideo(); |
| 146 }; | 150 }; |
| 147 | 151 |
| 148 void Clear(); | 152 void Clear(); |
| 149 | 153 |
| 150 void RenderContent(); | 154 void RenderContent(); |
| 151 | 155 |
| 156 void WarmUpRendering(int warm_up_iterations); |
| 157 |
| 152 void LayoutRenderingAreas(const std::vector<gfx::Size>& window_sizes); | 158 void LayoutRenderingAreas(const std::vector<gfx::Size>& window_sizes); |
| 153 | 159 |
| 154 // Render |texture_id| to the current view port of the screen using target | 160 // Render |texture_id| to the current view port of the screen using target |
| 155 // |texture_target|. | 161 // |texture_target|. |
| 156 void RenderTexture(uint32 texture_target, uint32 texture_id); | 162 void RenderTexture(uint32 texture_target, uint32 texture_id); |
| 157 | 163 |
| 158 base::MessageLoop* message_loop_; | 164 base::MessageLoop* message_loop_; |
| 159 | 165 |
| 160 scoped_refptr<gfx::GLContext> gl_context_; | 166 scoped_refptr<gfx::GLContext> gl_context_; |
| 161 scoped_refptr<gfx::GLSurface> gl_surface_; | 167 scoped_refptr<gfx::GLSurface> gl_surface_; |
| (...skipping 14 matching lines...) Expand all Loading... |
| 176 base::TimeDelta frame_duration_; | 182 base::TimeDelta frame_duration_; |
| 177 base::TimeTicks scheduled_render_time_; | 183 base::TimeTicks scheduled_render_time_; |
| 178 base::CancelableClosure render_task_; | 184 base::CancelableClosure render_task_; |
| 179 | 185 |
| 180 DISALLOW_COPY_AND_ASSIGN(RenderingHelper); | 186 DISALLOW_COPY_AND_ASSIGN(RenderingHelper); |
| 181 }; | 187 }; |
| 182 | 188 |
| 183 } // namespace content | 189 } // namespace content |
| 184 | 190 |
| 185 #endif // CONTENT_COMMON_GPU_MEDIA_RENDERING_HELPER_H_ | 191 #endif // CONTENT_COMMON_GPU_MEDIA_RENDERING_HELPER_H_ |
| OLD | NEW |