OLD | NEW |
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 "media/base/media_url_params.h" |
11 #include "url/gurl.h" | 12 #include "url/gurl.h" |
12 | 13 |
13 namespace media { | 14 namespace media { |
14 | 15 |
15 // Abstract class that defines how to retrieve "media sources" in DemuxerStream | 16 // Abstract class that defines how to retrieve "media sources" in DemuxerStream |
16 // form (for most cases) or URL form (for the MediaPlayerRenderer case). | 17 // form (for most cases) or URL form (for the MediaPlayerRenderer case). |
17 // | 18 // |
18 // The sub-classes do not stricly provide demuxer streams, but because all | 19 // 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 // sub-classes are for the moment Demuxers, this class has not been renamed to |
20 // "MediaProvider". This class would be a good candidate for renaming, if | 21 // "MediaProvider". This class would be a good candidate for renaming, if |
21 // ever Pipeline were to support this class directly, instead of the Demuxer | 22 // ever Pipeline were to support this class directly, instead of the Demuxer |
22 // interface. | 23 // interface. |
| 24 // TODO(tguilbert): Rename this class. See crbug.com/658062. |
23 // | 25 // |
24 // The derived classes must return a non-null value for the getter method | 26 // The derived classes must return a non-null value for the getter method |
25 // associated with their type, and return a null/empty value for other getters. | 27 // associated with their type, and return a null/empty value for other getters. |
26 class MEDIA_EXPORT DemuxerStreamProvider { | 28 class MEDIA_EXPORT DemuxerStreamProvider { |
27 public: | 29 public: |
28 enum Type { | 30 enum Type { |
29 STREAM, // Indicates GetStream() should be used | 31 STREAM, // Indicates GetStream() should be used |
30 URL, // Indicates GetUrl() should be used | 32 URL, // Indicates GetUrl() should be used |
31 }; | 33 }; |
32 | 34 |
33 DemuxerStreamProvider(); | 35 DemuxerStreamProvider(); |
34 virtual ~DemuxerStreamProvider(); | 36 virtual ~DemuxerStreamProvider(); |
35 | 37 |
36 // For Type::STREAM: | 38 // For Type::STREAM: |
37 // Returns the first stream of the given stream type (which is not allowed | 39 // Returns the first stream of the given stream type (which is not allowed |
38 // to be DemuxerStream::TEXT), or NULL if that type of stream is not | 40 // to be DemuxerStream::TEXT), or NULL if that type of stream is not |
39 // present. | 41 // present. |
40 // Other types: | 42 // Other types: |
41 // Should not be called. | 43 // Should not be called. |
42 virtual DemuxerStream* GetStream(DemuxerStream::Type type) = 0; | 44 virtual DemuxerStream* GetStream(DemuxerStream::Type type) = 0; |
43 | 45 |
44 // For Type::URL: | 46 // For Type::URL: |
45 // Returns the URL of the media to play. This might be an empty URL, and | 47 // Returns the URL parameters of the media to play. Empty URLs are legal, |
46 // should be handled appropriately by the caller. | 48 // and should be handled appropriately by the caller. |
47 // Other types: | 49 // Other types: |
48 // Should not be called. | 50 // Should not be called. |
49 virtual GURL GetUrl() const; | 51 virtual MediaUrlParams GetMediaUrlParams() const; |
50 | 52 |
51 virtual DemuxerStreamProvider::Type GetType() const; | 53 virtual DemuxerStreamProvider::Type GetType() const; |
52 | 54 |
53 private: | 55 private: |
54 DISALLOW_COPY_AND_ASSIGN(DemuxerStreamProvider); | 56 DISALLOW_COPY_AND_ASSIGN(DemuxerStreamProvider); |
55 }; | 57 }; |
56 | 58 |
57 } // namespace media | 59 } // namespace media |
58 | 60 |
59 #endif // MEDIA_BASE_DEMUXER_STREAM_PROVIDER_H_ | 61 #endif // MEDIA_BASE_DEMUXER_STREAM_PROVIDER_H_ |
OLD | NEW |