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

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

Issue 1750213002: Fix Android black frames from MSE config changes. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fix cros build Created 4 years, 9 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
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 "base/thread_task_runner_handle.h" 10 #include "base/thread_task_runner_handle.h"
(...skipping 226 matching lines...) Expand 10 before | Expand all | Expand 10 after
237 int32_t picture_buffer_id) { 237 int32_t picture_buffer_id) {
238 DCHECK(CalledOnValidThread()); 238 DCHECK(CalledOnValidThread());
239 if (client_) 239 if (client_)
240 client_->DismissPictureBuffer(picture_buffer_id); 240 client_->DismissPictureBuffer(picture_buffer_id);
241 } 241 }
242 242
243 void GpuVideoDecodeAcceleratorHost::OnPictureReady( 243 void GpuVideoDecodeAcceleratorHost::OnPictureReady(
244 int32_t picture_buffer_id, 244 int32_t picture_buffer_id,
245 int32_t bitstream_buffer_id, 245 int32_t bitstream_buffer_id,
246 const gfx::Rect& visible_rect, 246 const gfx::Rect& visible_rect,
247 bool allow_overlay) { 247 bool allow_overlay,
248 bool size_changed) {
liberato (no reviews please) 2016/03/05 08:51:00 another option is to start sending 'int32_t flags'
chcunningham 2016/03/08 03:19:36 I like this idea. This will involve changing a lot
chcunningham 2016/03/08 22:19:12 Decided not to make it int32. I started to feel ba
248 DCHECK(CalledOnValidThread()); 249 DCHECK(CalledOnValidThread());
249 if (!client_) 250 if (!client_)
250 return; 251 return;
251 media::Picture picture(picture_buffer_id, bitstream_buffer_id, visible_rect, 252 media::Picture picture(picture_buffer_id, bitstream_buffer_id, visible_rect,
252 allow_overlay); 253 allow_overlay, size_changed);
253 client_->PictureReady(picture); 254 client_->PictureReady(picture);
254 } 255 }
255 256
256 void GpuVideoDecodeAcceleratorHost::OnFlushDone() { 257 void GpuVideoDecodeAcceleratorHost::OnFlushDone() {
257 DCHECK(CalledOnValidThread()); 258 DCHECK(CalledOnValidThread());
258 if (client_) 259 if (client_)
259 client_->NotifyFlushDone(); 260 client_->NotifyFlushDone();
260 } 261 }
261 262
262 void GpuVideoDecodeAcceleratorHost::OnResetDone() { 263 void GpuVideoDecodeAcceleratorHost::OnResetDone() {
263 DCHECK(CalledOnValidThread()); 264 DCHECK(CalledOnValidThread());
264 if (client_) 265 if (client_)
265 client_->NotifyResetDone(); 266 client_->NotifyResetDone();
266 } 267 }
267 268
268 void GpuVideoDecodeAcceleratorHost::OnNotifyError(uint32_t error) { 269 void GpuVideoDecodeAcceleratorHost::OnNotifyError(uint32_t error) {
269 DCHECK(CalledOnValidThread()); 270 DCHECK(CalledOnValidThread());
270 if (!client_) 271 if (!client_)
271 return; 272 return;
272 weak_this_factory_.InvalidateWeakPtrs(); 273 weak_this_factory_.InvalidateWeakPtrs();
273 274
274 // Client::NotifyError() may Destroy() |this|, so calling it needs to be the 275 // Client::NotifyError() may Destroy() |this|, so calling it needs to be the
275 // last thing done on this stack! 276 // last thing done on this stack!
276 media::VideoDecodeAccelerator::Client* client = NULL; 277 media::VideoDecodeAccelerator::Client* client = NULL;
277 std::swap(client, client_); 278 std::swap(client, client_);
278 client->NotifyError(static_cast<media::VideoDecodeAccelerator::Error>(error)); 279 client->NotifyError(static_cast<media::VideoDecodeAccelerator::Error>(error));
279 } 280 }
280 281
281 } // namespace content 282 } // namespace content
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698