Chromium Code Reviews| Index: media/filters/chunk_demuxer.h |
| diff --git a/media/filters/chunk_demuxer.h b/media/filters/chunk_demuxer.h |
| index ae690b912fc798d8070bd238587783ecca8b4a19..c61d5843dc22e1b12d0dfb98e91e07891e42f1b5 100644 |
| --- a/media/filters/chunk_demuxer.h |
| +++ b/media/filters/chunk_demuxer.h |
| @@ -6,6 +6,7 @@ |
| #define MEDIA_FILTERS_CHUNK_DEMUXER_H_ |
| #include <list> |
| +#include <string> |
| #include "base/synchronization/lock.h" |
| #include "media/base/byte_queue.h" |
| @@ -22,6 +23,12 @@ class FFmpegURLProtocol; |
| // from JavaScript to the media stack. |
| class MEDIA_EXPORT ChunkDemuxer : public Demuxer, public StreamParserHost { |
| public: |
| + enum Status { |
| + kOk, // ID added w/o error. |
| + kNotSupported, // Type specified is not supported. |
| + kReachedIdLimit, // Reached ID limit. We can't handle any more IDs. |
| + }; |
| + |
| explicit ChunkDemuxer(ChunkDemuxerClient* client); |
| virtual ~ChunkDemuxer(); |
| @@ -41,9 +48,22 @@ class MEDIA_EXPORT ChunkDemuxer : public Demuxer, public StreamParserHost { |
| // Methods used by an external object to control this demuxer. |
| void FlushData(); |
| - // Appends media data to the stream. Returns false if this method |
| - // is called in an invalid state. |
| - bool AppendData(const uint8* data, size_t length); |
| + // Registers a new |id| to use for AppendData() calls. |type| indicates |
| + // the MIME type for the data that we intend to append for this ID. |
| + // kOk is returned if the demuxer has enough resources to support another ID |
| + // and supports the format indicated by |type|. |
| + // kNotSupported is returned if |type| is not a supported format. |
| + // kReachedIdLimit is returned if the demuxer cannot handle another ID right |
| + // now. |
| + Status AddId(const std::string& id, const std::string& type); |
| + |
| + // Removed an ID & associated resources that were previously added with |
| + // AddId(). |
| + bool RemoveId(const std::string& id); |
|
scherkus (not reviewing)
2012/04/23 19:24:17
what does true/false mean? could we have void?
is
acolwell GONE FROM CHROMIUM
2012/04/23 22:15:23
Yes we could have void. Eric wanted a bool returne
|
| + |
| + // Appends media data to the source buffer associated with |id|. Returns |
| + // false if this method is called in an invalid state. |
| + bool AppendData(const std::string& id, const uint8* data, size_t length); |
|
scherkus (not reviewing)
2012/04/23 19:24:17
CHECK-fail instead?
acolwell GONE FROM CHROMIUM
2012/04/23 22:15:23
No. It is possible for appends to happen when the
|
| void EndOfStream(PipelineStatus status); |
| bool HasEnded(); |
| void Shutdown(); |
| @@ -95,6 +115,9 @@ class MEDIA_EXPORT ChunkDemuxer : public Demuxer, public StreamParserHost { |
| ByteQueue byte_queue_; |
| + // TODO(acolwell): Remove this when fixing http://crbug.com/122909 . |
|
scherkus (not reviewing)
2012/04/23 19:24:17
nit: I'd just leave off that trailing period in th
acolwell GONE FROM CHROMIUM
2012/04/23 22:15:23
Done.
|
| + std::string source_id_; |
| + |
| DISALLOW_COPY_AND_ASSIGN(ChunkDemuxer); |
| }; |