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

Unified Diff: media/filters/gpu_video_decoder.cc

Issue 11189027: GVD: DestroyTextures() when destroying. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: ~ Created 8 years, 2 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « media/filters/gpu_video_decoder.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: media/filters/gpu_video_decoder.cc
diff --git a/media/filters/gpu_video_decoder.cc b/media/filters/gpu_video_decoder.cc
index 08a1cf1cffe13a4d7d2126a845c8c573b54d3d34..9fdf9dee66f761ad7ed2bca0b54b161b185109e0 100644
--- a/media/filters/gpu_video_decoder.cc
+++ b/media/filters/gpu_video_decoder.cc
@@ -194,6 +194,15 @@ void GpuVideoDecoder::SetVDA(VideoDecodeAccelerator* vda) {
weak_vda_ = vda->AsWeakPtr();
}
+void GpuVideoDecoder::DestroyTextures() {
+ for (std::map<int32, PictureBuffer>::iterator it =
+ picture_buffers_in_decoder_.begin();
+ it != picture_buffers_in_decoder_.end(); ++it) {
+ factories_->DeleteTexture(it->second.texture_id());
+ }
+ picture_buffers_in_decoder_.clear();
+}
+
void GpuVideoDecoder::DestroyVDA() {
DCHECK(gvd_loop_proxy_->BelongsToCurrentThread());
VideoDecodeAccelerator* vda ALLOW_UNUSED = vda_.release();
@@ -205,6 +214,8 @@ void GpuVideoDecoder::DestroyVDA() {
FROM_HERE,
base::Bind(&VideoDecodeAccelerator::Destroy, weak_vda_),
base::Bind(&GpuVideoDecoder::Release, this));
+
+ DestroyTextures();
}
void GpuVideoDecoder::Read(const ReadCB& read_cb) {
@@ -528,6 +539,8 @@ GpuVideoDecoder::~GpuVideoDecoder() {
it->second.shm_buffer->shm->Close();
}
bitstream_buffers_in_decoder_.clear();
+
+ DestroyTextures();
}
void GpuVideoDecoder::EnsureDemuxOrDecode() {
« no previous file with comments | « media/filters/gpu_video_decoder.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698