| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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_FILTERS_SOURCE_BUFFER_STREAM_H_ | 5 #ifndef MEDIA_FILTERS_SOURCE_BUFFER_STREAM_H_ |
| 6 #define MEDIA_FILTERS_SOURCE_BUFFER_STREAM_H_ | 6 #define MEDIA_FILTERS_SOURCE_BUFFER_STREAM_H_ |
| 7 | 7 |
| 8 #include <deque> | 8 #include <deque> |
| 9 #include <list> | 9 #include <list> |
| 10 #include <utility> | 10 #include <utility> |
| 11 | 11 |
| 12 #include "base/memory/ref_counted.h" | 12 #include "base/memory/ref_counted.h" |
| 13 #include "media/base/audio_decoder_config.h" | 13 #include "media/base/audio_decoder_config.h" |
| 14 #include "media/base/media_export.h" | 14 #include "media/base/media_export.h" |
| 15 #include "media/base/stream_parser_buffer.h" | 15 #include "media/base/stream_parser_buffer.h" |
| 16 #include "media/base/video_decoder_config.h" | 16 #include "media/base/video_decoder_config.h" |
| 17 | 17 |
| 18 namespace media { | 18 namespace media { |
| 19 | 19 |
| 20 class SourceBufferRange; | 20 class SourceBufferRange; |
| 21 | 21 |
| 22 // SourceBufferStream is a data structure that stores media Buffers in ranges. | 22 // SourceBufferStream is a data structure that stores media Buffers in ranges. |
| 23 // Buffers can be appended out of presentation order. Buffers are retrieved by | 23 // Buffers can be appended out of presentation order. Buffers are retrieved by |
| 24 // seeking to the desired start point and calling GetNextBuffer(). Buffers are | 24 // seeking to the desired start point and calling GetNextBuffer(). Buffers are |
| 25 // returned in sequential presentation order. | 25 // returned in sequential presentation order. |
| 26 class MEDIA_EXPORT SourceBufferStream { | 26 class MEDIA_EXPORT SourceBufferStream { |
| 27 public: | 27 public: |
| 28 typedef std::deque<scoped_refptr<StreamParserBuffer> > BufferQueue; | 28 typedef std::deque<scoped_refptr<StreamParserBuffer> > BufferQueue; |
| 29 typedef std::pair<base::TimeDelta, base::TimeDelta> Timespan; | 29 typedef std::pair<base::TimeDelta, base::TimeDelta> Timespan; |
| 30 typedef std::list<Timespan> TimespanList; | 30 typedef std::deque<Timespan> TimespanList; |
| 31 | 31 |
| 32 SourceBufferStream(); | 32 SourceBufferStream(); |
| 33 explicit SourceBufferStream(const AudioDecoderConfig& audio_config); | 33 explicit SourceBufferStream(const AudioDecoderConfig& audio_config); |
| 34 explicit SourceBufferStream(const VideoDecoderConfig& video_config); | 34 explicit SourceBufferStream(const VideoDecoderConfig& video_config); |
| 35 | 35 |
| 36 ~SourceBufferStream(); | 36 ~SourceBufferStream(); |
| 37 | 37 |
| 38 // Add the |buffers| to the SourceBufferStream. Buffers within the queue are | 38 // Add the |buffers| to the SourceBufferStream. Buffers within the queue are |
| 39 // expected to be in order, but multiple calls to Append() may add buffers out | 39 // expected to be in order, but multiple calls to Append() may add buffers out |
| 40 // of order or overlapping. Assumes all buffers within |buffers| are in | 40 // of order or overlapping. Assumes all buffers within |buffers| are in |
| (...skipping 98 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 139 // True when EndOfStream() has been called and GetNextBuffer() should return | 139 // True when EndOfStream() has been called and GetNextBuffer() should return |
| 140 // EOS buffers for read requests beyond the buffered data. False initially. | 140 // EOS buffers for read requests beyond the buffered data. False initially. |
| 141 bool end_of_stream_; | 141 bool end_of_stream_; |
| 142 | 142 |
| 143 DISALLOW_COPY_AND_ASSIGN(SourceBufferStream); | 143 DISALLOW_COPY_AND_ASSIGN(SourceBufferStream); |
| 144 }; | 144 }; |
| 145 | 145 |
| 146 } // namespace media | 146 } // namespace media |
| 147 | 147 |
| 148 #endif // MEDIA_FILTERS_SOURCE_BUFFER_STREAM_H_ | 148 #endif // MEDIA_FILTERS_SOURCE_BUFFER_STREAM_H_ |
| OLD | NEW |