| OLD | NEW |
| 1 // Copyright (c) 2006-2009 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2006-2009 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 156 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 167 // kReadError in case of error. | 167 // kReadError in case of error. |
| 168 // TODO(hclam): should change |size| to int! It makes the code so messy | 168 // TODO(hclam): should change |size| to int! It makes the code so messy |
| 169 // with size_t and int all over the place.. | 169 // with size_t and int all over the place.. |
| 170 virtual void Read(int64 position, size_t size, | 170 virtual void Read(int64 position, size_t size, |
| 171 uint8* data, ReadCallback* read_callback) = 0; | 171 uint8* data, ReadCallback* read_callback) = 0; |
| 172 | 172 |
| 173 // Returns true and the file size, false if the file size could not be | 173 // Returns true and the file size, false if the file size could not be |
| 174 // retrieved. | 174 // retrieved. |
| 175 virtual bool GetSize(int64* size_out) = 0; | 175 virtual bool GetSize(int64* size_out) = 0; |
| 176 | 176 |
| 177 // Returns true if this data source supports random seeking. | 177 // Returns true if we are performing streaming. In this case seeking is |
| 178 virtual bool IsSeekable() = 0; | 178 // not possible. |
| 179 virtual bool IsStreaming() = 0; |
| 179 }; | 180 }; |
| 180 | 181 |
| 181 | 182 |
| 182 class Demuxer : public MediaFilter { | 183 class Demuxer : public MediaFilter { |
| 183 public: | 184 public: |
| 184 static const FilterType filter_type() { | 185 static const FilterType filter_type() { |
| 185 return FILTER_DEMUXER; | 186 return FILTER_DEMUXER; |
| 186 } | 187 } |
| 187 | 188 |
| 188 static bool IsMediaFormatSupported(const MediaFormat& media_format) { | 189 static bool IsMediaFormatSupported(const MediaFormat& media_format) { |
| (...skipping 129 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 318 // callback upon completion. | 319 // callback upon completion. |
| 319 virtual void Initialize(AudioDecoder* decoder, FilterCallback* callback) = 0; | 320 virtual void Initialize(AudioDecoder* decoder, FilterCallback* callback) = 0; |
| 320 | 321 |
| 321 // Sets the output volume. | 322 // Sets the output volume. |
| 322 virtual void SetVolume(float volume) = 0; | 323 virtual void SetVolume(float volume) = 0; |
| 323 }; | 324 }; |
| 324 | 325 |
| 325 } // namespace media | 326 } // namespace media |
| 326 | 327 |
| 327 #endif // MEDIA_BASE_FILTERS_H_ | 328 #endif // MEDIA_BASE_FILTERS_H_ |
| OLD | NEW |