Chromium Code Reviews| OLD | NEW |
|---|---|
| 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 <memory> | 7 #include <memory> |
| 8 #include <vector> | 8 #include <vector> |
| 9 | 9 |
| 10 #include "base/bind.h" | 10 #include "base/bind.h" |
| (...skipping 453 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 464 gfx::Rect()); | 464 gfx::Rect()); |
| 465 } | 465 } |
| 466 } | 466 } |
| 467 service_ids.push_back(texture_ref->service_id()); | 467 service_ids.push_back(texture_ref->service_id()); |
| 468 current_textures.push_back(texture_ref); | 468 current_textures.push_back(texture_ref); |
| 469 } | 469 } |
| 470 textures.push_back(current_textures); | 470 textures.push_back(current_textures); |
| 471 buffers.push_back(media::PictureBuffer(buffer_ids[i], texture_dimensions_, | 471 buffers.push_back(media::PictureBuffer(buffer_ids[i], texture_dimensions_, |
| 472 service_ids, buffer_texture_ids)); | 472 service_ids, buffer_texture_ids)); |
| 473 } | 473 } |
| 474 { | |
|
liberato (no reviews please)
2016/04/25 19:58:22
in case Assign => DoIOTask => PictureReady? deja
DaleCurtis
2016/04/25 22:32:22
Yup, exactly.
| |
| 475 DebugAutoLock auto_lock(debug_uncleared_textures_lock_); | |
| 476 for (uint32_t i = 0; i < buffer_ids.size(); ++i) | |
| 477 uncleared_textures_[buffer_ids[i]] = textures[i]; | |
| 478 } | |
| 474 video_decode_accelerator_->AssignPictureBuffers(buffers); | 479 video_decode_accelerator_->AssignPictureBuffers(buffers); |
| 475 DebugAutoLock auto_lock(debug_uncleared_textures_lock_); | |
| 476 for (uint32_t i = 0; i < buffer_ids.size(); ++i) | |
| 477 uncleared_textures_[buffer_ids[i]] = textures[i]; | |
| 478 } | 480 } |
| 479 | 481 |
| 480 void GpuVideoDecodeAccelerator::OnReusePictureBuffer( | 482 void GpuVideoDecodeAccelerator::OnReusePictureBuffer( |
| 481 int32_t picture_buffer_id) { | 483 int32_t picture_buffer_id) { |
| 482 DCHECK(video_decode_accelerator_); | 484 DCHECK(video_decode_accelerator_); |
| 483 video_decode_accelerator_->ReusePictureBuffer(picture_buffer_id); | 485 video_decode_accelerator_->ReusePictureBuffer(picture_buffer_id); |
| 484 } | 486 } |
| 485 | 487 |
| 486 void GpuVideoDecodeAccelerator::OnFlush() { | 488 void GpuVideoDecodeAccelerator::OnFlush() { |
| 487 DCHECK(video_decode_accelerator_); | 489 DCHECK(video_decode_accelerator_); |
| (...skipping 28 matching lines...) Expand all Loading... | |
| 516 GLenum target = texture_ref->texture()->target(); | 518 GLenum target = texture_ref->texture()->target(); |
| 517 gpu::gles2::TextureManager* texture_manager = | 519 gpu::gles2::TextureManager* texture_manager = |
| 518 stub_->decoder()->GetContextGroup()->texture_manager(); | 520 stub_->decoder()->GetContextGroup()->texture_manager(); |
| 519 DCHECK(!texture_ref->texture()->IsLevelCleared(target, 0)); | 521 DCHECK(!texture_ref->texture()->IsLevelCleared(target, 0)); |
| 520 texture_manager->SetLevelCleared(texture_ref.get(), target, 0, true); | 522 texture_manager->SetLevelCleared(texture_ref.get(), target, 0, true); |
| 521 } | 523 } |
| 522 uncleared_textures_.erase(it); | 524 uncleared_textures_.erase(it); |
| 523 } | 525 } |
| 524 | 526 |
| 525 } // namespace content | 527 } // namespace content |
| OLD | NEW |