| 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 40 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 51 kEndOfStream | 51 kEndOfStream |
| 52 }; | 52 }; |
| 53 | 53 |
| 54 enum Type { | 54 enum Type { |
| 55 kAudio, | 55 kAudio, |
| 56 kVideo, | 56 kVideo, |
| 57 kText | 57 kText |
| 58 }; | 58 }; |
| 59 | 59 |
| 60 SourceBufferStream(const AudioDecoderConfig& audio_config, | 60 SourceBufferStream(const AudioDecoderConfig& audio_config, |
| 61 const scoped_refptr<MediaLog>& media_log); | 61 MediaLog* media_log); |
| 62 SourceBufferStream(const VideoDecoderConfig& video_config, | 62 SourceBufferStream(const VideoDecoderConfig& video_config, |
| 63 const scoped_refptr<MediaLog>& media_log); | 63 MediaLog* media_log); |
| 64 SourceBufferStream(const TextTrackConfig& text_config, | 64 SourceBufferStream(const TextTrackConfig& text_config, MediaLog* media_log); |
| 65 const scoped_refptr<MediaLog>& media_log); | |
| 66 | 65 |
| 67 ~SourceBufferStream(); | 66 ~SourceBufferStream(); |
| 68 | 67 |
| 69 // Signals that the next buffers appended are part of a new coded frame group | 68 // Signals that the next buffers appended are part of a new coded frame group |
| 70 // starting at |coded_frame_group_start_time|. | 69 // starting at |coded_frame_group_start_time|. |
| 71 // TODO(acolwell/wolenetz): This should be changed to a presentation | 70 // TODO(acolwell/wolenetz): This should be changed to a presentation |
| 72 // timestamp. See http://crbug.com/402502 | 71 // timestamp. See http://crbug.com/402502 |
| 73 void OnStartOfCodedFrameGroup(DecodeTimestamp coded_frame_group_start_time); | 72 void OnStartOfCodedFrameGroup(DecodeTimestamp coded_frame_group_start_time); |
| 74 | 73 |
| 75 // Add the |buffers| to the SourceBufferStream. Buffers within the queue are | 74 // Add the |buffers| to the SourceBufferStream. Buffers within the queue are |
| (...skipping 287 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 363 // current playback position. | 362 // current playback position. |
| 364 void WarnIfTrackBufferExhaustionSkipsForward( | 363 void WarnIfTrackBufferExhaustionSkipsForward( |
| 365 const scoped_refptr<StreamParserBuffer>& next_buffer); | 364 const scoped_refptr<StreamParserBuffer>& next_buffer); |
| 366 | 365 |
| 367 // If |out_buffer| has preroll, sets |pending_buffer_| to feed out preroll and | 366 // If |out_buffer| has preroll, sets |pending_buffer_| to feed out preroll and |
| 368 // returns true. Otherwise returns false. | 367 // returns true. Otherwise returns false. |
| 369 bool SetPendingBuffer(scoped_refptr<StreamParserBuffer>* out_buffer); | 368 bool SetPendingBuffer(scoped_refptr<StreamParserBuffer>* out_buffer); |
| 370 | 369 |
| 371 // Used to report log messages that can help the web developer figure out what | 370 // Used to report log messages that can help the web developer figure out what |
| 372 // is wrong with the content. | 371 // is wrong with the content. |
| 373 scoped_refptr<MediaLog> media_log_; | 372 MediaLog* media_log_; |
| 374 | 373 |
| 375 // List of disjoint buffered ranges, ordered by start time. | 374 // List of disjoint buffered ranges, ordered by start time. |
| 376 RangeList ranges_; | 375 RangeList ranges_; |
| 377 | 376 |
| 378 // Indicates which decoder config is being used by the decoder. | 377 // Indicates which decoder config is being used by the decoder. |
| 379 // GetNextBuffer() is only allows to return buffers that have a | 378 // GetNextBuffer() is only allows to return buffers that have a |
| 380 // config ID that matches this index. If there is a mismatch then | 379 // config ID that matches this index. If there is a mismatch then |
| 381 // it must signal that a config change is needed. | 380 // it must signal that a config change is needed. |
| 382 int current_config_index_ = 0; | 381 int current_config_index_ = 0; |
| 383 | 382 |
| (...skipping 82 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 466 int num_track_buffer_gap_warning_logs_ = 0; | 465 int num_track_buffer_gap_warning_logs_ = 0; |
| 467 int num_garbage_collect_algorithm_logs_ = 0; | 466 int num_garbage_collect_algorithm_logs_ = 0; |
| 468 int num_strange_same_timestamps_logs_ = 0; | 467 int num_strange_same_timestamps_logs_ = 0; |
| 469 | 468 |
| 470 DISALLOW_COPY_AND_ASSIGN(SourceBufferStream); | 469 DISALLOW_COPY_AND_ASSIGN(SourceBufferStream); |
| 471 }; | 470 }; |
| 472 | 471 |
| 473 } // namespace media | 472 } // namespace media |
| 474 | 473 |
| 475 #endif // MEDIA_FILTERS_SOURCE_BUFFER_STREAM_H_ | 474 #endif // MEDIA_FILTERS_SOURCE_BUFFER_STREAM_H_ |
| OLD | NEW |