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