Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(539)

Side by Side Diff: content/renderer/gpu/gpu_video_decode_accelerator_host.cc

Issue 7474006: PPB_VideoDecoder_Dev::Initialize is now synchronous! (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: vrk CR update. Created 9 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
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 "base/task.h" 10 #include "base/task.h"
(...skipping 25 matching lines...) Expand all
36 } 36 }
37 37
38 bool GpuVideoDecodeAcceleratorHost::OnMessageReceived(const IPC::Message& msg) { 38 bool GpuVideoDecodeAcceleratorHost::OnMessageReceived(const IPC::Message& msg) {
39 DCHECK(CalledOnValidThread()); 39 DCHECK(CalledOnValidThread());
40 bool handled = true; 40 bool handled = true;
41 IPC_BEGIN_MESSAGE_MAP(GpuVideoDecodeAcceleratorHost, msg) 41 IPC_BEGIN_MESSAGE_MAP(GpuVideoDecodeAcceleratorHost, msg)
42 IPC_MESSAGE_HANDLER(AcceleratedVideoDecoderHostMsg_BitstreamBufferProcessed, 42 IPC_MESSAGE_HANDLER(AcceleratedVideoDecoderHostMsg_BitstreamBufferProcessed,
43 OnBitstreamBufferProcessed) 43 OnBitstreamBufferProcessed)
44 IPC_MESSAGE_HANDLER(AcceleratedVideoDecoderHostMsg_ProvidePictureBuffers, 44 IPC_MESSAGE_HANDLER(AcceleratedVideoDecoderHostMsg_ProvidePictureBuffers,
45 OnProvidePictureBuffer) 45 OnProvidePictureBuffer)
46 IPC_MESSAGE_HANDLER(AcceleratedVideoDecoderHostMsg_InitializeDone,
47 OnInitializeDone)
48 IPC_MESSAGE_HANDLER(AcceleratedVideoDecoderHostMsg_PictureReady, 46 IPC_MESSAGE_HANDLER(AcceleratedVideoDecoderHostMsg_PictureReady,
49 OnPictureReady) 47 OnPictureReady)
50 IPC_MESSAGE_HANDLER(AcceleratedVideoDecoderHostMsg_FlushDone, 48 IPC_MESSAGE_HANDLER(AcceleratedVideoDecoderHostMsg_FlushDone,
51 OnFlushDone) 49 OnFlushDone)
52 IPC_MESSAGE_HANDLER(AcceleratedVideoDecoderHostMsg_ResetDone, 50 IPC_MESSAGE_HANDLER(AcceleratedVideoDecoderHostMsg_ResetDone,
53 OnResetDone) 51 OnResetDone)
54 IPC_MESSAGE_HANDLER(AcceleratedVideoDecoderHostMsg_EndOfStream, 52 IPC_MESSAGE_HANDLER(AcceleratedVideoDecoderHostMsg_EndOfStream,
55 OnEndOfStream) 53 OnEndOfStream)
56 IPC_MESSAGE_HANDLER(AcceleratedVideoDecoderHostMsg_ErrorNotification, 54 IPC_MESSAGE_HANDLER(AcceleratedVideoDecoderHostMsg_ErrorNotification,
57 OnErrorNotification) 55 OnErrorNotification)
(...skipping 78 matching lines...) Expand 10 before | Expand all | Expand 10 after
136 DCHECK(CalledOnValidThread()); 134 DCHECK(CalledOnValidThread());
137 client_->ProvidePictureBuffers(num_requested_buffers, buffer_size); 135 client_->ProvidePictureBuffers(num_requested_buffers, buffer_size);
138 } 136 }
139 137
140 void GpuVideoDecodeAcceleratorHost::OnDismissPictureBuffer( 138 void GpuVideoDecodeAcceleratorHost::OnDismissPictureBuffer(
141 int32 picture_buffer_id) { 139 int32 picture_buffer_id) {
142 DCHECK(CalledOnValidThread()); 140 DCHECK(CalledOnValidThread());
143 client_->DismissPictureBuffer(picture_buffer_id); 141 client_->DismissPictureBuffer(picture_buffer_id);
144 } 142 }
145 143
146 void GpuVideoDecodeAcceleratorHost::OnInitializeDone() {
147 DCHECK(CalledOnValidThread());
148 client_->NotifyInitializeDone();
149 }
150
151 void GpuVideoDecodeAcceleratorHost::OnPictureReady( 144 void GpuVideoDecodeAcceleratorHost::OnPictureReady(
152 int32 picture_buffer_id, int32 bitstream_buffer_id) { 145 int32 picture_buffer_id, int32 bitstream_buffer_id) {
153 DCHECK(CalledOnValidThread()); 146 DCHECK(CalledOnValidThread());
154 media::Picture picture(picture_buffer_id, bitstream_buffer_id); 147 media::Picture picture(picture_buffer_id, bitstream_buffer_id);
155 client_->PictureReady(picture); 148 client_->PictureReady(picture);
156 } 149 }
157 150
158 void GpuVideoDecodeAcceleratorHost::OnFlushDone() { 151 void GpuVideoDecodeAcceleratorHost::OnFlushDone() {
159 DCHECK(CalledOnValidThread()); 152 DCHECK(CalledOnValidThread());
160 client_->NotifyFlushDone(); 153 client_->NotifyFlushDone();
161 } 154 }
162 155
163 void GpuVideoDecodeAcceleratorHost::OnResetDone() { 156 void GpuVideoDecodeAcceleratorHost::OnResetDone() {
164 DCHECK(CalledOnValidThread()); 157 DCHECK(CalledOnValidThread());
165 client_->NotifyResetDone(); 158 client_->NotifyResetDone();
166 } 159 }
167 160
168 void GpuVideoDecodeAcceleratorHost::OnEndOfStream() { 161 void GpuVideoDecodeAcceleratorHost::OnEndOfStream() {
169 DCHECK(CalledOnValidThread()); 162 DCHECK(CalledOnValidThread());
170 client_->NotifyEndOfStream(); 163 client_->NotifyEndOfStream();
171 } 164 }
172 165
173 void GpuVideoDecodeAcceleratorHost::OnErrorNotification(uint32 error) { 166 void GpuVideoDecodeAcceleratorHost::OnErrorNotification(uint32 error) {
174 DCHECK(CalledOnValidThread()); 167 DCHECK(CalledOnValidThread());
175 client_->NotifyError( 168 client_->NotifyError(
176 static_cast<media::VideoDecodeAccelerator::Error>(error)); 169 static_cast<media::VideoDecodeAccelerator::Error>(error));
177 } 170 }
OLDNEW
« no previous file with comments | « content/renderer/gpu/gpu_video_decode_accelerator_host.h ('k') | content/renderer/pepper_platform_video_decoder_impl.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698