| 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 <deque> | 8 #include <deque> |
| 9 #include <map> | 9 #include <map> |
| 10 #include <string> | 10 #include <string> |
| (...skipping 129 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 140 enum Status { | 140 enum Status { |
| 141 kOk, // ID added w/o error. | 141 kOk, // ID added w/o error. |
| 142 kNotSupported, // Type specified is not supported. | 142 kNotSupported, // Type specified is not supported. |
| 143 kReachedIdLimit, // Reached ID limit. We can't handle any more IDs. | 143 kReachedIdLimit, // Reached ID limit. We can't handle any more IDs. |
| 144 }; | 144 }; |
| 145 | 145 |
| 146 typedef base::Closure InitSegmentReceivedCB; | 146 typedef base::Closure InitSegmentReceivedCB; |
| 147 | 147 |
| 148 // |open_cb| Run when Initialize() is called to signal that the demuxer | 148 // |open_cb| Run when Initialize() is called to signal that the demuxer |
| 149 // is ready to receive media data via AppenData(). | 149 // is ready to receive media data via AppenData(). |
| 150 // |need_key_cb| Run when the demuxer determines that an encryption key is | 150 // |encrypted_media_init_data_cb| Run when the demuxer determines that an |
| 151 // needed to decrypt the content. | 151 // encryption key is needed to decrypt the content. |
| 152 // |enable_text| Process inband text tracks in the normal way when true, | 152 // |enable_text| Process inband text tracks in the normal way when true, |
| 153 // otherwise ignore them. | 153 // otherwise ignore them. |
| 154 // |log_cb| Run when parsing error messages need to be logged to the error | 154 // |log_cb| Run when parsing error messages need to be logged to the error |
| 155 // console. | 155 // console. |
| 156 // |splice_frames_enabled| Indicates that it's okay to generate splice frames | 156 // |splice_frames_enabled| Indicates that it's okay to generate splice frames |
| 157 // per the MSE specification. Renderers must understand DecoderBuffer's | 157 // per the MSE specification. Renderers must understand DecoderBuffer's |
| 158 // splice_timestamp() field. | 158 // splice_timestamp() field. |
| 159 ChunkDemuxer(const base::Closure& open_cb, | 159 ChunkDemuxer(const base::Closure& open_cb, |
| 160 const NeedKeyCB& need_key_cb, | 160 const EncryptedMediaInitDataCB& encrypted_media_init_data_cb, |
| 161 const LogCB& log_cb, | 161 const LogCB& log_cb, |
| 162 const scoped_refptr<MediaLog>& media_log, | 162 const scoped_refptr<MediaLog>& media_log, |
| 163 bool splice_frames_enabled); | 163 bool splice_frames_enabled); |
| 164 ~ChunkDemuxer() override; | 164 ~ChunkDemuxer() override; |
| 165 | 165 |
| 166 // Demuxer implementation. | 166 // Demuxer implementation. |
| 167 void Initialize(DemuxerHost* host, | 167 void Initialize(DemuxerHost* host, |
| 168 const PipelineStatusCB& cb, | 168 const PipelineStatusCB& cb, |
| 169 bool enable_text_tracks) override; | 169 bool enable_text_tracks) override; |
| 170 void Stop() override; | 170 void Stop() override; |
| (...skipping 181 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 352 // Shuts down all DemuxerStreams by calling Shutdown() on | 352 // Shuts down all DemuxerStreams by calling Shutdown() on |
| 353 // all objects in |source_state_map_|. | 353 // all objects in |source_state_map_|. |
| 354 void ShutdownAllStreams(); | 354 void ShutdownAllStreams(); |
| 355 | 355 |
| 356 mutable base::Lock lock_; | 356 mutable base::Lock lock_; |
| 357 State state_; | 357 State state_; |
| 358 bool cancel_next_seek_; | 358 bool cancel_next_seek_; |
| 359 | 359 |
| 360 DemuxerHost* host_; | 360 DemuxerHost* host_; |
| 361 base::Closure open_cb_; | 361 base::Closure open_cb_; |
| 362 NeedKeyCB need_key_cb_; | 362 EncryptedMediaInitDataCB encrypted_media_init_data_cb_; |
| 363 bool enable_text_; | 363 bool enable_text_; |
| 364 // Callback used to report error strings that can help the web developer | 364 // Callback used to report error strings that can help the web developer |
| 365 // figure out what is wrong with the content. | 365 // figure out what is wrong with the content. |
| 366 LogCB log_cb_; | 366 LogCB log_cb_; |
| 367 scoped_refptr<MediaLog> media_log_; | 367 scoped_refptr<MediaLog> media_log_; |
| 368 | 368 |
| 369 PipelineStatusCB init_cb_; | 369 PipelineStatusCB init_cb_; |
| 370 // Callback to execute upon seek completion. | 370 // Callback to execute upon seek completion. |
| 371 // TODO(wolenetz/acolwell): Protect against possible double-locking by first | 371 // TODO(wolenetz/acolwell): Protect against possible double-locking by first |
| 372 // releasing |lock_| before executing this callback. See | 372 // releasing |lock_| before executing this callback. See |
| (...skipping 26 matching lines...) Expand all Loading... |
| 399 | 399 |
| 400 // Indicates that splice frame generation is enabled. | 400 // Indicates that splice frame generation is enabled. |
| 401 const bool splice_frames_enabled_; | 401 const bool splice_frames_enabled_; |
| 402 | 402 |
| 403 DISALLOW_COPY_AND_ASSIGN(ChunkDemuxer); | 403 DISALLOW_COPY_AND_ASSIGN(ChunkDemuxer); |
| 404 }; | 404 }; |
| 405 | 405 |
| 406 } // namespace media | 406 } // namespace media |
| 407 | 407 |
| 408 #endif // MEDIA_FILTERS_CHUNK_DEMUXER_H_ | 408 #endif // MEDIA_FILTERS_CHUNK_DEMUXER_H_ |
| OLD | NEW |