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

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: . Created 8 years, 6 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
Index: media/base/demuxer_stream.h
diff --git a/media/base/demuxer_stream.h b/media/base/demuxer_stream.h
index 1266a712687c3b8030db72ea28acb8c4dc1c3030..d4f008ccdef231b8e09d03394e3cf20818fc36d8 100644
--- a/media/base/demuxer_stream.h
+++ b/media/base/demuxer_stream.h
@@ -26,12 +26,27 @@ class MEDIA_EXPORT DemuxerStream
NUM_TYPES, // Always keep this entry as the last one!
};
+ enum Status {
Ami GONE FROM CHROMIUM 2012/06/26 00:33:21 Before this CL, ReadCB had 3 possible return scena
acolwell GONE FROM CHROMIUM 2012/07/12 01:19:38 I believe it does make sense. Mind if I defer this
+ 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.
+ // kOk : Indicates the second parameter is Non-NULL and contains media data
Ami GONE FROM CHROMIUM 2012/06/26 00:33:21 These comments belong at the enum declaration, not
acolwell GONE FROM CHROMIUM 2012/07/12 01:19:38 Done.
+ // 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
+ // return.
Ami GONE FROM CHROMIUM 2012/06/26 00:33:21 s/\./ed./
acolwell GONE FROM CHROMIUM 2012/07/12 01:19:38 Done.
+ // kConfigChange : Indicates that the decoder configuration has changed and a
+ // call to audio_decoder_config() or video_decoder_config()
Ami GONE FROM CHROMIUM 2012/06/26 00:33:21 This phrasing implies that calling [av]_d_c() on a
acolwell GONE FROM CHROMIUM 2012/07/12 01:19:38 Done.
+ // is needed before more data is returned. The second
+ // parameter MUST be NULL when this status is return.
Ami GONE FROM CHROMIUM 2012/06/26 00:33:21 ditto
acolwell GONE FROM CHROMIUM 2012/07/12 01:19:38 Done.
+ 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

Powered by Google App Engine
This is Rietveld 408576698