Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(107)

Side by Side Diff: content/common/gpu/media/rendering_helper.h

Issue 490233002: VaapiVideoAccelerator: make Vaapi accelerator work with ozone (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Missing modifications in video accelerators Created 6 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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 92 matching lines...) Expand 10 before | Expand all | Expand 10 after
103 // Flushes the pending frames. Notify the rendering_helper there won't be 103 // Flushes the pending frames. Notify the rendering_helper there won't be
104 // more video frames. 104 // more video frames.
105 void Flush(size_t window_id); 105 void Flush(size_t window_id);
106 106
107 // Delete |texture_id|. 107 // Delete |texture_id|.
108 void DeleteTexture(uint32 texture_id); 108 void DeleteTexture(uint32 texture_id);
109 109
110 // Get the platform specific handle to the OpenGL display. 110 // Get the platform specific handle to the OpenGL display.
111 void* GetGLDisplay(); 111 void* GetGLDisplay();
112 112
113 // Get the GL context.
114 scoped_refptr<gfx::GLContext> GetGLContext();
115
113 // Get the platform specific handle to the OpenGL context. 116 // Get the platform specific handle to the OpenGL context.
114 void* GetGLContext(); 117 void* GetGLContextHandle();
115 118
116 // Get rendered thumbnails as RGB. 119 // Get rendered thumbnails as RGB.
117 // Sets alpha_solid to true if the alpha channel is entirely 0xff. 120 // Sets alpha_solid to true if the alpha channel is entirely 0xff.
118 void GetThumbnailsAsRGB(std::vector<unsigned char>* rgb, 121 void GetThumbnailsAsRGB(std::vector<unsigned char>* rgb,
119 bool* alpha_solid, 122 bool* alpha_solid,
120 base::WaitableEvent* done); 123 base::WaitableEvent* done);
121 124
122 private: 125 private:
123 struct RenderedVideo { 126 struct RenderedVideo {
124 // The rect on the screen where the video will be rendered. 127 // The rect on the screen where the video will be rendered.
(...skipping 26 matching lines...) Expand all
151 // |texture_target|. 154 // |texture_target|.
152 void RenderTexture(uint32 texture_target, uint32 texture_id); 155 void RenderTexture(uint32 texture_target, uint32 texture_id);
153 156
154 // Timer to trigger the RenderContent() repeatly. 157 // Timer to trigger the RenderContent() repeatly.
155 scoped_ptr<base::RepeatingTimer<RenderingHelper> > render_timer_; 158 scoped_ptr<base::RepeatingTimer<RenderingHelper> > render_timer_;
156 base::MessageLoop* message_loop_; 159 base::MessageLoop* message_loop_;
157 160
158 scoped_refptr<gfx::GLContext> gl_context_; 161 scoped_refptr<gfx::GLContext> gl_context_;
159 scoped_refptr<gfx::GLSurface> gl_surface_; 162 scoped_refptr<gfx::GLSurface> gl_surface_;
160 163
164 #if defined(USE_OZONE)
165 class StubOzoneDelegate;
166 scoped_ptr<StubOzoneDelegate> platform_window_delegate_;
167 #endif
168
161 gfx::AcceleratedWidget window_; 169 gfx::AcceleratedWidget window_;
162 170
163 gfx::Size screen_size_; 171 gfx::Size screen_size_;
164 172
165 std::vector<RenderedVideo> videos_; 173 std::vector<RenderedVideo> videos_;
166 174
167 bool render_as_thumbnails_; 175 bool render_as_thumbnails_;
168 int frame_count_; 176 int frame_count_;
169 GLuint thumbnails_fbo_id_; 177 GLuint thumbnails_fbo_id_;
170 GLuint thumbnails_texture_id_; 178 GLuint thumbnails_texture_id_;
171 gfx::Size thumbnails_fbo_size_; 179 gfx::Size thumbnails_fbo_size_;
172 gfx::Size thumbnail_size_; 180 gfx::Size thumbnail_size_;
173 GLuint program_; 181 GLuint program_;
174 base::TimeDelta frame_duration_; 182 base::TimeDelta frame_duration_;
175 183
176 DISALLOW_COPY_AND_ASSIGN(RenderingHelper); 184 DISALLOW_COPY_AND_ASSIGN(RenderingHelper);
177 }; 185 };
178 186
179 } // namespace content 187 } // namespace content
180 188
181 #endif // CONTENT_COMMON_GPU_MEDIA_RENDERING_HELPER_H_ 189 #endif // CONTENT_COMMON_GPU_MEDIA_RENDERING_HELPER_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698