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 // SourceBufferStream is a data structure that stores media Buffers in ranges. | 5 // SourceBufferStream is a data structure that stores media Buffers in ranges. |
6 // Buffers can be appended out of presentation order. Buffers are retrieved by | 6 // Buffers can be appended out of presentation order. Buffers are retrieved by |
7 // seeking to the desired start point and calling GetNextBuffer(). Buffers are | 7 // seeking to the desired start point and calling GetNextBuffer(). Buffers are |
8 // returned in sequential presentation order. | 8 // returned in sequential presentation order. |
9 | 9 |
10 #ifndef MEDIA_FILTERS_SOURCE_BUFFER_STREAM_H_ | 10 #ifndef MEDIA_FILTERS_SOURCE_BUFFER_STREAM_H_ |
(...skipping 310 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
321 // Called by PrepareRangesForNextAppend() before pruning overlapped buffers to | 321 // Called by PrepareRangesForNextAppend() before pruning overlapped buffers to |
322 // generate a splice frame with a small portion of the overlapped buffers. If | 322 // generate a splice frame with a small portion of the overlapped buffers. If |
323 // a splice frame is generated, the first buffer in |new_buffers| will have | 323 // a splice frame is generated, the first buffer in |new_buffers| will have |
324 // its timestamps, duration, and fade out preroll updated. | 324 // its timestamps, duration, and fade out preroll updated. |
325 void GenerateSpliceFrame(const BufferQueue& new_buffers); | 325 void GenerateSpliceFrame(const BufferQueue& new_buffers); |
326 | 326 |
327 // If |out_buffer| has splice buffers or preroll, sets |pending_buffer_| | 327 // If |out_buffer| has splice buffers or preroll, sets |pending_buffer_| |
328 // appropriately and returns true. Otherwise returns false. | 328 // appropriately and returns true. Otherwise returns false. |
329 bool SetPendingBuffer(scoped_refptr<StreamParserBuffer>* out_buffer); | 329 bool SetPendingBuffer(scoped_refptr<StreamParserBuffer>* out_buffer); |
330 | 330 |
| 331 // Update |splice_stats_| and log the update to |media_log_|. |
| 332 void LogSplice(double splice_duration); |
| 333 void LogDegenerateSplice(); |
| 334 |
331 // Used to report log messages that can help the web developer figure out what | 335 // Used to report log messages that can help the web developer figure out what |
332 // is wrong with the content. | 336 // is wrong with the content. |
333 scoped_refptr<MediaLog> media_log_; | 337 scoped_refptr<MediaLog> media_log_; |
334 | 338 |
335 // List of disjoint buffered ranges, ordered by start time. | 339 // List of disjoint buffered ranges, ordered by start time. |
336 RangeList ranges_; | 340 RangeList ranges_; |
337 | 341 |
338 // Indicates which decoder config is being used by the decoder. | 342 // Indicates which decoder config is being used by the decoder. |
339 // GetNextBuffer() is only allows to return buffers that have a | 343 // GetNextBuffer() is only allows to return buffers that have a |
340 // config ID that matches this index. If there is a mismatch then | 344 // config ID that matches this index. If there is a mismatch then |
(...skipping 71 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
412 // Indicates which of the splice buffers in |splice_buffer_| should be | 416 // Indicates which of the splice buffers in |splice_buffer_| should be |
413 // handled out next. | 417 // handled out next. |
414 size_t splice_buffers_index_; | 418 size_t splice_buffers_index_; |
415 | 419 |
416 // Indicates that all buffers before |pending_buffer_| have been handed out. | 420 // Indicates that all buffers before |pending_buffer_| have been handed out. |
417 bool pending_buffers_complete_; | 421 bool pending_buffers_complete_; |
418 | 422 |
419 // Indicates that splice frame generation is enabled. | 423 // Indicates that splice frame generation is enabled. |
420 const bool splice_frames_enabled_; | 424 const bool splice_frames_enabled_; |
421 | 425 |
| 426 // Buffered audio splice generation statistics for reporting to |media_log_|. |
| 427 // TODO(wolenetz,chcunningham): Once multi-track audio is enabled, report |
| 428 // these statistics per track. |
| 429 MediaLog::AudioSpliceStatistics splice_stats_; |
| 430 |
422 DISALLOW_COPY_AND_ASSIGN(SourceBufferStream); | 431 DISALLOW_COPY_AND_ASSIGN(SourceBufferStream); |
423 }; | 432 }; |
424 | 433 |
425 } // namespace media | 434 } // namespace media |
426 | 435 |
427 #endif // MEDIA_FILTERS_SOURCE_BUFFER_STREAM_H_ | 436 #endif // MEDIA_FILTERS_SOURCE_BUFFER_STREAM_H_ |
OLD | NEW |