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

Side by Side 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: added UTs Created 4 years, 5 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 unified diff | Download patch
OLDNEW
1 // Copyright 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #ifndef MEDIA_BASE_DEMUXER_STREAM_PROVIDER_H_ 5 #ifndef MEDIA_BASE_DEMUXER_STREAM_PROVIDER_H_
6 #define MEDIA_BASE_DEMUXER_STREAM_PROVIDER_H_ 6 #define MEDIA_BASE_DEMUXER_STREAM_PROVIDER_H_
7 7
8 #include "base/macros.h" 8 #include "base/macros.h"
9 #include "media/base/demuxer_stream.h" 9 #include "media/base/demuxer_stream.h"
10 #include "media/base/media_export.h" 10 #include "media/base/media_export.h"
11 #include "url/gurl.h"
11 12
12 namespace media { 13 namespace media {
13 14
15 // Interface that defines how to retrieve "media sources" in DemuxerStream form
16 // (for most cases) or URL form (for the MediaPlayerRenderer case).
17 //
18 // The sub-classes do not stricly provide demuxer streams, but because all
19 // sub-classes are for the moment Demuxers, this class has not been renamed to
20 // "MediaProvider". This interface would be a good candidate for renaming, if
21 // ever Pipeline were to use this interface directly, instead of the Demuxer
22 // interface.
23 //
24 // The derived classes must return a non-null value for either of the getter
25 // methods, and return a null value for the other.
26 // Ex: A Demuxer should return the DemuxerStreams it supports, but return a
27 // empty URL.
14 class MEDIA_EXPORT DemuxerStreamProvider { 28 class MEDIA_EXPORT DemuxerStreamProvider {
15 public: 29 public:
16 DemuxerStreamProvider(); 30 DemuxerStreamProvider();
17 virtual ~DemuxerStreamProvider(); 31 virtual ~DemuxerStreamProvider();
18 32
DaleCurtis 2016/06/24 00:42:30 Should we have a type() or something that says whi
tguilbert 2016/06/24 03:13:20 This sounds good to me. However, I have been flip
19 // Returns the first stream of the given stream type (which is not allowed 33 // Returns the first stream of the given stream type (which is not allowed
20 // to be DemuxerStream::TEXT), or NULL if that type of stream is not present. 34 // to be DemuxerStream::TEXT), or NULL if that type of stream is not present.
35 // Returns a null value if we are using a URL instead.
21 virtual DemuxerStream* GetStream(DemuxerStream::Type type) = 0; 36 virtual DemuxerStream* GetStream(DemuxerStream::Type type) = 0;
DaleCurtis 2016/06/24 00:42:30 Did you consider implementing DemuxerStream instea
tguilbert 2016/06/24 03:13:20 I did, and that is how I originally implemented it
22 37
38 // Returns the URL of the media to play. To be used when DemuxerStreams are
39 // not relevant (e.g. in the MediaPlayerRender case).
40 // Returns nullptr if we are using DemuxerStreams instead.
41 virtual GURL* GetUrl() = 0;
DaleCurtis 2016/06/24 00:42:30 I think this is gnarly enough that we should make
tguilbert 2016/06/24 03:13:20 I am fine with this if you are.
42
23 private: 43 private:
24 DISALLOW_COPY_AND_ASSIGN(DemuxerStreamProvider); 44 DISALLOW_COPY_AND_ASSIGN(DemuxerStreamProvider);
25 }; 45 };
26 46
27 } // namespace media 47 } // namespace media
28 48
29 #endif // MEDIA_BASE_DEMUXER_STREAM_PROVIDER_H_ 49 #endif // MEDIA_BASE_DEMUXER_STREAM_PROVIDER_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698