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 18 matching lines...) Expand all Loading... |
29 #elif defined(OS_MACOSX) | 29 #elif defined(OS_MACOSX) |
30 #include "gpu/command_buffer/service/texture_manager.h" | 30 #include "gpu/command_buffer/service/texture_manager.h" |
31 #include "content/common/gpu/media/mac_video_decode_accelerator.h" | 31 #include "content/common/gpu/media/mac_video_decode_accelerator.h" |
32 #endif | 32 #endif |
33 | 33 |
34 #include "gpu/command_buffer/service/texture_manager.h" | 34 #include "gpu/command_buffer/service/texture_manager.h" |
35 #include "ui/gfx/size.h" | 35 #include "ui/gfx/size.h" |
36 | 36 |
37 using gpu::gles2::TextureManager; | 37 using gpu::gles2::TextureManager; |
38 | 38 |
| 39 namespace content { |
| 40 |
39 static bool MakeDecoderContextCurrent( | 41 static bool MakeDecoderContextCurrent( |
40 const base::WeakPtr<GpuCommandBufferStub> stub) { | 42 const base::WeakPtr<GpuCommandBufferStub> stub) { |
41 if (!stub) { | 43 if (!stub) { |
42 DLOG(ERROR) << "Stub is gone; won't MakeCurrent()."; | 44 DLOG(ERROR) << "Stub is gone; won't MakeCurrent()."; |
43 return false; | 45 return false; |
44 } | 46 } |
45 | 47 |
46 if (!stub->decoder()->MakeCurrent()) { | 48 if (!stub->decoder()->MakeCurrent()) { |
47 DLOG(ERROR) << "Failed to MakeCurrent()"; | 49 DLOG(ERROR) << "Failed to MakeCurrent()"; |
48 return false; | 50 return false; |
(...skipping 248 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
297 if (stub_) { | 299 if (stub_) { |
298 stub_->RemoveDestructionObserver(this); | 300 stub_->RemoveDestructionObserver(this); |
299 stub_.reset(); | 301 stub_.reset(); |
300 } | 302 } |
301 } | 303 } |
302 | 304 |
303 bool GpuVideoDecodeAccelerator::Send(IPC::Message* message) { | 305 bool GpuVideoDecodeAccelerator::Send(IPC::Message* message) { |
304 DCHECK(sender_); | 306 DCHECK(sender_); |
305 return sender_->Send(message); | 307 return sender_->Send(message); |
306 } | 308 } |
| 309 |
| 310 } // namespace content |
OLD | NEW |