OLD | NEW |
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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/renderer/pepper_platform_video_decoder_impl.h" | 5 #include "content/renderer/pepper_platform_video_decoder_impl.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" |
11 #include "content/common/child_process.h" | 11 #include "content/common/child_process.h" |
12 #include "content/renderer/gpu/gpu_channel_host.h" | 12 #include "content/renderer/gpu/gpu_channel_host.h" |
13 #include "content/renderer/render_thread.h" | 13 #include "content/renderer/render_thread.h" |
14 | 14 |
15 using media::BitstreamBuffer; | 15 using media::BitstreamBuffer; |
16 | 16 |
17 PlatformVideoDecoderImpl::PlatformVideoDecoderImpl( | 17 PlatformVideoDecoderImpl::PlatformVideoDecoderImpl( |
18 VideoDecodeAccelerator::Client* client, | 18 VideoDecodeAccelerator::Client* client, |
19 int32 command_buffer_route_id, | 19 int32 command_buffer_route_id, |
20 gpu::CommandBufferHelper* cmd_buffer_helper) | 20 gpu::CommandBufferHelper* cmd_buffer_helper) |
21 : client_(client), | 21 : client_(client), |
22 command_buffer_route_id_(command_buffer_route_id), | 22 command_buffer_route_id_(command_buffer_route_id), |
23 cmd_buffer_helper_(cmd_buffer_helper), | 23 cmd_buffer_helper_(cmd_buffer_helper) { |
24 decoder_(NULL) { | |
25 DCHECK(client); | 24 DCHECK(client); |
26 } | 25 } |
27 | 26 |
28 PlatformVideoDecoderImpl::~PlatformVideoDecoderImpl() {} | 27 PlatformVideoDecoderImpl::~PlatformVideoDecoderImpl() {} |
29 | 28 |
30 bool PlatformVideoDecoderImpl::Initialize(const std::vector<uint32>& configs) { | 29 bool PlatformVideoDecoderImpl::Initialize(const std::vector<uint32>& configs) { |
31 // TODO(vrk): Support multiple decoders. | 30 // TODO(vrk): Support multiple decoders. |
32 if (decoder_) | 31 if (decoder_) |
33 return true; | 32 return true; |
34 | 33 |
(...skipping 91 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
126 | 125 |
127 void PlatformVideoDecoderImpl::NotifyFlushDone() { | 126 void PlatformVideoDecoderImpl::NotifyFlushDone() { |
128 DCHECK_EQ(RenderThread::current()->message_loop(), MessageLoop::current()); | 127 DCHECK_EQ(RenderThread::current()->message_loop(), MessageLoop::current()); |
129 client_->NotifyFlushDone(); | 128 client_->NotifyFlushDone(); |
130 } | 129 } |
131 | 130 |
132 void PlatformVideoDecoderImpl::NotifyResetDone() { | 131 void PlatformVideoDecoderImpl::NotifyResetDone() { |
133 DCHECK_EQ(RenderThread::current()->message_loop(), MessageLoop::current()); | 132 DCHECK_EQ(RenderThread::current()->message_loop(), MessageLoop::current()); |
134 client_->NotifyResetDone(); | 133 client_->NotifyResetDone(); |
135 } | 134 } |
136 | |
137 void PlatformVideoDecoderImpl::NotifyDestroyDone() { | |
138 DCHECK_EQ(RenderThread::current()->message_loop(), MessageLoop::current()); | |
139 client_->NotifyDestroyDone(); | |
140 } | |
OLD | NEW |