| Index: media/filters/chunk_demuxer.h
|
| diff --git a/media/filters/chunk_demuxer.h b/media/filters/chunk_demuxer.h
|
| index ae690b912fc798d8070bd238587783ecca8b4a19..3942b23f1b5c8b3d2157ce7e16f782290d0eba42 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().
|
| + void RemoveId(const std::string& id);
|
| +
|
| + // 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);
|
| 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
|
| + std::string source_id_;
|
| +
|
| DISALLOW_COPY_AND_ASSIGN(ChunkDemuxer);
|
| };
|
|
|
|
|