| 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 #include "media/filters/source_buffer_stream.h" | 5 #include "media/filters/source_buffer_stream.h" |
| 6 | 6 |
| 7 #include <algorithm> | 7 #include <algorithm> |
| 8 #include <map> | 8 #include <map> |
| 9 | 9 |
| 10 #include "base/bind.h" | 10 #include "base/bind.h" |
| (...skipping 332 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 343 last_appended_buffer_timestamp_(kNoTimestamp()), | 343 last_appended_buffer_timestamp_(kNoTimestamp()), |
| 344 last_appended_buffer_is_keyframe_(false), | 344 last_appended_buffer_is_keyframe_(false), |
| 345 last_output_buffer_timestamp_(kNoTimestamp()), | 345 last_output_buffer_timestamp_(kNoTimestamp()), |
| 346 max_interbuffer_distance_(kNoTimestamp()), | 346 max_interbuffer_distance_(kNoTimestamp()), |
| 347 memory_limit_(kDefaultVideoMemoryLimit), | 347 memory_limit_(kDefaultVideoMemoryLimit), |
| 348 config_change_pending_(false) { | 348 config_change_pending_(false) { |
| 349 DCHECK(video_config.IsValidConfig()); | 349 DCHECK(video_config.IsValidConfig()); |
| 350 video_configs_.push_back(video_config); | 350 video_configs_.push_back(video_config); |
| 351 } | 351 } |
| 352 | 352 |
| 353 SourceBufferStream::SourceBufferStream(const LogCB& log_cb) |
| 354 : log_cb_(log_cb), |
| 355 current_config_index_(0), |
| 356 append_config_index_(0), |
| 357 seek_pending_(false), |
| 358 end_of_stream_(false), |
| 359 seek_buffer_timestamp_(kNoTimestamp()), |
| 360 selected_range_(NULL), |
| 361 media_segment_start_time_(kNoTimestamp()), |
| 362 range_for_next_append_(ranges_.end()), |
| 363 new_media_segment_(false), |
| 364 last_appended_buffer_timestamp_(kNoTimestamp()), |
| 365 last_appended_buffer_is_keyframe_(false), |
| 366 last_output_buffer_timestamp_(kNoTimestamp()), |
| 367 max_interbuffer_distance_(kNoTimestamp()), |
| 368 memory_limit_(kDefaultAudioMemoryLimit), |
| 369 config_change_pending_(false) { |
| 370 } |
| 371 |
| 353 SourceBufferStream::~SourceBufferStream() { | 372 SourceBufferStream::~SourceBufferStream() { |
| 354 while (!ranges_.empty()) { | 373 while (!ranges_.empty()) { |
| 355 delete ranges_.front(); | 374 delete ranges_.front(); |
| 356 ranges_.pop_front(); | 375 ranges_.pop_front(); |
| 357 } | 376 } |
| 358 } | 377 } |
| 359 | 378 |
| 360 void SourceBufferStream::OnNewMediaSegment( | 379 void SourceBufferStream::OnNewMediaSegment( |
| 361 base::TimeDelta media_segment_start_time) { | 380 base::TimeDelta media_segment_start_time) { |
| 362 DCHECK(!end_of_stream_); | 381 DCHECK(!end_of_stream_); |
| (...skipping 1587 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1950 return ComputeFudgeRoom(GetApproximateDuration()); | 1969 return ComputeFudgeRoom(GetApproximateDuration()); |
| 1951 } | 1970 } |
| 1952 | 1971 |
| 1953 base::TimeDelta SourceBufferRange::GetApproximateDuration() const { | 1972 base::TimeDelta SourceBufferRange::GetApproximateDuration() const { |
| 1954 base::TimeDelta max_interbuffer_distance = interbuffer_distance_cb_.Run(); | 1973 base::TimeDelta max_interbuffer_distance = interbuffer_distance_cb_.Run(); |
| 1955 DCHECK(max_interbuffer_distance != kNoTimestamp()); | 1974 DCHECK(max_interbuffer_distance != kNoTimestamp()); |
| 1956 return max_interbuffer_distance; | 1975 return max_interbuffer_distance; |
| 1957 } | 1976 } |
| 1958 | 1977 |
| 1959 } // namespace media | 1978 } // namespace media |
| OLD | NEW |