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

Unified Diff: media/base/audio_decoder.h

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 | « content/renderer/pepper/video_decoder_shim.cc ('k') | media/base/mock_filters.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: media/base/audio_decoder.h
diff --git a/media/base/audio_decoder.h b/media/base/audio_decoder.h
index 0118b5e4fdd57f9893dbd92ed561ace6a6819c0d..779e5ef502654644d6252d3ca0f3f6c5237689fc 100644
--- a/media/base/audio_decoder.h
+++ b/media/base/audio_decoder.h
@@ -25,7 +25,7 @@ class MEDIA_EXPORT AudioDecoder {
// match, break them into a decoder_status.h.
enum Status {
kOk, // We're all good.
- kAborted, // We aborted as a result of Stop() or Reset().
+ kAborted, // We aborted as a result of Reset() or destruction.
kDecodeError, // A decoding error occurred.
kDecryptError // Decrypting error happened.
};
@@ -40,6 +40,11 @@ class MEDIA_EXPORT AudioDecoder {
typedef base::Callback<void(Status)> DecodeCB;
AudioDecoder();
+
+ // Fires any pending callbacks, stops and destroys the decoder.
+ // Note: Since this is a destructor, |this| will be destroyed after this call.
+ // Make sure the callbacks fired from this call doesn't post any task that
+ // depends on |this|.
virtual ~AudioDecoder();
// Initializes an AudioDecoder with the given DemuxerStream, executing the
@@ -68,14 +73,6 @@ class MEDIA_EXPORT AudioDecoder {
// aborted before |closure| is called.
virtual void Reset(const base::Closure& closure) = 0;
- // Stops decoder, fires any pending callbacks and sets the decoder to an
- // uninitialized state. An AudioDecoder cannot be re-initialized after it has
- // been stopped. DecodeCB and OutputCB may still be called for older buffers
- // if they were scheduled before this method is called.
- // Note that if Initialize() is pending or has finished successfully, Stop()
- // must be called before destructing the decoder.
- virtual void Stop() = 0;
-
private:
DISALLOW_COPY_AND_ASSIGN(AudioDecoder);
};
« no previous file with comments | « content/renderer/pepper/video_decoder_shim.cc ('k') | media/base/mock_filters.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698