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 <map> | 8 #include <map> |
9 #include <string> | 9 #include <string> |
10 #include <utility> | 10 #include <utility> |
(...skipping 22 matching lines...) Expand all Loading... |
33 }; | 33 }; |
34 | 34 |
35 typedef base::Callback<void(const std::string& type, | 35 typedef base::Callback<void(const std::string& type, |
36 scoped_array<uint8> init_data, | 36 scoped_array<uint8> init_data, |
37 int init_data_size)> NeedKeyCB; | 37 int init_data_size)> NeedKeyCB; |
38 | 38 |
39 // |open_cb| Run when Initialize() is called to signal that the demuxer | 39 // |open_cb| Run when Initialize() is called to signal that the demuxer |
40 // is ready to receive media data via AppenData(). | 40 // is ready to receive media data via AppenData(). |
41 // |need_key_cb| Run when the demuxer determines that an encryption key is | 41 // |need_key_cb| Run when the demuxer determines that an encryption key is |
42 // needed to decrypt the content. | 42 // needed to decrypt the content. |
43 ChunkDemuxer(const base::Closure& open_cb, const NeedKeyCB& need_key_cb); | 43 // |log_cb| Run when parsing error messages need to be logged to the error |
| 44 // console. |
| 45 ChunkDemuxer(const base::Closure& open_cb, const NeedKeyCB& need_key_cb, |
| 46 const LogCB& log_cb); |
44 | 47 |
45 // Demuxer implementation. | 48 // Demuxer implementation. |
46 virtual void Initialize(DemuxerHost* host, | 49 virtual void Initialize(DemuxerHost* host, |
47 const PipelineStatusCB& cb) OVERRIDE; | 50 const PipelineStatusCB& cb) OVERRIDE; |
48 virtual void Stop(const base::Closure& callback) OVERRIDE; | 51 virtual void Stop(const base::Closure& callback) OVERRIDE; |
49 virtual void Seek(base::TimeDelta time, const PipelineStatusCB& cb) OVERRIDE; | 52 virtual void Seek(base::TimeDelta time, const PipelineStatusCB& cb) OVERRIDE; |
50 virtual void OnAudioRendererDisabled() OVERRIDE; | 53 virtual void OnAudioRendererDisabled() OVERRIDE; |
51 virtual scoped_refptr<DemuxerStream> GetStream( | 54 virtual scoped_refptr<DemuxerStream> GetStream( |
52 DemuxerStream::Type type) OVERRIDE; | 55 DemuxerStream::Type type) OVERRIDE; |
53 virtual base::TimeDelta GetStartTime() const OVERRIDE; | 56 virtual base::TimeDelta GetStartTime() const OVERRIDE; |
(...skipping 110 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
164 | 167 |
165 // Returns the ranges representing the buffered data in the demuxer. | 168 // Returns the ranges representing the buffered data in the demuxer. |
166 Ranges<base::TimeDelta> GetBufferedRanges() const; | 169 Ranges<base::TimeDelta> GetBufferedRanges() const; |
167 | 170 |
168 mutable base::Lock lock_; | 171 mutable base::Lock lock_; |
169 State state_; | 172 State state_; |
170 | 173 |
171 DemuxerHost* host_; | 174 DemuxerHost* host_; |
172 base::Closure open_cb_; | 175 base::Closure open_cb_; |
173 NeedKeyCB need_key_cb_; | 176 NeedKeyCB need_key_cb_; |
| 177 LogCB log_cb_; |
174 | 178 |
175 PipelineStatusCB init_cb_; | 179 PipelineStatusCB init_cb_; |
176 PipelineStatusCB seek_cb_; | 180 PipelineStatusCB seek_cb_; |
177 | 181 |
178 scoped_refptr<ChunkDemuxerStream> audio_; | 182 scoped_refptr<ChunkDemuxerStream> audio_; |
179 scoped_refptr<ChunkDemuxerStream> video_; | 183 scoped_refptr<ChunkDemuxerStream> video_; |
180 | 184 |
181 base::TimeDelta duration_; | 185 base::TimeDelta duration_; |
182 | 186 |
183 typedef std::map<std::string, StreamParser*> StreamParserMap; | 187 typedef std::map<std::string, StreamParser*> StreamParserMap; |
(...skipping 12 matching lines...) Expand all Loading... |
196 // removed with RemoveID() but can not be re-added (yet). | 200 // removed with RemoveID() but can not be re-added (yet). |
197 std::string source_id_audio_; | 201 std::string source_id_audio_; |
198 std::string source_id_video_; | 202 std::string source_id_video_; |
199 | 203 |
200 DISALLOW_COPY_AND_ASSIGN(ChunkDemuxer); | 204 DISALLOW_COPY_AND_ASSIGN(ChunkDemuxer); |
201 }; | 205 }; |
202 | 206 |
203 } // namespace media | 207 } // namespace media |
204 | 208 |
205 #endif // MEDIA_FILTERS_CHUNK_DEMUXER_H_ | 209 #endif // MEDIA_FILTERS_CHUNK_DEMUXER_H_ |
OLD | NEW |