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

Side by Side Diff: content/common/gpu/media/rendering_helper_gl.cc

Issue 10909112: Hacks to make HW decode work on linux via libva. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: added a clarifying comment Created 8 years, 3 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 | Annotate | Revision Log
« no previous file with comments | « no previous file | content/common/gpu/media/vaapi_h264_decoder.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 #include "content/common/gpu/media/rendering_helper.h" 5 #include "content/common/gpu/media/rendering_helper.h"
6 6
7 #include <map> 7 #include <map>
8 8
9 #if defined(OS_WIN) || defined(ARCH_CPU_ARMEL) 9 #if defined(OS_WIN) || defined(ARCH_CPU_ARMEL)
10 #include "third_party/angle/include/EGL/egl.h" // Must precede ui/gl headers! 10 #include "third_party/angle/include/EGL/egl.h" // Must precede ui/gl headers!
(...skipping 175 matching lines...) Expand 10 before | Expand all | Expand 10 after
186 #if GL_VARIANT_GLX 186 #if GL_VARIANT_GLX
187 x_display_ = base::MessagePumpForUI::GetDefaultXDisplay(); 187 x_display_ = base::MessagePumpForUI::GetDefaultXDisplay();
188 CHECK(x_display_); 188 CHECK(x_display_);
189 gfx::InitializeGLBindings(gfx::kGLImplementationDesktopGL); 189 gfx::InitializeGLBindings(gfx::kGLImplementationDesktopGL);
190 CHECK(glXQueryVersion(x_display_, NULL, NULL)); 190 CHECK(glXQueryVersion(x_display_, NULL, NULL));
191 const int fbconfig_attr[] = { 191 const int fbconfig_attr[] = {
192 GLX_DRAWABLE_TYPE, GLX_WINDOW_BIT, 192 GLX_DRAWABLE_TYPE, GLX_WINDOW_BIT,
193 GLX_RENDER_TYPE, GLX_RGBA_BIT, 193 GLX_RENDER_TYPE, GLX_RGBA_BIT,
194 GLX_BIND_TO_TEXTURE_TARGETS_EXT, GLX_TEXTURE_2D_BIT_EXT, 194 GLX_BIND_TO_TEXTURE_TARGETS_EXT, GLX_TEXTURE_2D_BIT_EXT,
195 GLX_BIND_TO_TEXTURE_RGB_EXT, GL_TRUE, 195 GLX_BIND_TO_TEXTURE_RGB_EXT, GL_TRUE,
196 GLX_Y_INVERTED_EXT, GL_FALSE,
197 GLX_RED_SIZE, 1,
198 GLX_GREEN_SIZE, 1,
199 GLX_BLUE_SIZE, 1,
200 GLX_ALPHA_SIZE, 1,
201 GLX_DOUBLEBUFFER, True, 196 GLX_DOUBLEBUFFER, True,
202 GL_NONE, 197 GL_NONE,
203 }; 198 };
204 int num_fbconfigs; 199 int num_fbconfigs;
205 scoped_ptr_malloc<GLXFBConfig, ScopedPtrXFree> glx_fb_configs( 200 scoped_ptr_malloc<GLXFBConfig, ScopedPtrXFree> glx_fb_configs(
206 glXChooseFBConfig(x_display_, DefaultScreen(x_display_), fbconfig_attr, 201 glXChooseFBConfig(x_display_, DefaultScreen(x_display_), fbconfig_attr,
207 &num_fbconfigs)); 202 &num_fbconfigs));
208 CHECK(glx_fb_configs.get()); 203 CHECK(glx_fb_configs.get());
209 CHECK_GT(num_fbconfigs, 0); 204 CHECK_GT(num_fbconfigs, 0);
210 x_visual_ = glXGetVisualFromFBConfig(x_display_, glx_fb_configs.get()[0]); 205 x_visual_ = glXGetVisualFromFBConfig(x_display_, glx_fb_configs.get()[0]);
(...skipping 232 matching lines...) Expand 10 before | Expand all | Expand 10 after
443 CHECK(XUnmapWindow(x_display_, x_windows_[i])); 438 CHECK(XUnmapWindow(x_display_, x_windows_[i]));
444 CHECK(XDestroyWindow(x_display_, x_windows_[i])); 439 CHECK(XDestroyWindow(x_display_, x_windows_[i]));
445 } 440 }
446 // Mimic newly created object. 441 // Mimic newly created object.
447 x_display_ = NULL; 442 x_display_ = NULL;
448 x_windows_.clear(); 443 x_windows_.clear();
449 #endif 444 #endif
450 } 445 }
451 446
452 } // namespace video_test_util 447 } // namespace video_test_util
OLDNEW
« no previous file with comments | « no previous file | content/common/gpu/media/vaapi_h264_decoder.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698