Chromium Code Reviews| 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 36 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 47 kEndOfStream | 47 kEndOfStream |
| 48 }; | 48 }; |
| 49 | 49 |
| 50 enum Type { | 50 enum Type { |
| 51 kAudio, | 51 kAudio, |
| 52 kVideo, | 52 kVideo, |
| 53 kText | 53 kText |
| 54 }; | 54 }; |
| 55 | 55 |
| 56 SourceBufferStream(const AudioDecoderConfig& audio_config, | 56 SourceBufferStream(const AudioDecoderConfig& audio_config, |
| 57 const LogCB& log_cb, | 57 const scoped_refptr<MediaLog>& media_log, |
| 58 bool splice_frames_enabled); | 58 bool splice_frames_enabled); |
| 59 SourceBufferStream(const VideoDecoderConfig& video_config, | 59 SourceBufferStream(const VideoDecoderConfig& video_config, |
| 60 const LogCB& log_cb, | 60 const scoped_refptr<MediaLog>& media_log, |
| 61 bool splice_frames_enabled); | 61 bool splice_frames_enabled); |
| 62 SourceBufferStream(const TextTrackConfig& text_config, | 62 SourceBufferStream(const TextTrackConfig& text_config, |
| 63 const LogCB& log_cb, | 63 const scoped_refptr<MediaLog>& media_log, |
| 64 bool splice_frames_enabled); | 64 bool splice_frames_enabled); |
| 65 | 65 |
| 66 ~SourceBufferStream(); | 66 ~SourceBufferStream(); |
| 67 | 67 |
| 68 // Signals that the next buffers appended are part of a new media segment | 68 // Signals that the next buffers appended are part of a new media segment |
| 69 // starting at |media_segment_start_time|. | 69 // starting at |media_segment_start_time|. |
| 70 // TODO(acolwell/wolenetz): This should be changed to a presentation | 70 // TODO(acolwell/wolenetz): This should be changed to a presentation |
| 71 // timestamp. See http://crbug.com/402502 | 71 // timestamp. See http://crbug.com/402502 |
| 72 void OnNewMediaSegment(DecodeTimestamp media_segment_start_time); | 72 void OnNewMediaSegment(DecodeTimestamp media_segment_start_time); |
| 73 | 73 |
| (...skipping 247 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 // Callback used to report log messages that can help the web developer figure | 331 // Used to report log messages that can help the web developer figure out what |
| 332 // out what is wrong with the content. | 332 // is wrong with the content. |
| 333 LogCB log_cb_; | 333 scoped_refptr<MediaLog> media_log_; |
| 334 | 334 |
| 335 // List of disjoint buffered ranges, ordered by start time. | 335 // List of disjoint buffered ranges, ordered by start time. |
| 336 RangeList ranges_; | 336 RangeList ranges_; |
| 337 | 337 |
| 338 // Indicates which decoder config is being used by the decoder. | 338 // Indicates which decoder config is being used by the decoder. |
| 339 // GetNextBuffer() is only allows to return buffers that have a | 339 // GetNextBuffer() is only allows to return buffers that have a |
| 340 // config ID that matches this index. If there is a mismatch then | 340 // config ID that matches this index. If there is a mismatch then |
| 341 // it must signal that a config change is needed. | 341 // it must signal that a config change is needed. |
| 342 int current_config_index_; | 342 int current_config_index_; |
| 343 | 343 |
| (...skipping 68 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 412 // Indicates which of the splice buffers in |splice_buffer_| should be | 412 // Indicates which of the splice buffers in |splice_buffer_| should be |
| 413 // handled out next. | 413 // handled out next. |
| 414 size_t splice_buffers_index_; | 414 size_t splice_buffers_index_; |
| 415 | 415 |
| 416 // Indicates that all buffers before |pending_buffer_| have been handed out. | 416 // Indicates that all buffers before |pending_buffer_| have been handed out. |
| 417 bool pending_buffers_complete_; | 417 bool pending_buffers_complete_; |
| 418 | 418 |
| 419 // Indicates that splice frame generation is enabled. | 419 // Indicates that splice frame generation is enabled. |
| 420 const bool splice_frames_enabled_; | 420 const bool splice_frames_enabled_; |
| 421 | 421 |
| 422 // Fields supporting statistics reporting for audio splice frame generation. | |
|
wolenetz
2015/07/13 22:25:29
Oops! These were from a CL I'll send later that de
| |
| 423 // TODO(wolenetz,chcunningham): Once multi-track audio is enabled, report | |
| 424 // these statistics to chrome://media-internals per track. | |
| 425 int audio_splice_count_; | |
| 426 double total_audio_splice_duration_; | |
| 427 double min_audio_splice_duration_; | |
| 428 double max_audio_splice_duration_; | |
| 429 | |
| 422 DISALLOW_COPY_AND_ASSIGN(SourceBufferStream); | 430 DISALLOW_COPY_AND_ASSIGN(SourceBufferStream); |
| 423 }; | 431 }; |
| 424 | 432 |
| 425 } // namespace media | 433 } // namespace media |
| 426 | 434 |
| 427 #endif // MEDIA_FILTERS_SOURCE_BUFFER_STREAM_H_ | 435 #endif // MEDIA_FILTERS_SOURCE_BUFFER_STREAM_H_ |
| OLD | NEW |