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

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

Issue 1816203003: Add an additional VDA::Flush() mode to return all allocated buffers. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: 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/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 584 matching lines...) Expand 10 before | Expand all | Expand 10 after
595 for (uint32_t i = 0; i < buffer_ids.size(); ++i) 595 for (uint32_t i = 0; i < buffer_ids.size(); ++i)
596 uncleared_textures_[buffer_ids[i]] = textures[i]; 596 uncleared_textures_[buffer_ids[i]] = textures[i];
597 } 597 }
598 598
599 void GpuVideoDecodeAccelerator::OnReusePictureBuffer( 599 void GpuVideoDecodeAccelerator::OnReusePictureBuffer(
600 int32_t picture_buffer_id) { 600 int32_t picture_buffer_id) {
601 DCHECK(video_decode_accelerator_); 601 DCHECK(video_decode_accelerator_);
602 video_decode_accelerator_->ReusePictureBuffer(picture_buffer_id); 602 video_decode_accelerator_->ReusePictureBuffer(picture_buffer_id);
603 } 603 }
604 604
605 void GpuVideoDecodeAccelerator::OnFlush() { 605 void GpuVideoDecodeAccelerator::OnFlush(bool return_buffers) {
606 DCHECK(video_decode_accelerator_); 606 DCHECK(video_decode_accelerator_);
607 video_decode_accelerator_->Flush(); 607 video_decode_accelerator_->Flush(return_buffers);
608 } 608 }
609 609
610 void GpuVideoDecodeAccelerator::OnReset() { 610 void GpuVideoDecodeAccelerator::OnReset() {
611 DCHECK(video_decode_accelerator_); 611 DCHECK(video_decode_accelerator_);
612 video_decode_accelerator_->Reset(); 612 video_decode_accelerator_->Reset();
613 } 613 }
614 614
615 void GpuVideoDecodeAccelerator::OnDestroy() { 615 void GpuVideoDecodeAccelerator::OnDestroy() {
616 DCHECK(video_decode_accelerator_); 616 DCHECK(video_decode_accelerator_);
617 OnWillDestroyStub(); 617 OnWillDestroyStub();
(...skipping 17 matching lines...) Expand all
635 scoped_refptr<gpu::gles2::TextureRef> texture_ref = it->second; 635 scoped_refptr<gpu::gles2::TextureRef> texture_ref = it->second;
636 GLenum target = texture_ref->texture()->target(); 636 GLenum target = texture_ref->texture()->target();
637 gpu::gles2::TextureManager* texture_manager = 637 gpu::gles2::TextureManager* texture_manager =
638 stub_->decoder()->GetContextGroup()->texture_manager(); 638 stub_->decoder()->GetContextGroup()->texture_manager();
639 DCHECK(!texture_ref->texture()->IsLevelCleared(target, 0)); 639 DCHECK(!texture_ref->texture()->IsLevelCleared(target, 0));
640 texture_manager->SetLevelCleared(texture_ref.get(), target, 0, true); 640 texture_manager->SetLevelCleared(texture_ref.get(), target, 0, true);
641 uncleared_textures_.erase(it); 641 uncleared_textures_.erase(it);
642 } 642 }
643 643
644 } // namespace content 644 } // namespace content
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698