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

Side by Side Diff: media/filters/gpu_video_decoder.cc

Issue 292183011: Make DefaultDeleter for Video{De|En}codeAccelerator (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: out-of-line DefaultDeleter::operator() Created 6 years, 6 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 | Annotate | Revision Log
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/filters/gpu_video_decoder.h" 5 #include "media/filters/gpu_video_decoder.h"
6 6
7 #include <algorithm> 7 #include <algorithm>
8 8
9 #include "base/bind.h" 9 #include "base/bind.h"
10 #include "base/callback_helpers.h" 10 #include "base/callback_helpers.h"
(...skipping 194 matching lines...) Expand 10 before | Expand all | Expand 10 after
205 ++it) { 205 ++it) {
206 factories_->DeleteTexture(it->second.texture_id()); 206 factories_->DeleteTexture(it->second.texture_id());
207 } 207 }
208 208
209 buffers->clear(); 209 buffers->clear();
210 } 210 }
211 211
212 void GpuVideoDecoder::DestroyVDA() { 212 void GpuVideoDecoder::DestroyVDA() {
213 DCheckGpuVideoAcceleratorFactoriesTaskRunnerIsCurrent(); 213 DCheckGpuVideoAcceleratorFactoriesTaskRunnerIsCurrent();
214 214
215 if (vda_) 215 vda_.reset();
216 vda_.release()->Destroy();
217 216
218 // Not destroying PictureBuffers in |picture_buffers_at_display_| yet, since 217 // Not destroying PictureBuffers in |picture_buffers_at_display_| yet, since
219 // their textures may still be in use by the user of this GpuVideoDecoder. 218 // their textures may still be in use by the user of this GpuVideoDecoder.
220 for (PictureBufferTextureMap::iterator it = 219 for (PictureBufferTextureMap::iterator it =
221 picture_buffers_at_display_.begin(); 220 picture_buffers_at_display_.begin();
222 it != picture_buffers_at_display_.end(); 221 it != picture_buffers_at_display_.end();
223 ++it) { 222 ++it) {
224 assigned_picture_buffers_.erase(it->first); 223 assigned_picture_buffers_.erase(it->first);
225 } 224 }
226 DestroyPictureBuffers(&assigned_picture_buffers_); 225 DestroyPictureBuffers(&assigned_picture_buffers_);
(...skipping 420 matching lines...) Expand 10 before | Expand all | Expand 10 after
647 return; 646 return;
648 } 647 }
649 } 648 }
650 649
651 void GpuVideoDecoder::DCheckGpuVideoAcceleratorFactoriesTaskRunnerIsCurrent() 650 void GpuVideoDecoder::DCheckGpuVideoAcceleratorFactoriesTaskRunnerIsCurrent()
652 const { 651 const {
653 DCHECK(factories_->GetTaskRunner()->BelongsToCurrentThread()); 652 DCHECK(factories_->GetTaskRunner()->BelongsToCurrentThread());
654 } 653 }
655 654
656 } // namespace media 655 } // namespace media
OLDNEW
« no previous file with comments | « media/cast/video_sender/external_video_encoder.cc ('k') | media/video/video_decode_accelerator.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698