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

Unified Diff: media/base/demuxer_stream_provider.h

Issue 2090343004: Add GetUrl to DemuxerStreamProvider interface (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: addressing comments Created 4 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_provider.h
diff --git a/media/base/demuxer_stream_provider.h b/media/base/demuxer_stream_provider.h
index e5289f3da45f8201879a873faa54b88e288c8277..c2c191f83c14013d279ea37ac0fc5bd654b8b2fa 100644
--- a/media/base/demuxer_stream_provider.h
+++ b/media/base/demuxer_stream_provider.h
@@ -8,18 +8,47 @@
#include "base/macros.h"
#include "media/base/demuxer_stream.h"
#include "media/base/media_export.h"
+#include "url/gurl.h"
namespace media {
+// Interface 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 interface would be a good candidate for renaming, if
+// ever Pipeline were to use this interface directly, instead of the Demuxer
+// interface.
+//
+// The derived classes must return a non-null value for either of the getter
+// methods, and return a null value for the other.
+// Ex: A Demuxer should return the DemuxerStreams it supports, but return a
+// empty URL.
class MEDIA_EXPORT DemuxerStreamProvider {
public:
+ enum Type {
+ STREAM, // Indicates GetStream() should be used
+ URL, // Indicated 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.
+ // Returns a null value if we are of Type::URL.
xhwang 2016/06/24 03:19:47 You can say that if type is not STREAM, this shoul
tguilbert 2016/06/24 21:18:42 Done.
virtual DemuxerStream* GetStream(DemuxerStream::Type type) = 0;
+ // Returns the URL of the media to play. To be used when DemuxerStreams are
+ // not relevant (e.g. in the MediaPlayerRender case).
+ // Returns an empty GURL if we are of Type::STREAM.
xhwang 2016/06/24 03:19:47 ditto
tguilbert 2016/06/24 21:18:43 Done.
+ virtual GURL GetUrl() { return GURL(); };
xhwang 2016/06/24 03:19:47 remote the trailing semicolon, ditto on l.50
DaleCurtis 2016/06/24 17:43:41 Virtual methods should never be inline per the sty
tguilbert 2016/06/24 21:18:43 Done.
tguilbert 2016/06/24 21:18:43 Done.
+
+ // Returns the type of the DemuxerStreamProvider.
+ // The type also indicates whether GetStream or GetUrl should be used.
+ virtual DemuxerStreamProvider::Type type() { return Type::STREAM; };
xhwang 2016/06/24 03:19:47 nit: Will this work? Type type() { return STREA
tguilbert 2016/06/24 21:18:43 It does.
+
private:
DISALLOW_COPY_AND_ASSIGN(DemuxerStreamProvider);
};

Powered by Google App Engine
This is Rietveld 408576698