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/logging.h" | 10 #include "base/logging.h" |
(...skipping 151 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
162 } | 162 } |
163 #endif | 163 #endif |
164 | 164 |
165 #if defined(OS_WIN) | 165 #if defined(OS_WIN) |
166 if (base::win::GetVersion() < base::win::VERSION_WIN7) { | 166 if (base::win::GetVersion() < base::win::VERSION_WIN7) { |
167 NOTIMPLEMENTED() << "HW video decode acceleration not available."; | 167 NOTIMPLEMENTED() << "HW video decode acceleration not available."; |
168 NotifyError(media::VideoDecodeAccelerator::PLATFORM_FAILURE); | 168 NotifyError(media::VideoDecodeAccelerator::PLATFORM_FAILURE); |
169 return; | 169 return; |
170 } | 170 } |
171 DLOG(INFO) << "Initializing DXVA HW decoder for windows."; | 171 DLOG(INFO) << "Initializing DXVA HW decoder for windows."; |
172 video_decode_accelerator_.reset(new DXVAVideoDecodeAccelerator(this)); | 172 video_decode_accelerator_.reset(new DXVAVideoDecodeAccelerator( |
| 173 this, make_context_current_)); |
173 #elif defined(OS_CHROMEOS) && defined(ARCH_CPU_ARMEL) | 174 #elif defined(OS_CHROMEOS) && defined(ARCH_CPU_ARMEL) |
174 video_decode_accelerator_.reset(new OmxVideoDecodeAccelerator( | 175 video_decode_accelerator_.reset(new OmxVideoDecodeAccelerator( |
175 gfx::GLSurfaceEGL::GetHardwareDisplay(), | 176 gfx::GLSurfaceEGL::GetHardwareDisplay(), |
176 stub_->decoder()->GetGLContext()->GetHandle(), | 177 stub_->decoder()->GetGLContext()->GetHandle(), |
177 this)); | 178 this)); |
178 #elif defined(OS_CHROMEOS) && defined(ARCH_CPU_X86_FAMILY) | 179 #elif defined(OS_CHROMEOS) && defined(ARCH_CPU_X86_FAMILY) |
179 gfx::GLContextGLX* glx_context = | 180 gfx::GLContextGLX* glx_context = |
180 static_cast<gfx::GLContextGLX*>(stub_->decoder()->GetGLContext()); | 181 static_cast<gfx::GLContextGLX*>(stub_->decoder()->GetGLContext()); |
181 GLXContext glx_context_handle = | 182 GLXContext glx_context_handle = |
182 static_cast<GLXContext>(glx_context->GetHandle()); | 183 static_cast<GLXContext>(glx_context->GetHandle()); |
(...skipping 112 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
295 if (stub_) { | 296 if (stub_) { |
296 stub_->RemoveDestructionObserver(this); | 297 stub_->RemoveDestructionObserver(this); |
297 stub_.reset(); | 298 stub_.reset(); |
298 } | 299 } |
299 } | 300 } |
300 | 301 |
301 bool GpuVideoDecodeAccelerator::Send(IPC::Message* message) { | 302 bool GpuVideoDecodeAccelerator::Send(IPC::Message* message) { |
302 DCHECK(sender_); | 303 DCHECK(sender_); |
303 return sender_->Send(message); | 304 return sender_->Send(message); |
304 } | 305 } |
OLD | NEW |