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 37 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
48 } | 48 } |
49 | 49 |
50 if (!stub->decoder()->MakeCurrent()) { | 50 if (!stub->decoder()->MakeCurrent()) { |
51 DLOG(ERROR) << "Failed to MakeCurrent()"; | 51 DLOG(ERROR) << "Failed to MakeCurrent()"; |
52 return false; | 52 return false; |
53 } | 53 } |
54 | 54 |
55 return true; | 55 return true; |
56 } | 56 } |
57 | 57 |
58 GpuVideoDecodeAccelerator::GpuVideoDecodeAccelerator( | 58 GpuVideoDecodeAccelerator::GpuVideoDecodeAccelerator(int32 host_route_id, |
59 int32 host_route_id, | 59 GpuCommandBufferStub* stub) |
60 GpuCommandBufferStub* stub) | |
61 : init_done_msg_(NULL), | 60 : init_done_msg_(NULL), |
62 host_route_id_(host_route_id), | 61 host_route_id_(host_route_id), |
63 stub_(stub), | 62 stub_(stub), |
64 video_decode_accelerator_(NULL), | |
65 texture_target_(0) { | 63 texture_target_(0) { |
66 DCHECK(stub_); | 64 DCHECK(stub_); |
67 stub_->AddDestructionObserver(this); | 65 stub_->AddDestructionObserver(this); |
68 stub_->channel()->AddRoute(host_route_id_, this); | 66 stub_->channel()->AddRoute(host_route_id_, this); |
69 make_context_current_ = | 67 make_context_current_ = |
70 base::Bind(&MakeDecoderContextCurrent, stub_->AsWeakPtr()); | 68 base::Bind(&MakeDecoderContextCurrent, stub_->AsWeakPtr()); |
71 } | 69 } |
72 | 70 |
73 GpuVideoDecodeAccelerator::~GpuVideoDecodeAccelerator() { | 71 GpuVideoDecodeAccelerator::~GpuVideoDecodeAccelerator() { |
74 DCHECK(stub_); | 72 DCHECK(stub_); |
(...skipping 267 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
342 void GpuVideoDecodeAccelerator::OnWillDestroyStub() { | 340 void GpuVideoDecodeAccelerator::OnWillDestroyStub() { |
343 delete this; | 341 delete this; |
344 } | 342 } |
345 | 343 |
346 bool GpuVideoDecodeAccelerator::Send(IPC::Message* message) { | 344 bool GpuVideoDecodeAccelerator::Send(IPC::Message* message) { |
347 DCHECK(stub_); | 345 DCHECK(stub_); |
348 return stub_->channel()->Send(message); | 346 return stub_->channel()->Send(message); |
349 } | 347 } |
350 | 348 |
351 } // namespace content | 349 } // namespace content |
OLD | NEW |