Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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 // Filters are connected in a strongly typed manner, with downstream filters | 5 // Filters are connected in a strongly typed manner, with downstream filters |
| 6 // always reading data from upstream filters. Upstream filters have no clue | 6 // always reading data from upstream filters. Upstream filters have no clue |
| 7 // who is actually reading from them, and return the results via callbacks. | 7 // who is actually reading from them, and return the results via callbacks. |
| 8 // | 8 // |
| 9 // DemuxerStream(Video) <- VideoDecoder <- VideoRenderer | 9 // DemuxerStream(Video) <- VideoDecoder <- VideoRenderer |
| 10 // DataSource <- Demuxer < | 10 // DataSource <- Demuxer < |
| (...skipping 25 matching lines...) Expand all Loading... | |
| 36 namespace media { | 36 namespace media { |
| 37 | 37 |
| 38 class Buffer; | 38 class Buffer; |
| 39 class Decoder; | 39 class Decoder; |
| 40 class DemuxerStream; | 40 class DemuxerStream; |
| 41 class Filter; | 41 class Filter; |
| 42 class FilterHost; | 42 class FilterHost; |
| 43 | 43 |
| 44 struct PipelineStatistics; | 44 struct PipelineStatistics; |
| 45 | 45 |
| 46 // Used to specify video preload states. | |
|
acolwell GONE FROM CHROMIUM
2011/03/25 04:35:28
You should add a note here that this enum must mat
vrk (LEFT CHROMIUM)
2011/03/25 21:33:32
Done.
| |
| 47 enum Preload { | |
| 48 PRELOAD_NONE, | |
| 49 PRELOAD_METADATA, | |
| 50 PRELOAD_AUTO, | |
| 51 }; | |
| 52 | |
| 46 // Used for completing asynchronous methods. | 53 // Used for completing asynchronous methods. |
| 47 typedef Callback0::Type FilterCallback; | 54 typedef Callback0::Type FilterCallback; |
| 48 | 55 |
| 49 // Used for updating pipeline statistics. | 56 // Used for updating pipeline statistics. |
| 50 typedef Callback1<const PipelineStatistics&>::Type StatisticsCallback; | 57 typedef Callback1<const PipelineStatistics&>::Type StatisticsCallback; |
| 51 | 58 |
| 52 class Filter : public base::RefCountedThreadSafe<Filter> { | 59 class Filter : public base::RefCountedThreadSafe<Filter> { |
| 53 public: | 60 public: |
| 54 Filter(); | 61 Filter(); |
| 55 | 62 |
| (...skipping 64 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 120 virtual void Read(int64 position, size_t size, | 127 virtual void Read(int64 position, size_t size, |
| 121 uint8* data, ReadCallback* read_callback) = 0; | 128 uint8* data, ReadCallback* read_callback) = 0; |
| 122 | 129 |
| 123 // Returns true and the file size, false if the file size could not be | 130 // Returns true and the file size, false if the file size could not be |
| 124 // retrieved. | 131 // retrieved. |
| 125 virtual bool GetSize(int64* size_out) = 0; | 132 virtual bool GetSize(int64* size_out) = 0; |
| 126 | 133 |
| 127 // Returns true if we are performing streaming. In this case seeking is | 134 // Returns true if we are performing streaming. In this case seeking is |
| 128 // not possible. | 135 // not possible. |
| 129 virtual bool IsStreaming() = 0; | 136 virtual bool IsStreaming() = 0; |
| 137 | |
| 138 // Alert the DataSource that the video preload value has been changed. | |
| 139 virtual void SetPreload(Preload preload); | |
|
acolwell GONE FROM CHROMIUM
2011/03/25 04:35:28
Make this pure virtual like the other methods.
vrk (LEFT CHROMIUM)
2011/03/25 21:33:32
Done.
| |
| 130 }; | 140 }; |
| 131 | 141 |
| 132 class DemuxerStream : public base::RefCountedThreadSafe<DemuxerStream> { | 142 class DemuxerStream : public base::RefCountedThreadSafe<DemuxerStream> { |
| 133 public: | 143 public: |
| 134 enum Type { | 144 enum Type { |
| 135 UNKNOWN, | 145 UNKNOWN, |
| 136 AUDIO, | 146 AUDIO, |
| 137 VIDEO, | 147 VIDEO, |
| 138 NUM_TYPES, // Always keep this entry as the last one! | 148 NUM_TYPES, // Always keep this entry as the last one! |
| 139 }; | 149 }; |
| (...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 173 virtual void* QueryInterface(const char* interface_id); | 183 virtual void* QueryInterface(const char* interface_id); |
| 174 | 184 |
| 175 friend class base::RefCountedThreadSafe<DemuxerStream>; | 185 friend class base::RefCountedThreadSafe<DemuxerStream>; |
| 176 virtual ~DemuxerStream(); | 186 virtual ~DemuxerStream(); |
| 177 }; | 187 }; |
| 178 | 188 |
| 179 class Demuxer : public Filter { | 189 class Demuxer : public Filter { |
| 180 public: | 190 public: |
| 181 // Returns the given stream type, or NULL if that type is not present. | 191 // Returns the given stream type, or NULL if that type is not present. |
| 182 virtual scoped_refptr<DemuxerStream> GetStream(DemuxerStream::Type type) = 0; | 192 virtual scoped_refptr<DemuxerStream> GetStream(DemuxerStream::Type type) = 0; |
| 193 | |
| 194 // Alert the Demuxer that the video preload value has been changed. | |
| 195 virtual void SetPreload(Preload preload); | |
|
acolwell GONE FROM CHROMIUM
2011/03/25 04:35:28
Make this pure virtual like the other method so im
vrk (LEFT CHROMIUM)
2011/03/25 21:33:32
Done.
| |
| 183 }; | 196 }; |
| 184 | 197 |
| 185 | 198 |
| 186 class VideoDecoder : public Filter { | 199 class VideoDecoder : public Filter { |
| 187 public: | 200 public: |
| 188 // Initialize a VideoDecoder with the given DemuxerStream, executing the | 201 // Initialize a VideoDecoder with the given DemuxerStream, executing the |
| 189 // callback upon completion. | 202 // callback upon completion. |
| 190 // stats_callback is used to update global pipeline statistics. | 203 // stats_callback is used to update global pipeline statistics. |
| 191 virtual void Initialize(DemuxerStream* stream, FilterCallback* callback, | 204 virtual void Initialize(DemuxerStream* stream, FilterCallback* callback, |
| 192 StatisticsCallback* stats_callback) = 0; | 205 StatisticsCallback* stats_callback) = 0; |
| (...skipping 92 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 285 // buffer. | 298 // buffer. |
| 286 virtual bool HasEnded() = 0; | 299 virtual bool HasEnded() = 0; |
| 287 | 300 |
| 288 // Sets the output volume. | 301 // Sets the output volume. |
| 289 virtual void SetVolume(float volume) = 0; | 302 virtual void SetVolume(float volume) = 0; |
| 290 }; | 303 }; |
| 291 | 304 |
| 292 } // namespace media | 305 } // namespace media |
| 293 | 306 |
| 294 #endif // MEDIA_BASE_FILTERS_H_ | 307 #endif // MEDIA_BASE_FILTERS_H_ |
| OLD | NEW |