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 140 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
151 | 151 |
152 // Demuxer implementation. | 152 // Demuxer implementation. |
153 virtual void Initialize(DemuxerHost* host, | 153 virtual void Initialize(DemuxerHost* host, |
154 const PipelineStatusCB& cb, | 154 const PipelineStatusCB& cb, |
155 bool enable_text_tracks) OVERRIDE; | 155 bool enable_text_tracks) OVERRIDE; |
156 virtual void Stop(const base::Closure& callback) OVERRIDE; | 156 virtual void Stop(const base::Closure& callback) OVERRIDE; |
157 virtual void Seek(base::TimeDelta time, const PipelineStatusCB& cb) OVERRIDE; | 157 virtual void Seek(base::TimeDelta time, const PipelineStatusCB& cb) OVERRIDE; |
158 virtual void OnAudioRendererDisabled() OVERRIDE; | 158 virtual void OnAudioRendererDisabled() OVERRIDE; |
159 virtual DemuxerStream* GetStream(DemuxerStream::Type type) OVERRIDE; | 159 virtual DemuxerStream* GetStream(DemuxerStream::Type type) OVERRIDE; |
160 virtual base::TimeDelta GetStartTime() const OVERRIDE; | 160 virtual base::TimeDelta GetStartTime() const OVERRIDE; |
| 161 virtual base::Time GetTimelineOffset() const OVERRIDE; |
161 | 162 |
162 // Methods used by an external object to control this demuxer. | 163 // Methods used by an external object to control this demuxer. |
163 // | 164 // |
164 // Indicates that a new Seek() call is on its way. Any pending Reads on the | 165 // Indicates that a new Seek() call is on its way. Any pending Reads on the |
165 // DemuxerStream objects should be aborted immediately inside this call and | 166 // DemuxerStream objects should be aborted immediately inside this call and |
166 // future Read calls should return kAborted until the Seek() call occurs. | 167 // future Read calls should return kAborted until the Seek() call occurs. |
167 // This method MUST ALWAYS be called before Seek() is called to signal that | 168 // This method MUST ALWAYS be called before Seek() is called to signal that |
168 // the next Seek() call represents the seek point we actually want to return | 169 // the next Seek() call represents the seek point we actually want to return |
169 // data for. | 170 // data for. |
170 // |seek_time| - The presentation timestamp for the seek that triggered this | 171 // |seek_time| - The presentation timestamp for the seek that triggered this |
(...skipping 108 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
279 void ReportError_Locked(PipelineStatus error); | 280 void ReportError_Locked(PipelineStatus error); |
280 | 281 |
281 // Returns true if any stream has seeked to a time without buffered data. | 282 // Returns true if any stream has seeked to a time without buffered data. |
282 bool IsSeekWaitingForData_Locked() const; | 283 bool IsSeekWaitingForData_Locked() const; |
283 | 284 |
284 // Returns true if all streams can successfully call EndOfStream, | 285 // Returns true if all streams can successfully call EndOfStream, |
285 // false if any can not. | 286 // false if any can not. |
286 bool CanEndOfStream_Locked() const; | 287 bool CanEndOfStream_Locked() const; |
287 | 288 |
288 // SourceState callbacks. | 289 // SourceState callbacks. |
289 void OnSourceInitDone(bool success, base::TimeDelta duration); | 290 void OnSourceInitDone(bool success, base::TimeDelta duration, |
| 291 base::Time timeline_offset); |
290 | 292 |
291 // Creates a DemuxerStream for the specified |type|. | 293 // Creates a DemuxerStream for the specified |type|. |
292 // Returns a new ChunkDemuxerStream instance if a stream of this type | 294 // Returns a new ChunkDemuxerStream instance if a stream of this type |
293 // has not been created before. Returns NULL otherwise. | 295 // has not been created before. Returns NULL otherwise. |
294 ChunkDemuxerStream* CreateDemuxerStream(DemuxerStream::Type type); | 296 ChunkDemuxerStream* CreateDemuxerStream(DemuxerStream::Type type); |
295 | 297 |
296 void OnNewTextTrack(ChunkDemuxerStream* text_stream, | 298 void OnNewTextTrack(ChunkDemuxerStream* text_stream, |
297 const TextTrackConfig& config); | 299 const TextTrackConfig& config); |
298 | 300 |
299 // Returns true if |source_id| is valid, false otherwise. | 301 // Returns true if |source_id| is valid, false otherwise. |
(...skipping 56 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
356 | 358 |
357 base::TimeDelta duration_; | 359 base::TimeDelta duration_; |
358 | 360 |
359 // The duration passed to the last SetDuration(). If | 361 // The duration passed to the last SetDuration(). If |
360 // SetDuration() is never called or an AppendData() call or | 362 // SetDuration() is never called or an AppendData() call or |
361 // a EndOfStream() call changes |duration_|, then this | 363 // a EndOfStream() call changes |duration_|, then this |
362 // variable is set to < 0 to indicate that the |duration_| represents | 364 // variable is set to < 0 to indicate that the |duration_| represents |
363 // the actual duration instead of a user specified value. | 365 // the actual duration instead of a user specified value. |
364 double user_specified_duration_; | 366 double user_specified_duration_; |
365 | 367 |
| 368 base::Time timeline_offset_; |
| 369 |
366 typedef std::map<std::string, SourceState*> SourceStateMap; | 370 typedef std::map<std::string, SourceState*> SourceStateMap; |
367 SourceStateMap source_state_map_; | 371 SourceStateMap source_state_map_; |
368 | 372 |
369 // Used to ensure that (1) config data matches the type and codec provided in | 373 // Used to ensure that (1) config data matches the type and codec provided in |
370 // AddId(), (2) only 1 audio and 1 video sources are added, and (3) ids may be | 374 // AddId(), (2) only 1 audio and 1 video sources are added, and (3) ids may be |
371 // removed with RemoveID() but can not be re-added (yet). | 375 // removed with RemoveID() but can not be re-added (yet). |
372 std::string source_id_audio_; | 376 std::string source_id_audio_; |
373 std::string source_id_video_; | 377 std::string source_id_video_; |
374 | 378 |
375 // Indicates that splice frame generation is enabled. | 379 // Indicates that splice frame generation is enabled. |
376 const bool splice_frames_enabled_; | 380 const bool splice_frames_enabled_; |
377 | 381 |
378 DISALLOW_COPY_AND_ASSIGN(ChunkDemuxer); | 382 DISALLOW_COPY_AND_ASSIGN(ChunkDemuxer); |
379 }; | 383 }; |
380 | 384 |
381 } // namespace media | 385 } // namespace media |
382 | 386 |
383 #endif // MEDIA_FILTERS_CHUNK_DEMUXER_H_ | 387 #endif // MEDIA_FILTERS_CHUNK_DEMUXER_H_ |
OLD | NEW |