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

Side by Side Diff: content/common/gpu/media/gpu_video_decode_accelerator.cc

Issue 1963773003: Merge to M51: Various fixes to prevent playback hang on MotoX. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@2704
Patch Set: Created 4 years, 7 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
« no previous file with comments | « content/common/gpu/media/avda_shared_state.cc ('k') | media/base/video_decoder.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 "content/common/gpu/media/gpu_video_decode_accelerator.h" 5 #include "content/common/gpu/media/gpu_video_decode_accelerator.h"
6 6
7 #include <vector> 7 #include <vector>
8 8
9 #include "base/bind.h" 9 #include "base/bind.h"
10 #include "base/location.h" 10 #include "base/location.h"
(...skipping 450 matching lines...) Expand 10 before | Expand all | Expand 10 after
461 width, height, 1, 0, format, 0, 461 width, height, 1, 0, format, 0,
462 gfx::Rect()); 462 gfx::Rect());
463 } 463 }
464 } 464 }
465 service_ids.push_back(texture_ref->service_id()); 465 service_ids.push_back(texture_ref->service_id());
466 textures.push_back(texture_ref); 466 textures.push_back(texture_ref);
467 } 467 }
468 buffers.push_back(media::PictureBuffer(buffer_ids[i], texture_dimensions_, 468 buffers.push_back(media::PictureBuffer(buffer_ids[i], texture_dimensions_,
469 service_ids, buffer_texture_ids)); 469 service_ids, buffer_texture_ids));
470 } 470 }
471 {
472 DebugAutoLock auto_lock(debug_uncleared_textures_lock_);
473 for (uint32_t i = 0; i < buffer_ids.size(); ++i)
474 uncleared_textures_[buffer_ids[i]] = textures[i];
475 }
471 video_decode_accelerator_->AssignPictureBuffers(buffers); 476 video_decode_accelerator_->AssignPictureBuffers(buffers);
472 DebugAutoLock auto_lock(debug_uncleared_textures_lock_);
473 for (uint32_t i = 0; i < buffer_ids.size(); ++i)
474 uncleared_textures_[buffer_ids[i]] = textures[i];
475 } 477 }
476 478
477 void GpuVideoDecodeAccelerator::OnReusePictureBuffer( 479 void GpuVideoDecodeAccelerator::OnReusePictureBuffer(
478 int32_t picture_buffer_id) { 480 int32_t picture_buffer_id) {
479 DCHECK(video_decode_accelerator_); 481 DCHECK(video_decode_accelerator_);
480 video_decode_accelerator_->ReusePictureBuffer(picture_buffer_id); 482 video_decode_accelerator_->ReusePictureBuffer(picture_buffer_id);
481 } 483 }
482 484
483 void GpuVideoDecodeAccelerator::OnFlush() { 485 void GpuVideoDecodeAccelerator::OnFlush() {
484 DCHECK(video_decode_accelerator_); 486 DCHECK(video_decode_accelerator_);
(...skipping 28 matching lines...) Expand all
513 scoped_refptr<gpu::gles2::TextureRef> texture_ref = it->second; 515 scoped_refptr<gpu::gles2::TextureRef> texture_ref = it->second;
514 GLenum target = texture_ref->texture()->target(); 516 GLenum target = texture_ref->texture()->target();
515 gpu::gles2::TextureManager* texture_manager = 517 gpu::gles2::TextureManager* texture_manager =
516 stub_->decoder()->GetContextGroup()->texture_manager(); 518 stub_->decoder()->GetContextGroup()->texture_manager();
517 DCHECK(!texture_ref->texture()->IsLevelCleared(target, 0)); 519 DCHECK(!texture_ref->texture()->IsLevelCleared(target, 0));
518 texture_manager->SetLevelCleared(texture_ref.get(), target, 0, true); 520 texture_manager->SetLevelCleared(texture_ref.get(), target, 0, true);
519 uncleared_textures_.erase(it); 521 uncleared_textures_.erase(it);
520 } 522 }
521 523
522 } // namespace content 524 } // namespace content
OLDNEW
« no previous file with comments | « content/common/gpu/media/avda_shared_state.cc ('k') | media/base/video_decoder.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698