| 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" |
| (...skipping 21 matching lines...) Expand all Loading... |
| 32 URL, // Indicates GetUrl() should be used | 32 URL, // Indicates GetUrl() should be used |
| 33 }; | 33 }; |
| 34 | 34 |
| 35 DemuxerStreamProvider(); | 35 DemuxerStreamProvider(); |
| 36 virtual ~DemuxerStreamProvider(); | 36 virtual ~DemuxerStreamProvider(); |
| 37 | 37 |
| 38 // For Type::STREAM: | 38 // For Type::STREAM: |
| 39 // 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 |
| 40 // 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 |
| 41 // present. | 41 // present. |
| 42 // NOTE: Once a DemuxerStream pointer is returned from GetStream it is |
| 43 // guaranteed to stay valid for as long as the Demuxer/DemuxerStreamProvider |
| 44 // is alive. But make no assumption that once GetStream returned a non-null |
| 45 // pointer for some stream type then all subsequent calls will also return |
| 46 // non-null pointer for the same stream type. In MSE Javascript code can |
| 47 // remove SourceBuffer from a MediaSource at any point and this will make |
| 48 // some previously existing streams inaccessible/unavailable. |
| 42 // Other types: | 49 // Other types: |
| 43 // Should not be called. | 50 // Should not be called. |
| 44 virtual DemuxerStream* GetStream(DemuxerStream::Type type) = 0; | 51 virtual DemuxerStream* GetStream(DemuxerStream::Type type) = 0; |
| 45 | 52 |
| 46 // For Type::URL: | 53 // For Type::URL: |
| 47 // Returns the URL parameters of the media to play. Empty URLs are legal, | 54 // Returns the URL parameters of the media to play. Empty URLs are legal, |
| 48 // and should be handled appropriately by the caller. | 55 // and should be handled appropriately by the caller. |
| 49 // Other types: | 56 // Other types: |
| 50 // Should not be called. | 57 // Should not be called. |
| 51 virtual MediaUrlParams GetMediaUrlParams() const; | 58 virtual MediaUrlParams GetMediaUrlParams() const; |
| 52 | 59 |
| 53 virtual DemuxerStreamProvider::Type GetType() const; | 60 virtual DemuxerStreamProvider::Type GetType() const; |
| 54 | 61 |
| 55 private: | 62 private: |
| 56 DISALLOW_COPY_AND_ASSIGN(DemuxerStreamProvider); | 63 DISALLOW_COPY_AND_ASSIGN(DemuxerStreamProvider); |
| 57 }; | 64 }; |
| 58 | 65 |
| 59 } // namespace media | 66 } // namespace media |
| 60 | 67 |
| 61 #endif // MEDIA_BASE_DEMUXER_STREAM_PROVIDER_H_ | 68 #endif // MEDIA_BASE_DEMUXER_STREAM_PROVIDER_H_ |
| OLD | NEW |