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 71 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
82 | 82 |
83 // DemuxerStream methods. | 83 // DemuxerStream methods. |
84 void Read(const ReadCB& read_cb) override; | 84 void Read(const ReadCB& read_cb) override; |
85 Type type() const override; | 85 Type type() const override; |
86 Liveness liveness() const override; | 86 Liveness liveness() const override; |
87 AudioDecoderConfig audio_decoder_config() override; | 87 AudioDecoderConfig audio_decoder_config() override; |
88 VideoDecoderConfig video_decoder_config() override; | 88 VideoDecoderConfig video_decoder_config() override; |
89 bool SupportsConfigChanges() override; | 89 bool SupportsConfigChanges() override; |
90 VideoRotation video_rotation() override; | 90 VideoRotation video_rotation() override; |
91 | 91 |
| 92 // Update the media time used by the MSE garbage collection algorithm. |
| 93 void NotifyMediaTimeUpdate(DecodeTimestamp time); |
| 94 |
92 // Returns the text track configuration. It is an error to call this method | 95 // Returns the text track configuration. It is an error to call this method |
93 // if type() != TEXT. | 96 // if type() != TEXT. |
94 TextTrackConfig text_track_config(); | 97 TextTrackConfig text_track_config(); |
95 | 98 |
96 // Sets the memory limit, in bytes, on the SourceBufferStream. | 99 // Sets the memory limit, in bytes, on the SourceBufferStream. |
97 void set_memory_limit(int memory_limit) { | 100 void set_memory_limit(int memory_limit) { |
98 stream_->set_memory_limit(memory_limit); | 101 stream_->set_memory_limit(memory_limit); |
99 } | 102 } |
100 | 103 |
101 bool supports_partial_append_window_trimming() const { | 104 bool supports_partial_append_window_trimming() const { |
(...skipping 54 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
156 // |splice_frames_enabled| Indicates that it's okay to generate splice frames | 159 // |splice_frames_enabled| Indicates that it's okay to generate splice frames |
157 // per the MSE specification. Renderers must understand DecoderBuffer's | 160 // per the MSE specification. Renderers must understand DecoderBuffer's |
158 // splice_timestamp() field. | 161 // splice_timestamp() field. |
159 ChunkDemuxer(const base::Closure& open_cb, | 162 ChunkDemuxer(const base::Closure& open_cb, |
160 const EncryptedMediaInitDataCB& encrypted_media_init_data_cb, | 163 const EncryptedMediaInitDataCB& encrypted_media_init_data_cb, |
161 const LogCB& log_cb, | 164 const LogCB& log_cb, |
162 const scoped_refptr<MediaLog>& media_log, | 165 const scoped_refptr<MediaLog>& media_log, |
163 bool splice_frames_enabled); | 166 bool splice_frames_enabled); |
164 ~ChunkDemuxer() override; | 167 ~ChunkDemuxer() override; |
165 | 168 |
| 169 // Set the media time provider. |
| 170 // TODO(damienv): should truly be part of the constructor. |
| 171 void SetMediaTimeProvider( |
| 172 const base::Callback<base::TimeDelta(void)>& get_media_time_cb); |
| 173 |
166 // Demuxer implementation. | 174 // Demuxer implementation. |
167 void Initialize(DemuxerHost* host, | 175 void Initialize(DemuxerHost* host, |
168 const PipelineStatusCB& cb, | 176 const PipelineStatusCB& cb, |
169 bool enable_text_tracks) override; | 177 bool enable_text_tracks) override; |
170 void Stop() override; | 178 void Stop() override; |
171 void Seek(base::TimeDelta time, const PipelineStatusCB& cb) override; | 179 void Seek(base::TimeDelta time, const PipelineStatusCB& cb) override; |
172 base::Time GetTimelineOffset() const override; | 180 base::Time GetTimelineOffset() const override; |
173 DemuxerStream* GetStream(DemuxerStream::Type type) override; | 181 DemuxerStream* GetStream(DemuxerStream::Type type) override; |
174 base::TimeDelta GetStartTime() const override; | 182 base::TimeDelta GetStartTime() const override; |
175 | 183 |
(...skipping 193 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
369 PipelineStatusCB init_cb_; | 377 PipelineStatusCB init_cb_; |
370 // Callback to execute upon seek completion. | 378 // Callback to execute upon seek completion. |
371 // TODO(wolenetz/acolwell): Protect against possible double-locking by first | 379 // TODO(wolenetz/acolwell): Protect against possible double-locking by first |
372 // releasing |lock_| before executing this callback. See | 380 // releasing |lock_| before executing this callback. See |
373 // http://crbug.com/308226 | 381 // http://crbug.com/308226 |
374 PipelineStatusCB seek_cb_; | 382 PipelineStatusCB seek_cb_; |
375 | 383 |
376 scoped_ptr<ChunkDemuxerStream> audio_; | 384 scoped_ptr<ChunkDemuxerStream> audio_; |
377 scoped_ptr<ChunkDemuxerStream> video_; | 385 scoped_ptr<ChunkDemuxerStream> video_; |
378 | 386 |
| 387 base::Callback<base::TimeDelta(void)> get_media_time_cb_; |
| 388 |
379 base::TimeDelta duration_; | 389 base::TimeDelta duration_; |
380 | 390 |
381 // The duration passed to the last SetDuration(). If | 391 // The duration passed to the last SetDuration(). If |
382 // SetDuration() is never called or an AppendData() call or | 392 // SetDuration() is never called or an AppendData() call or |
383 // a EndOfStream() call changes |duration_|, then this | 393 // a EndOfStream() call changes |duration_|, then this |
384 // variable is set to < 0 to indicate that the |duration_| represents | 394 // variable is set to < 0 to indicate that the |duration_| represents |
385 // the actual duration instead of a user specified value. | 395 // the actual duration instead of a user specified value. |
386 double user_specified_duration_; | 396 double user_specified_duration_; |
387 | 397 |
388 base::Time timeline_offset_; | 398 base::Time timeline_offset_; |
(...skipping 10 matching lines...) Expand all Loading... |
399 | 409 |
400 // Indicates that splice frame generation is enabled. | 410 // Indicates that splice frame generation is enabled. |
401 const bool splice_frames_enabled_; | 411 const bool splice_frames_enabled_; |
402 | 412 |
403 DISALLOW_COPY_AND_ASSIGN(ChunkDemuxer); | 413 DISALLOW_COPY_AND_ASSIGN(ChunkDemuxer); |
404 }; | 414 }; |
405 | 415 |
406 } // namespace media | 416 } // namespace media |
407 | 417 |
408 #endif // MEDIA_FILTERS_CHUNK_DEMUXER_H_ | 418 #endif // MEDIA_FILTERS_CHUNK_DEMUXER_H_ |
OLD | NEW |