| 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_CHUNK_DEMUXER_H_ | 5 #ifndef MEDIA_FILTERS_CHUNK_DEMUXER_H_ |
| 6 #define MEDIA_FILTERS_CHUNK_DEMUXER_H_ | 6 #define MEDIA_FILTERS_CHUNK_DEMUXER_H_ |
| 7 | 7 |
| 8 #include <list> | 8 #include <list> |
| 9 #include <string> | 9 #include <string> |
| 10 #include <utility> | 10 #include <utility> |
| (...skipping 16 matching lines...) Expand all Loading... |
| 27 public: | 27 public: |
| 28 enum Status { | 28 enum Status { |
| 29 kOk, // ID added w/o error. | 29 kOk, // ID added w/o error. |
| 30 kNotSupported, // Type specified is not supported. | 30 kNotSupported, // Type specified is not supported. |
| 31 kReachedIdLimit, // Reached ID limit. We can't handle any more IDs. | 31 kReachedIdLimit, // Reached ID limit. We can't handle any more IDs. |
| 32 }; | 32 }; |
| 33 | 33 |
| 34 typedef std::vector<std::pair<base::TimeDelta, base::TimeDelta> > Ranges; | 34 typedef std::vector<std::pair<base::TimeDelta, base::TimeDelta> > Ranges; |
| 35 | 35 |
| 36 explicit ChunkDemuxer(ChunkDemuxerClient* client); | 36 explicit ChunkDemuxer(ChunkDemuxerClient* client); |
| 37 virtual ~ChunkDemuxer(); | |
| 38 | 37 |
| 39 // Demuxer implementation. | 38 // Demuxer implementation. |
| 40 virtual void Initialize(DemuxerHost* host, | 39 virtual void Initialize(DemuxerHost* host, |
| 41 const PipelineStatusCB& cb) OVERRIDE; | 40 const PipelineStatusCB& cb) OVERRIDE; |
| 42 virtual void Stop(const base::Closure& callback) OVERRIDE; | 41 virtual void Stop(const base::Closure& callback) OVERRIDE; |
| 43 virtual void Seek(base::TimeDelta time, const PipelineStatusCB& cb) OVERRIDE; | 42 virtual void Seek(base::TimeDelta time, const PipelineStatusCB& cb) OVERRIDE; |
| 44 virtual void OnAudioRendererDisabled() OVERRIDE; | 43 virtual void OnAudioRendererDisabled() OVERRIDE; |
| 45 virtual scoped_refptr<DemuxerStream> GetStream( | 44 virtual scoped_refptr<DemuxerStream> GetStream( |
| 46 DemuxerStream::Type type) OVERRIDE; | 45 DemuxerStream::Type type) OVERRIDE; |
| 47 virtual base::TimeDelta GetStartTime() const OVERRIDE; | 46 virtual base::TimeDelta GetStartTime() const OVERRIDE; |
| (...skipping 27 matching lines...) Expand all Loading... |
| 75 bool AppendData(const std::string& id, const uint8* data, size_t length); | 74 bool AppendData(const std::string& id, const uint8* data, size_t length); |
| 76 | 75 |
| 77 // Aborts parsing the current segment and reset the parser to a state where | 76 // Aborts parsing the current segment and reset the parser to a state where |
| 78 // it can accept a new segment. | 77 // it can accept a new segment. |
| 79 void Abort(const std::string& id); | 78 void Abort(const std::string& id); |
| 80 | 79 |
| 81 void EndOfStream(PipelineStatus status); | 80 void EndOfStream(PipelineStatus status); |
| 82 bool HasEnded(); | 81 bool HasEnded(); |
| 83 void Shutdown(); | 82 void Shutdown(); |
| 84 | 83 |
| 84 protected: |
| 85 virtual ~ChunkDemuxer(); |
| 86 |
| 85 private: | 87 private: |
| 86 enum State { | 88 enum State { |
| 87 WAITING_FOR_INIT, | 89 WAITING_FOR_INIT, |
| 88 INITIALIZING, | 90 INITIALIZING, |
| 89 INITIALIZED, | 91 INITIALIZED, |
| 90 ENDED, | 92 ENDED, |
| 91 PARSE_ERROR, | 93 PARSE_ERROR, |
| 92 SHUTDOWN, | 94 SHUTDOWN, |
| 93 }; | 95 }; |
| 94 | 96 |
| (...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 130 | 132 |
| 131 // TODO(acolwell): Remove this when fixing http://crbug.com/122909 | 133 // TODO(acolwell): Remove this when fixing http://crbug.com/122909 |
| 132 std::string source_id_; | 134 std::string source_id_; |
| 133 | 135 |
| 134 DISALLOW_COPY_AND_ASSIGN(ChunkDemuxer); | 136 DISALLOW_COPY_AND_ASSIGN(ChunkDemuxer); |
| 135 }; | 137 }; |
| 136 | 138 |
| 137 } // namespace media | 139 } // namespace media |
| 138 | 140 |
| 139 #endif // MEDIA_FILTERS_CHUNK_DEMUXER_H_ | 141 #endif // MEDIA_FILTERS_CHUNK_DEMUXER_H_ |
| OLD | NEW |