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

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

Issue 137023008: Add support for Tegra V4L2 VDA (Closed) Base URL: https://chromium.googlesource.com/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 255 matching lines...) Expand 10 before | Expand all | Expand 10 after
266 #if defined(OS_WIN) 266 #if defined(OS_WIN)
267 if (base::win::GetVersion() < base::win::VERSION_WIN7) { 267 if (base::win::GetVersion() < base::win::VERSION_WIN7) {
268 NOTIMPLEMENTED() << "HW video decode acceleration not available."; 268 NOTIMPLEMENTED() << "HW video decode acceleration not available.";
269 NotifyError(media::VideoDecodeAccelerator::PLATFORM_FAILURE); 269 NotifyError(media::VideoDecodeAccelerator::PLATFORM_FAILURE);
270 return; 270 return;
271 } 271 }
272 DVLOG(0) << "Initializing DXVA HW decoder for windows."; 272 DVLOG(0) << "Initializing DXVA HW decoder for windows.";
273 video_decode_accelerator_.reset( 273 video_decode_accelerator_.reset(
274 new DXVAVideoDecodeAccelerator(make_context_current_)); 274 new DXVAVideoDecodeAccelerator(make_context_current_));
275 #elif defined(OS_CHROMEOS) && defined(ARCH_CPU_ARMEL) && defined(USE_X11) 275 #elif defined(OS_CHROMEOS) && defined(ARCH_CPU_ARMEL) && defined(USE_X11)
276 scoped_ptr<V4L2Device> device = V4L2Device::Create(); 276 scoped_ptr<V4L2Device> device =
277 V4L2Device::Create(stub_->decoder()->GetGLContext()->GetHandle());
277 if (!device.get()) { 278 if (!device.get()) {
278 NotifyError(media::VideoDecodeAccelerator::PLATFORM_FAILURE); 279 NotifyError(media::VideoDecodeAccelerator::PLATFORM_FAILURE);
279 return; 280 return;
280 } 281 }
281 video_decode_accelerator_.reset( 282 video_decode_accelerator_.reset(
282 new V4L2VideoDecodeAccelerator(gfx::GLSurfaceEGL::GetHardwareDisplay(), 283 new V4L2VideoDecodeAccelerator(gfx::GLSurfaceEGL::GetHardwareDisplay(),
283 weak_factory_for_io_.GetWeakPtr(), 284 weak_factory_for_io_.GetWeakPtr(),
284 make_context_current_, 285 make_context_current_,
285 device.Pass(), 286 device.Pass(),
286 io_message_loop_)); 287 io_message_loop_));
(...skipping 221 matching lines...) Expand 10 before | Expand all | Expand 10 after
508 scoped_refptr<gpu::gles2::TextureRef> texture_ref = it->second; 509 scoped_refptr<gpu::gles2::TextureRef> texture_ref = it->second;
509 GLenum target = texture_ref->texture()->target(); 510 GLenum target = texture_ref->texture()->target();
510 gpu::gles2::TextureManager* texture_manager = 511 gpu::gles2::TextureManager* texture_manager =
511 stub_->decoder()->GetContextGroup()->texture_manager(); 512 stub_->decoder()->GetContextGroup()->texture_manager();
512 DCHECK(!texture_ref->texture()->IsLevelCleared(target, 0)); 513 DCHECK(!texture_ref->texture()->IsLevelCleared(target, 0));
513 texture_manager->SetLevelCleared(texture_ref, target, 0, true); 514 texture_manager->SetLevelCleared(texture_ref, target, 0, true);
514 uncleared_textures_.erase(it); 515 uncleared_textures_.erase(it);
515 } 516 }
516 517
517 } // namespace content 518 } // namespace content
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698