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 27 matching lines...) Expand all Loading... |
38 using gpu::gles2::TextureManager; | 38 using gpu::gles2::TextureManager; |
39 | 39 |
40 static bool MakeDecoderContextCurrent(gpu::gles2::GLES2Decoder* decoder) { | 40 static bool MakeDecoderContextCurrent(gpu::gles2::GLES2Decoder* decoder) { |
41 bool success = decoder->MakeCurrent(); | 41 bool success = decoder->MakeCurrent(); |
42 if (!success) | 42 if (!success) |
43 DLOG(ERROR) << "Failed to MakeCurrent()"; | 43 DLOG(ERROR) << "Failed to MakeCurrent()"; |
44 return success; | 44 return success; |
45 } | 45 } |
46 | 46 |
47 GpuVideoDecodeAccelerator::GpuVideoDecodeAccelerator( | 47 GpuVideoDecodeAccelerator::GpuVideoDecodeAccelerator( |
48 IPC::Message::Sender* sender, | 48 IPC::Sender* sender, |
49 int32 host_route_id, | 49 int32 host_route_id, |
50 GpuCommandBufferStub* stub) | 50 GpuCommandBufferStub* stub) |
51 : sender_(sender), | 51 : sender_(sender), |
52 init_done_msg_(NULL), | 52 init_done_msg_(NULL), |
53 host_route_id_(host_route_id), | 53 host_route_id_(host_route_id), |
54 stub_(stub), | 54 stub_(stub), |
55 video_decode_accelerator_(NULL) { | 55 video_decode_accelerator_(NULL) { |
56 make_context_current_ = | 56 make_context_current_ = |
57 base::Bind(&MakeDecoderContextCurrent, stub_->decoder()); | 57 base::Bind(&MakeDecoderContextCurrent, stub_->decoder()); |
58 } | 58 } |
(...skipping 213 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
272 | 272 |
273 void GpuVideoDecodeAccelerator::NotifyResetDone() { | 273 void GpuVideoDecodeAccelerator::NotifyResetDone() { |
274 if (!Send(new AcceleratedVideoDecoderHostMsg_ResetDone(host_route_id_))) | 274 if (!Send(new AcceleratedVideoDecoderHostMsg_ResetDone(host_route_id_))) |
275 DLOG(ERROR) << "Send(AcceleratedVideoDecoderHostMsg_ResetDone) failed"; | 275 DLOG(ERROR) << "Send(AcceleratedVideoDecoderHostMsg_ResetDone) failed"; |
276 } | 276 } |
277 | 277 |
278 bool GpuVideoDecodeAccelerator::Send(IPC::Message* message) { | 278 bool GpuVideoDecodeAccelerator::Send(IPC::Message* message) { |
279 DCHECK(sender_); | 279 DCHECK(sender_); |
280 return sender_->Send(message); | 280 return sender_->Send(message); |
281 } | 281 } |
OLD | NEW |