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

Unified Diff: media/filters/gpu_video_decoder.cc

Issue 395703002: Fold {Audio|Video}Decoder::Stop() into the dtor. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: rebase only Created 6 years, 5 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') | media/filters/opus_audio_decoder.h » ('j') | 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 bc545b7d652ca912918483fd23b8f47590d8d098..efabc95eca0b07d029075c6099d6cad951a0e08d 100644
--- a/media/filters/gpu_video_decoder.cc
+++ b/media/filters/gpu_video_decoder.cc
@@ -98,15 +98,6 @@ void GpuVideoDecoder::Reset(const base::Closure& closure) {
vda_->Reset();
}
-void GpuVideoDecoder::Stop() {
- DCheckGpuVideoAcceleratorFactoriesTaskRunnerIsCurrent();
- if (vda_)
- DestroyVDA();
- DCHECK(bitstream_buffers_in_decoder_.empty());
- if (!pending_reset_cb_.is_null())
- base::ResetAndReturn(&pending_reset_cb_).Run();
-}
-
static bool IsCodedSizeSupported(const gfx::Size& coded_size) {
#if defined(OS_WIN)
// Windows Media Foundation H.264 decoding does not support decoding videos
@@ -560,14 +551,20 @@ void GpuVideoDecoder::NotifyEndOfBitstreamBuffer(int32 id) {
GpuVideoDecoder::~GpuVideoDecoder() {
DCheckGpuVideoAcceleratorFactoriesTaskRunnerIsCurrent();
- // Stop should have been already called.
- DCHECK(!vda_.get() && assigned_picture_buffers_.empty());
+ if (vda_)
+ DestroyVDA();
DCHECK(bitstream_buffers_in_decoder_.empty());
+ DCHECK(assigned_picture_buffers_.empty());
+
+ if (!pending_reset_cb_.is_null())
+ base::ResetAndReturn(&pending_reset_cb_).Run();
+
for (size_t i = 0; i < available_shm_segments_.size(); ++i) {
available_shm_segments_[i]->shm->Close();
delete available_shm_segments_[i];
}
available_shm_segments_.clear();
+
for (std::map<int32, PendingDecoderBuffer>::iterator it =
bitstream_buffers_in_decoder_.begin();
it != bitstream_buffers_in_decoder_.end(); ++it) {
« no previous file with comments | « media/filters/gpu_video_decoder.h ('k') | media/filters/opus_audio_decoder.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698