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

Side by Side Diff: media/gpu/ipc/client/gpu_video_decode_accelerator_host.cc

Issue 2508203004: Add hints for potential overlay promotion on android. (Closed)
Patch Set: Created 4 years, 1 month 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
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 "media/gpu/ipc/client/gpu_video_decode_accelerator_host.h" 5 #include "media/gpu/ipc/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 "base/threading/thread_task_runner_handle.h" 10 #include "base/threading/thread_task_runner_handle.h"
(...skipping 237 matching lines...) Expand 10 before | Expand all | Expand 10 after
248 248
249 void GpuVideoDecodeAcceleratorHost::OnPictureReady( 249 void GpuVideoDecodeAcceleratorHost::OnPictureReady(
250 const AcceleratedVideoDecoderHostMsg_PictureReady_Params& params) { 250 const AcceleratedVideoDecoderHostMsg_PictureReady_Params& params) {
251 DCHECK(CalledOnValidThread()); 251 DCHECK(CalledOnValidThread());
252 if (!client_) 252 if (!client_)
253 return; 253 return;
254 Picture picture(params.picture_buffer_id, params.bitstream_buffer_id, 254 Picture picture(params.picture_buffer_id, params.bitstream_buffer_id,
255 params.visible_rect, params.color_space, 255 params.visible_rect, params.color_space,
256 params.allow_overlay); 256 params.allow_overlay);
257 picture.set_size_changed(params.size_changed); 257 picture.set_size_changed(params.size_changed);
258 picture.set_surface_texture(params.surface_texture);
258 client_->PictureReady(picture); 259 client_->PictureReady(picture);
259 } 260 }
260 261
261 void GpuVideoDecodeAcceleratorHost::OnFlushDone() { 262 void GpuVideoDecodeAcceleratorHost::OnFlushDone() {
262 DCHECK(CalledOnValidThread()); 263 DCHECK(CalledOnValidThread());
263 if (client_) 264 if (client_)
264 client_->NotifyFlushDone(); 265 client_->NotifyFlushDone();
265 } 266 }
266 267
267 void GpuVideoDecodeAcceleratorHost::OnResetDone() { 268 void GpuVideoDecodeAcceleratorHost::OnResetDone() {
268 DCHECK(CalledOnValidThread()); 269 DCHECK(CalledOnValidThread());
269 if (client_) 270 if (client_)
270 client_->NotifyResetDone(); 271 client_->NotifyResetDone();
271 } 272 }
272 273
273 void GpuVideoDecodeAcceleratorHost::OnNotifyError(uint32_t error) { 274 void GpuVideoDecodeAcceleratorHost::OnNotifyError(uint32_t error) {
274 DCHECK(CalledOnValidThread()); 275 DCHECK(CalledOnValidThread());
275 if (!client_) 276 if (!client_)
276 return; 277 return;
277 weak_this_factory_.InvalidateWeakPtrs(); 278 weak_this_factory_.InvalidateWeakPtrs();
278 279
279 // Client::NotifyError() may Destroy() |this|, so calling it needs to be the 280 // Client::NotifyError() may Destroy() |this|, so calling it needs to be the
280 // last thing done on this stack! 281 // last thing done on this stack!
281 VideoDecodeAccelerator::Client* client = NULL; 282 VideoDecodeAccelerator::Client* client = NULL;
282 std::swap(client, client_); 283 std::swap(client, client_);
283 client->NotifyError(static_cast<VideoDecodeAccelerator::Error>(error)); 284 client->NotifyError(static_cast<VideoDecodeAccelerator::Error>(error));
284 } 285 }
285 286
286 } // namespace media 287 } // namespace media
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698