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 #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 243 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
254 #if defined(OS_WIN) | 254 #if defined(OS_WIN) |
255 if (base::win::GetVersion() < base::win::VERSION_WIN7) { | 255 if (base::win::GetVersion() < base::win::VERSION_WIN7) { |
256 NOTIMPLEMENTED() << "HW video decode acceleration not available."; | 256 NOTIMPLEMENTED() << "HW video decode acceleration not available."; |
257 NotifyError(media::VideoDecodeAccelerator::PLATFORM_FAILURE); | 257 NotifyError(media::VideoDecodeAccelerator::PLATFORM_FAILURE); |
258 return; | 258 return; |
259 } | 259 } |
260 DVLOG(0) << "Initializing DXVA HW decoder for windows."; | 260 DVLOG(0) << "Initializing DXVA HW decoder for windows."; |
261 video_decode_accelerator_.reset( | 261 video_decode_accelerator_.reset( |
262 new DXVAVideoDecodeAccelerator(make_context_current_)); | 262 new DXVAVideoDecodeAccelerator(make_context_current_)); |
263 #elif defined(OS_CHROMEOS) && defined(ARCH_CPU_ARMEL) && defined(USE_X11) | 263 #elif defined(OS_CHROMEOS) && defined(ARCH_CPU_ARMEL) && defined(USE_X11) |
264 scoped_ptr<V4L2Device> device = V4L2Device::Create(); | 264 scoped_ptr<V4L2Device> device = |
| 265 V4L2Device::Create(stub_->decoder()->GetGLContext()->GetHandle()); |
265 if (!device.get()) { | 266 if (!device.get()) { |
266 NotifyError(media::VideoDecodeAccelerator::PLATFORM_FAILURE); | 267 NotifyError(media::VideoDecodeAccelerator::PLATFORM_FAILURE); |
267 return; | 268 return; |
268 } | 269 } |
269 video_decode_accelerator_.reset( | 270 video_decode_accelerator_.reset( |
270 new V4L2VideoDecodeAccelerator(gfx::GLSurfaceEGL::GetHardwareDisplay(), | 271 new V4L2VideoDecodeAccelerator(gfx::GLSurfaceEGL::GetHardwareDisplay(), |
271 weak_factory_for_io_.GetWeakPtr(), | 272 weak_factory_for_io_.GetWeakPtr(), |
272 make_context_current_, | 273 make_context_current_, |
273 device.Pass(), | 274 device.Pass(), |
274 io_message_loop_)); | 275 io_message_loop_)); |
(...skipping 221 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
496 scoped_refptr<gpu::gles2::TextureRef> texture_ref = it->second; | 497 scoped_refptr<gpu::gles2::TextureRef> texture_ref = it->second; |
497 GLenum target = texture_ref->texture()->target(); | 498 GLenum target = texture_ref->texture()->target(); |
498 gpu::gles2::TextureManager* texture_manager = | 499 gpu::gles2::TextureManager* texture_manager = |
499 stub_->decoder()->GetContextGroup()->texture_manager(); | 500 stub_->decoder()->GetContextGroup()->texture_manager(); |
500 DCHECK(!texture_ref->texture()->IsLevelCleared(target, 0)); | 501 DCHECK(!texture_ref->texture()->IsLevelCleared(target, 0)); |
501 texture_manager->SetLevelCleared(texture_ref, target, 0, true); | 502 texture_manager->SetLevelCleared(texture_ref, target, 0, true); |
502 uncleared_textures_.erase(it); | 503 uncleared_textures_.erase(it); |
503 } | 504 } |
504 | 505 |
505 } // namespace content | 506 } // namespace content |
OLD | NEW |