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 214 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
225 // Returns true if the source buffer associated with |id| is currently parsing | 225 // Returns true if the source buffer associated with |id| is currently parsing |
226 // a media segment, or false otherwise. | 226 // a media segment, or false otherwise. |
227 bool IsParsingMediaSegment(const std::string& id); | 227 bool IsParsingMediaSegment(const std::string& id); |
228 | 228 |
229 // Set the append mode to be applied to subsequent buffers appended to the | 229 // Set the append mode to be applied to subsequent buffers appended to the |
230 // source buffer associated with |id|. If |sequence_mode| is true, caller | 230 // source buffer associated with |id|. If |sequence_mode| is true, caller |
231 // is requesting "sequence" mode. Otherwise, caller is requesting "segments" | 231 // is requesting "sequence" mode. Otherwise, caller is requesting "segments" |
232 // mode. | 232 // mode. |
233 void SetSequenceMode(const std::string& id, bool sequence_mode); | 233 void SetSequenceMode(const std::string& id, bool sequence_mode); |
234 | 234 |
| 235 // Signals the coded frame processor for the source buffer associated with |
| 236 // |id| to update its group start timestamp to be |timestamp_offset| if it is |
| 237 // in sequence append mode. |
| 238 void SetGroupStartTimestampIfInSequenceMode(const std::string& id, |
| 239 base::TimeDelta timestamp_offset); |
| 240 |
235 // Called to signal changes in the "end of stream" | 241 // Called to signal changes in the "end of stream" |
236 // state. UnmarkEndOfStream() must not be called if a matching | 242 // state. UnmarkEndOfStream() must not be called if a matching |
237 // MarkEndOfStream() has not come before it. | 243 // MarkEndOfStream() has not come before it. |
238 void MarkEndOfStream(PipelineStatus status); | 244 void MarkEndOfStream(PipelineStatus status); |
239 void UnmarkEndOfStream(); | 245 void UnmarkEndOfStream(); |
240 | 246 |
241 void Shutdown(); | 247 void Shutdown(); |
242 | 248 |
243 // Sets the memory limit on each stream. |memory_limit| is the | 249 // Sets the memory limit on each stream. |memory_limit| is the |
244 // maximum number of bytes each stream is allowed to hold in its buffer. | 250 // maximum number of bytes each stream is allowed to hold in its buffer. |
(...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
276 // SourceState callbacks. | 282 // SourceState callbacks. |
277 void OnSourceInitDone(bool success, base::TimeDelta duration); | 283 void OnSourceInitDone(bool success, base::TimeDelta duration); |
278 | 284 |
279 // Creates a DemuxerStream for the specified |type|. | 285 // Creates a DemuxerStream for the specified |type|. |
280 // Returns a new ChunkDemuxerStream instance if a stream of this type | 286 // Returns a new ChunkDemuxerStream instance if a stream of this type |
281 // has not been created before. Returns NULL otherwise. | 287 // has not been created before. Returns NULL otherwise. |
282 ChunkDemuxerStream* CreateDemuxerStream(DemuxerStream::Type type); | 288 ChunkDemuxerStream* CreateDemuxerStream(DemuxerStream::Type type); |
283 | 289 |
284 void OnNewTextTrack(ChunkDemuxerStream* text_stream, | 290 void OnNewTextTrack(ChunkDemuxerStream* text_stream, |
285 const TextTrackConfig& config); | 291 const TextTrackConfig& config); |
286 void OnNewMediaSegment(const std::string& source_id, | |
287 base::TimeDelta start_timestamp); | |
288 | 292 |
289 // Returns true if |source_id| is valid, false otherwise. | 293 // Returns true if |source_id| is valid, false otherwise. |
290 bool IsValidId(const std::string& source_id) const; | 294 bool IsValidId(const std::string& source_id) const; |
291 | 295 |
292 // Increases |duration_| to |new_duration|, if |new_duration| is higher. | 296 // Increases |duration_| to |new_duration|, if |new_duration| is higher. |
293 void IncreaseDurationIfNecessary(base::TimeDelta new_duration); | 297 void IncreaseDurationIfNecessary(base::TimeDelta new_duration); |
294 | 298 |
295 // Decreases |duration_| if the buffered region is less than |duration_| when | 299 // Decreases |duration_| if the buffered region is less than |duration_| when |
296 // EndOfStream() is called. | 300 // EndOfStream() is called. |
297 void DecreaseDurationIfNecessary(); | 301 void DecreaseDurationIfNecessary(); |
(...skipping 63 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
361 // removed with RemoveID() but can not be re-added (yet). | 365 // removed with RemoveID() but can not be re-added (yet). |
362 std::string source_id_audio_; | 366 std::string source_id_audio_; |
363 std::string source_id_video_; | 367 std::string source_id_video_; |
364 | 368 |
365 DISALLOW_COPY_AND_ASSIGN(ChunkDemuxer); | 369 DISALLOW_COPY_AND_ASSIGN(ChunkDemuxer); |
366 }; | 370 }; |
367 | 371 |
368 } // namespace media | 372 } // namespace media |
369 | 373 |
370 #endif // MEDIA_FILTERS_CHUNK_DEMUXER_H_ | 374 #endif // MEDIA_FILTERS_CHUNK_DEMUXER_H_ |
OLD | NEW |