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

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: rebased Created 4 years 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
« no previous file with comments | « media/gpu/android_video_decode_accelerator.cc ('k') | media/gpu/ipc/common/media_messages.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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);
259 picture.set_wants_promotion_hint(params.wants_promotion_hint);
258 client_->PictureReady(picture); 260 client_->PictureReady(picture);
259 } 261 }
260 262
261 void GpuVideoDecodeAcceleratorHost::OnFlushDone() { 263 void GpuVideoDecodeAcceleratorHost::OnFlushDone() {
262 DCHECK(CalledOnValidThread()); 264 DCHECK(CalledOnValidThread());
263 if (client_) 265 if (client_)
264 client_->NotifyFlushDone(); 266 client_->NotifyFlushDone();
265 } 267 }
266 268
267 void GpuVideoDecodeAcceleratorHost::OnResetDone() { 269 void GpuVideoDecodeAcceleratorHost::OnResetDone() {
268 DCHECK(CalledOnValidThread()); 270 DCHECK(CalledOnValidThread());
269 if (client_) 271 if (client_)
270 client_->NotifyResetDone(); 272 client_->NotifyResetDone();
271 } 273 }
272 274
273 void GpuVideoDecodeAcceleratorHost::OnNotifyError(uint32_t error) { 275 void GpuVideoDecodeAcceleratorHost::OnNotifyError(uint32_t error) {
274 DCHECK(CalledOnValidThread()); 276 DCHECK(CalledOnValidThread());
275 if (!client_) 277 if (!client_)
276 return; 278 return;
277 weak_this_factory_.InvalidateWeakPtrs(); 279 weak_this_factory_.InvalidateWeakPtrs();
278 280
279 // Client::NotifyError() may Destroy() |this|, so calling it needs to be the 281 // Client::NotifyError() may Destroy() |this|, so calling it needs to be the
280 // last thing done on this stack! 282 // last thing done on this stack!
281 VideoDecodeAccelerator::Client* client = NULL; 283 VideoDecodeAccelerator::Client* client = NULL;
282 std::swap(client, client_); 284 std::swap(client, client_);
283 client->NotifyError(static_cast<VideoDecodeAccelerator::Error>(error)); 285 client->NotifyError(static_cast<VideoDecodeAccelerator::Error>(error));
284 } 286 }
285 287
286 } // namespace media 288 } // namespace media
OLDNEW
« no previous file with comments | « media/gpu/android_video_decode_accelerator.cc ('k') | media/gpu/ipc/common/media_messages.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698