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

Unified Diff: media/base/demuxer_stream.h

Issue 10669022: Add status parameter to DemuxerStream::ReadCB (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Rebase Created 8 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/base/audio_decoder.h ('k') | media/filters/audio_renderer_impl.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: media/base/demuxer_stream.h
diff --git a/media/base/demuxer_stream.h b/media/base/demuxer_stream.h
index 1266a712687c3b8030db72ea28acb8c4dc1c3030..65457c3f0b84170c0cd7b3bd9456c78f517814de 100644
--- a/media/base/demuxer_stream.h
+++ b/media/base/demuxer_stream.h
@@ -26,12 +26,34 @@ class MEDIA_EXPORT DemuxerStream
NUM_TYPES, // Always keep this entry as the last one!
};
+ // Status returned in the Read() callback.
+ // kOk : Indicates the second parameter is Non-NULL and contains media data
+ // or the end of the stream.
+ // kAborted : Indicates an aborted Read(). This can happen if the
+ // DemuxerStream gets flushed and doesn't have any more data to
+ // return. The second parameter MUST be NULL when this status is
+ // returned.
+ // kConfigChange : Indicates that the AudioDecoderConfig or
+ // VideoDecoderConfig for the stream has changed.
+ // The DemuxerStream expects an audio_decoder_config() or
+ // video_decoder_config() call before Read() will start
+ // returning DecoderBuffers again. The decoder will need this
+ // new configuration to properly decode the buffers read
+ // from this point forward. The second parameter MUST be NULL
+ // when this status is returned.
+ enum Status {
+ kOk,
+ kAborted,
+ kConfigChanged,
+ };
+
// Request a buffer to returned via the provided callback.
//
- // Non-NULL buffer pointers will contain media data or signal the end of the
- // stream. A NULL pointer indicates an aborted Read(). This can happen if the
- // DemuxerStream gets flushed and doesn't have any more data to return.
- typedef base::Callback<void(const scoped_refptr<DecoderBuffer>&)> ReadCB;
+ // The first parameter indicates the status of the read.
+ // The second parameter is non-NULL and contains media data
+ // or the end of the stream if the first parameter is kOk. NULL otherwise.
+ typedef base::Callback<void(Status,
+ const scoped_refptr<DecoderBuffer>&)>ReadCB;
virtual void Read(const ReadCB& read_cb) = 0;
// Returns the audio decoder configuration. It is an error to call this method
« no previous file with comments | « media/base/audio_decoder.h ('k') | media/filters/audio_renderer_impl.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698