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

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

Issue 176883018: Remove additional protection of kDisableAcceleratedVideoDecode in bpf_gpu_policy_linux.cc. (Closed) Base URL: https://git.chromium.org/chromium/src.git@master
Patch Set: Created 6 years, 9 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 #include "content/common/gpu/media/gpu_video_decode_accelerator.h" 5 #include "content/common/gpu/media/gpu_video_decode_accelerator.h"
6 6
7 #include <vector> 7 #include <vector>
8 8
9 #include "base/bind.h" 9 #include "base/bind.h"
10 #include "base/command_line.h" 10 #include "base/command_line.h"
(...skipping 10 matching lines...) Expand all
21 #include "media/base/limits.h" 21 #include "media/base/limits.h"
22 #include "ui/gl/gl_context.h" 22 #include "ui/gl/gl_context.h"
23 #include "ui/gl/gl_surface_egl.h" 23 #include "ui/gl/gl_surface_egl.h"
24 24
25 #if defined(OS_WIN) 25 #if defined(OS_WIN)
26 #include "base/win/windows_version.h" 26 #include "base/win/windows_version.h"
27 #include "content/common/gpu/media/dxva_video_decode_accelerator.h" 27 #include "content/common/gpu/media/dxva_video_decode_accelerator.h"
28 #elif defined(OS_CHROMEOS) && defined(ARCH_CPU_ARMEL) && defined(USE_X11) 28 #elif defined(OS_CHROMEOS) && defined(ARCH_CPU_ARMEL) && defined(USE_X11)
29 #include "content/common/gpu/media/v4l2_video_decode_accelerator.h" 29 #include "content/common/gpu/media/v4l2_video_decode_accelerator.h"
30 #include "content/common/gpu/media/v4l2_video_device.h" 30 #include "content/common/gpu/media/v4l2_video_device.h"
31 #elif defined(OS_CHROMEOS) && defined(ARCH_CPU_X86_FAMILY) && defined(USE_X11) 31 #elif defined(OS_LINUX) && defined(ARCH_CPU_X86_FAMILY) && defined(USE_X11)
32 #include "content/common/gpu/media/vaapi_video_decode_accelerator.h" 32 #include "content/common/gpu/media/vaapi_video_decode_accelerator.h"
33 #include "ui/gl/gl_context_glx.h" 33 #include "ui/gl/gl_context_glx.h"
34 #include "ui/gl/gl_implementation.h" 34 #include "ui/gl/gl_implementation.h"
35 #elif defined(OS_ANDROID) 35 #elif defined(OS_ANDROID)
36 #include "content/common/gpu/media/android_video_decode_accelerator.h" 36 #include "content/common/gpu/media/android_video_decode_accelerator.h"
37 #endif 37 #endif
38 38
39 #include "ui/gfx/size.h" 39 #include "ui/gfx/size.h"
40 40
41 namespace content { 41 namespace content {
(...skipping 235 matching lines...) Expand 10 before | Expand all | Expand 10 after
277 if (!device.get()) { 277 if (!device.get()) {
278 NotifyError(media::VideoDecodeAccelerator::PLATFORM_FAILURE); 278 NotifyError(media::VideoDecodeAccelerator::PLATFORM_FAILURE);
279 return; 279 return;
280 } 280 }
281 video_decode_accelerator_.reset( 281 video_decode_accelerator_.reset(
282 new V4L2VideoDecodeAccelerator(gfx::GLSurfaceEGL::GetHardwareDisplay(), 282 new V4L2VideoDecodeAccelerator(gfx::GLSurfaceEGL::GetHardwareDisplay(),
283 weak_factory_for_io_.GetWeakPtr(), 283 weak_factory_for_io_.GetWeakPtr(),
284 make_context_current_, 284 make_context_current_,
285 device.Pass(), 285 device.Pass(),
286 io_message_loop_)); 286 io_message_loop_));
287 #elif defined(OS_CHROMEOS) && defined(ARCH_CPU_X86_FAMILY) && defined(USE_X11) 287 #elif defined(OS_LINUX) && defined(ARCH_CPU_X86_FAMILY) && defined(USE_X11)
288 if (gfx::GetGLImplementation() != gfx::kGLImplementationDesktopGL) { 288 if (gfx::GetGLImplementation() != gfx::kGLImplementationDesktopGL) {
289 VLOG(1) << "HW video decode acceleration not available without " 289 VLOG(1) << "HW video decode acceleration not available without "
290 "DesktopGL (GLX)."; 290 "DesktopGL (GLX).";
291 NotifyError(media::VideoDecodeAccelerator::PLATFORM_FAILURE); 291 NotifyError(media::VideoDecodeAccelerator::PLATFORM_FAILURE);
292 return; 292 return;
293 } 293 }
294 gfx::GLContextGLX* glx_context = 294 gfx::GLContextGLX* glx_context =
295 static_cast<gfx::GLContextGLX*>(stub_->decoder()->GetGLContext()); 295 static_cast<gfx::GLContextGLX*>(stub_->decoder()->GetGLContext());
296 video_decode_accelerator_.reset(new VaapiVideoDecodeAccelerator( 296 video_decode_accelerator_.reset(new VaapiVideoDecodeAccelerator(
297 glx_context->display(), make_context_current_)); 297 glx_context->display(), make_context_current_));
(...skipping 210 matching lines...) Expand 10 before | Expand all | Expand 10 after
508 scoped_refptr<gpu::gles2::TextureRef> texture_ref = it->second; 508 scoped_refptr<gpu::gles2::TextureRef> texture_ref = it->second;
509 GLenum target = texture_ref->texture()->target(); 509 GLenum target = texture_ref->texture()->target();
510 gpu::gles2::TextureManager* texture_manager = 510 gpu::gles2::TextureManager* texture_manager =
511 stub_->decoder()->GetContextGroup()->texture_manager(); 511 stub_->decoder()->GetContextGroup()->texture_manager();
512 DCHECK(!texture_ref->texture()->IsLevelCleared(target, 0)); 512 DCHECK(!texture_ref->texture()->IsLevelCleared(target, 0));
513 texture_manager->SetLevelCleared(texture_ref, target, 0, true); 513 texture_manager->SetLevelCleared(texture_ref, target, 0, true);
514 uncleared_textures_.erase(it); 514 uncleared_textures_.erase(it);
515 } 515 }
516 516
517 } // namespace content 517 } // namespace content
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698