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

Side by Side Diff: media/filters/decoder_stream.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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « media/filters/decoder_selector.cc ('k') | media/filters/decrypting_audio_decoder.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 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/decoder_stream.h" 5 #include "media/filters/decoder_stream.h"
6 6
7 #include "base/bind.h" 7 #include "base/bind.h"
8 #include "base/callback_helpers.h" 8 #include "base/callback_helpers.h"
9 #include "base/debug/trace_event.h" 9 #include "base/debug/trace_event.h"
10 #include "base/location.h" 10 #include "base/location.h"
(...skipping 171 matching lines...) Expand 10 before | Expand all | Expand 10 after
182 // Post callbacks to prevent reentrance into this object. 182 // Post callbacks to prevent reentrance into this object.
183 if (!read_cb_.is_null()) { 183 if (!read_cb_.is_null()) {
184 task_runner_->PostTask(FROM_HERE, base::Bind( 184 task_runner_->PostTask(FROM_HERE, base::Bind(
185 base::ResetAndReturn(&read_cb_), ABORTED, scoped_refptr<Output>())); 185 base::ResetAndReturn(&read_cb_), ABORTED, scoped_refptr<Output>()));
186 } 186 }
187 if (!reset_cb_.is_null()) 187 if (!reset_cb_.is_null())
188 task_runner_->PostTask(FROM_HERE, base::ResetAndReturn(&reset_cb_)); 188 task_runner_->PostTask(FROM_HERE, base::ResetAndReturn(&reset_cb_));
189 189
190 if (decrypting_demuxer_stream_) 190 if (decrypting_demuxer_stream_)
191 decrypting_demuxer_stream_->Stop(); 191 decrypting_demuxer_stream_->Stop();
192 if (decoder_)
193 decoder_->Stop();
194 192
195 state_ = STATE_STOPPED;
196 stream_ = NULL; 193 stream_ = NULL;
197 decoder_.reset(); 194 decoder_.reset();
198 decrypting_demuxer_stream_.reset(); 195 decrypting_demuxer_stream_.reset();
196
197 state_ = STATE_STOPPED;
199 task_runner_->PostTask(FROM_HERE, closure); 198 task_runner_->PostTask(FROM_HERE, closure);
200 } 199 }
201 200
202 template <DemuxerStream::Type StreamType> 201 template <DemuxerStream::Type StreamType>
203 bool DecoderStream<StreamType>::CanReadWithoutStalling() const { 202 bool DecoderStream<StreamType>::CanReadWithoutStalling() const {
204 DCHECK(task_runner_->BelongsToCurrentThread()); 203 DCHECK(task_runner_->BelongsToCurrentThread());
205 return !ready_outputs_.empty() || decoder_->CanReadWithoutStalling(); 204 return !ready_outputs_.empty() || decoder_->CanReadWithoutStalling();
206 } 205 }
207 206
208 template <> 207 template <>
(...skipping 357 matching lines...) Expand 10 before | Expand all | Expand 10 after
566 } 565 }
567 566
568 // The resetting process will be continued in OnDecoderReinitialized(). 567 // The resetting process will be continued in OnDecoderReinitialized().
569 ReinitializeDecoder(); 568 ReinitializeDecoder();
570 } 569 }
571 570
572 template class DecoderStream<DemuxerStream::VIDEO>; 571 template class DecoderStream<DemuxerStream::VIDEO>;
573 template class DecoderStream<DemuxerStream::AUDIO>; 572 template class DecoderStream<DemuxerStream::AUDIO>;
574 573
575 } // namespace media 574 } // namespace media
OLDNEW
« no previous file with comments | « media/filters/decoder_selector.cc ('k') | media/filters/decrypting_audio_decoder.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698