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/gpu/gpu_video_decode_accelerator_host.h" | 5 #include "content/renderer/gpu/gpu_video_decode_accelerator_host.h" |
6 | 6 |
7 #include "base/bind.h" | 7 #include "base/bind.h" |
8 #include "base/logging.h" | 8 #include "base/logging.h" |
9 #include "base/message_loop.h" | 9 #include "base/message_loop.h" |
10 #include "content/common/gpu/gpu_messages.h" | 10 #include "content/common/gpu/gpu_messages.h" |
(...skipping 30 matching lines...) Expand all Loading... |
41 IPC_MESSAGE_HANDLER(AcceleratedVideoDecoderHostMsg_BitstreamBufferProcessed, | 41 IPC_MESSAGE_HANDLER(AcceleratedVideoDecoderHostMsg_BitstreamBufferProcessed, |
42 OnBitstreamBufferProcessed) | 42 OnBitstreamBufferProcessed) |
43 IPC_MESSAGE_HANDLER(AcceleratedVideoDecoderHostMsg_ProvidePictureBuffers, | 43 IPC_MESSAGE_HANDLER(AcceleratedVideoDecoderHostMsg_ProvidePictureBuffers, |
44 OnProvidePictureBuffer) | 44 OnProvidePictureBuffer) |
45 IPC_MESSAGE_HANDLER(AcceleratedVideoDecoderHostMsg_PictureReady, | 45 IPC_MESSAGE_HANDLER(AcceleratedVideoDecoderHostMsg_PictureReady, |
46 OnPictureReady) | 46 OnPictureReady) |
47 IPC_MESSAGE_HANDLER(AcceleratedVideoDecoderHostMsg_FlushDone, | 47 IPC_MESSAGE_HANDLER(AcceleratedVideoDecoderHostMsg_FlushDone, |
48 OnFlushDone) | 48 OnFlushDone) |
49 IPC_MESSAGE_HANDLER(AcceleratedVideoDecoderHostMsg_ResetDone, | 49 IPC_MESSAGE_HANDLER(AcceleratedVideoDecoderHostMsg_ResetDone, |
50 OnResetDone) | 50 OnResetDone) |
51 IPC_MESSAGE_HANDLER(AcceleratedVideoDecoderHostMsg_EndOfStream, | |
52 OnEndOfStream) | |
53 IPC_MESSAGE_HANDLER(AcceleratedVideoDecoderHostMsg_ErrorNotification, | 51 IPC_MESSAGE_HANDLER(AcceleratedVideoDecoderHostMsg_ErrorNotification, |
54 OnErrorNotification) | 52 OnErrorNotification) |
55 IPC_MESSAGE_UNHANDLED(handled = false) | 53 IPC_MESSAGE_UNHANDLED(handled = false) |
56 IPC_END_MESSAGE_MAP() | 54 IPC_END_MESSAGE_MAP() |
57 DCHECK(handled); | 55 DCHECK(handled); |
58 return handled; | 56 return handled; |
59 } | 57 } |
60 | 58 |
61 bool GpuVideoDecodeAcceleratorHost::Initialize(Profile profile) { | 59 bool GpuVideoDecodeAcceleratorHost::Initialize(Profile profile) { |
62 NOTREACHED(); | 60 NOTREACHED(); |
(...skipping 95 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
158 if (client_) | 156 if (client_) |
159 client_->NotifyFlushDone(); | 157 client_->NotifyFlushDone(); |
160 } | 158 } |
161 | 159 |
162 void GpuVideoDecodeAcceleratorHost::OnResetDone() { | 160 void GpuVideoDecodeAcceleratorHost::OnResetDone() { |
163 DCHECK(CalledOnValidThread()); | 161 DCHECK(CalledOnValidThread()); |
164 if (client_) | 162 if (client_) |
165 client_->NotifyResetDone(); | 163 client_->NotifyResetDone(); |
166 } | 164 } |
167 | 165 |
168 void GpuVideoDecodeAcceleratorHost::OnEndOfStream() { | |
169 DCHECK(CalledOnValidThread()); | |
170 if (client_) | |
171 client_->NotifyEndOfStream(); | |
172 } | |
173 | |
174 void GpuVideoDecodeAcceleratorHost::OnErrorNotification(uint32 error) { | 166 void GpuVideoDecodeAcceleratorHost::OnErrorNotification(uint32 error) { |
175 DCHECK(CalledOnValidThread()); | 167 DCHECK(CalledOnValidThread()); |
176 if (!client_) | 168 if (!client_) |
177 return; | 169 return; |
178 client_->NotifyError( | 170 client_->NotifyError( |
179 static_cast<media::VideoDecodeAccelerator::Error>(error)); | 171 static_cast<media::VideoDecodeAccelerator::Error>(error)); |
180 } | 172 } |
OLD | NEW |