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

Side by Side Diff: content/common/gpu/client/gpu_video_decode_accelerator_host.cc

Issue 426873004: Pass decoded picture size from VDA to client (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: use gfx::Size Created 6 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) 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/client/gpu_video_decode_accelerator_host.h" 5 #include "content/common/gpu/client/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/message_loop.h" 9 #include "base/message_loop/message_loop.h"
10 #include "content/common/gpu/client/gpu_channel_host.h" 10 #include "content/common/gpu/client/gpu_channel_host.h"
(...skipping 213 matching lines...) Expand 10 before | Expand all | Expand 10 after
224 } 224 }
225 225
226 void GpuVideoDecodeAcceleratorHost::OnDismissPictureBuffer( 226 void GpuVideoDecodeAcceleratorHost::OnDismissPictureBuffer(
227 int32 picture_buffer_id) { 227 int32 picture_buffer_id) {
228 DCHECK(CalledOnValidThread()); 228 DCHECK(CalledOnValidThread());
229 if (client_) 229 if (client_)
230 client_->DismissPictureBuffer(picture_buffer_id); 230 client_->DismissPictureBuffer(picture_buffer_id);
231 } 231 }
232 232
233 void GpuVideoDecodeAcceleratorHost::OnPictureReady( 233 void GpuVideoDecodeAcceleratorHost::OnPictureReady(
234 int32 picture_buffer_id, int32 bitstream_buffer_id) { 234 int32 picture_buffer_id, int32 bitstream_buffer_id, const gfx::Size& size) {
235 DCHECK(CalledOnValidThread()); 235 DCHECK(CalledOnValidThread());
236 if (!client_) 236 if (!client_)
237 return; 237 return;
238 media::Picture picture(picture_buffer_id, bitstream_buffer_id); 238 media::Picture picture(picture_buffer_id, bitstream_buffer_id, size);
239 client_->PictureReady(picture); 239 client_->PictureReady(picture);
240 } 240 }
241 241
242 void GpuVideoDecodeAcceleratorHost::OnFlushDone() { 242 void GpuVideoDecodeAcceleratorHost::OnFlushDone() {
243 DCHECK(CalledOnValidThread()); 243 DCHECK(CalledOnValidThread());
244 if (client_) 244 if (client_)
245 client_->NotifyFlushDone(); 245 client_->NotifyFlushDone();
246 } 246 }
247 247
248 void GpuVideoDecodeAcceleratorHost::OnResetDone() { 248 void GpuVideoDecodeAcceleratorHost::OnResetDone() {
249 DCHECK(CalledOnValidThread()); 249 DCHECK(CalledOnValidThread());
250 if (client_) 250 if (client_)
251 client_->NotifyResetDone(); 251 client_->NotifyResetDone();
252 } 252 }
253 253
254 void GpuVideoDecodeAcceleratorHost::OnNotifyError(uint32 error) { 254 void GpuVideoDecodeAcceleratorHost::OnNotifyError(uint32 error) {
255 DCHECK(CalledOnValidThread()); 255 DCHECK(CalledOnValidThread());
256 if (!client_) 256 if (!client_)
257 return; 257 return;
258 weak_this_factory_.InvalidateWeakPtrs(); 258 weak_this_factory_.InvalidateWeakPtrs();
259 259
260 // Client::NotifyError() may Destroy() |this|, so calling it needs to be the 260 // Client::NotifyError() may Destroy() |this|, so calling it needs to be the
261 // last thing done on this stack! 261 // last thing done on this stack!
262 media::VideoDecodeAccelerator::Client* client = NULL; 262 media::VideoDecodeAccelerator::Client* client = NULL;
263 std::swap(client, client_); 263 std::swap(client, client_);
264 client->NotifyError(static_cast<media::VideoDecodeAccelerator::Error>(error)); 264 client->NotifyError(static_cast<media::VideoDecodeAccelerator::Error>(error));
265 } 265 }
266 266
267 } // namespace content 267 } // namespace content
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698