Chromium Code Reviews| Index: media/base/demuxer_stream_provider.h |
| diff --git a/media/base/demuxer_stream_provider.h b/media/base/demuxer_stream_provider.h |
| index e5289f3da45f8201879a873faa54b88e288c8277..0b18c3c8410f5d81161b4ef4c953487c84197946 100644 |
| --- a/media/base/demuxer_stream_provider.h |
| +++ b/media/base/demuxer_stream_provider.h |
| @@ -8,18 +8,48 @@ |
| #include "base/macros.h" |
| #include "media/base/demuxer_stream.h" |
| #include "media/base/media_export.h" |
| +#include "url/gurl.h" |
| namespace media { |
| +// Abstract class that defines how to retrieve "media sources" in DemuxerStream |
| +// form (for most cases) or URL form (for the MediaPlayerRenderer case). |
| +// |
| +// The sub-classes do not stricly provide demuxer streams, but because all |
| +// sub-classes are for the moment Demuxers, this class has not been renamed to |
| +// "MediaProvider". This class would be a good candidate for renaming, if |
| +// ever Pipeline were to support this class directly, instead of the Demuxer |
| +// interface. |
| +// |
| +// The derived classes must return a non-null value for the getter method |
| +// associated with their type, and return a null/empty value for other getters. |
| class MEDIA_EXPORT DemuxerStreamProvider { |
| public: |
| + enum Type { |
| + STREAM, // Indicates GetStream() should be used |
| + URL, // Indicates GetUrl() should be used |
| + }; |
| + |
| DemuxerStreamProvider(); |
| virtual ~DemuxerStreamProvider(); |
| - // Returns the first stream of the given stream type (which is not allowed |
| - // to be DemuxerStream::TEXT), or NULL if that type of stream is not present. |
| + // For Type::STREAM: |
| + // Returns the first stream of the given stream type (which is not allowed |
| + // to be DemuxerStream::TEXT), or NULL if that type of stream is not |
| + // present. |
| + // Other types: |
| + // Should not be called. |
| virtual DemuxerStream* GetStream(DemuxerStream::Type type) = 0; |
| + // For Type::URL: |
| + // Returns the URL of the media to play. This might be an empty URL, and |
| + // should be handled appropriately by the caller. |
| + // Other types: |
| + // Should not be called. |
| + virtual GURL GetUrl(); |
|
DaleCurtis
2016/06/24 22:02:40
const ?
tguilbert
2016/06/24 23:21:47
Done.
|
| + |
| + virtual DemuxerStreamProvider::Type type(); |
|
DaleCurtis
2016/06/24 22:02:40
const?
tguilbert
2016/06/24 23:21:47
Done.
|
| + |
| private: |
| DISALLOW_COPY_AND_ASSIGN(DemuxerStreamProvider); |
| }; |