| 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 #include <sstream> | 9 #include <sstream> |
| 10 #include <string> | 10 #include <string> |
| (...skipping 1292 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1303 SourceBufferStream::Status SourceBufferStream::GetNextBufferInternal( | 1303 SourceBufferStream::Status SourceBufferStream::GetNextBufferInternal( |
| 1304 scoped_refptr<StreamParserBuffer>* out_buffer) { | 1304 scoped_refptr<StreamParserBuffer>* out_buffer) { |
| 1305 CHECK(!config_change_pending_); | 1305 CHECK(!config_change_pending_); |
| 1306 | 1306 |
| 1307 if (!track_buffer_.empty()) { | 1307 if (!track_buffer_.empty()) { |
| 1308 DCHECK(!selected_range_); | 1308 DCHECK(!selected_range_); |
| 1309 scoped_refptr<StreamParserBuffer>& next_buffer = track_buffer_.front(); | 1309 scoped_refptr<StreamParserBuffer>& next_buffer = track_buffer_.front(); |
| 1310 | 1310 |
| 1311 // If the next buffer is an audio splice frame, the next effective config id | 1311 // If the next buffer is an audio splice frame, the next effective config id |
| 1312 // comes from the first splice buffer. | 1312 // comes from the first splice buffer. |
| 1313 if (next_buffer->GetSpliceBufferConfigId(0) != current_config_index_) { | 1313 if (next_buffer->GetConfigId() != current_config_index_) { |
| 1314 config_change_pending_ = true; | 1314 config_change_pending_ = true; |
| 1315 DVLOG(1) << "Config change (track buffer config ID does not match)."; | 1315 DVLOG(1) << "Config change (track buffer config ID does not match)."; |
| 1316 return kConfigChange; | 1316 return kConfigChange; |
| 1317 } | 1317 } |
| 1318 | 1318 |
| 1319 DVLOG(3) << __func__ << " Next buffer coming from track_buffer_"; | 1319 DVLOG(3) << __func__ << " Next buffer coming from track_buffer_"; |
| 1320 *out_buffer = next_buffer; | 1320 *out_buffer = next_buffer; |
| 1321 track_buffer_.pop_front(); | 1321 track_buffer_.pop_front(); |
| 1322 WarnIfTrackBufferExhaustionSkipsForward(*out_buffer); | 1322 WarnIfTrackBufferExhaustionSkipsForward(*out_buffer); |
| 1323 last_output_buffer_timestamp_ = (*out_buffer)->GetDecodeTimestamp(); | 1323 last_output_buffer_timestamp_ = (*out_buffer)->GetDecodeTimestamp(); |
| (...skipping 260 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1584 DVLOG(2) << "New video config - index: " << append_config_index_; | 1584 DVLOG(2) << "New video config - index: " << append_config_index_; |
| 1585 video_configs_.resize(video_configs_.size() + 1); | 1585 video_configs_.resize(video_configs_.size() + 1); |
| 1586 video_configs_[append_config_index_] = config; | 1586 video_configs_[append_config_index_] = config; |
| 1587 return true; | 1587 return true; |
| 1588 } | 1588 } |
| 1589 | 1589 |
| 1590 void SourceBufferStream::CompleteConfigChange() { | 1590 void SourceBufferStream::CompleteConfigChange() { |
| 1591 config_change_pending_ = false; | 1591 config_change_pending_ = false; |
| 1592 | 1592 |
| 1593 if (!track_buffer_.empty()) { | 1593 if (!track_buffer_.empty()) { |
| 1594 current_config_index_ = track_buffer_.front()->GetSpliceBufferConfigId(0); | 1594 current_config_index_ = track_buffer_.front()->GetConfigId(); |
| 1595 return; | 1595 return; |
| 1596 } | 1596 } |
| 1597 | 1597 |
| 1598 if (selected_range_ && selected_range_->HasNextBuffer()) | 1598 if (selected_range_ && selected_range_->HasNextBuffer()) |
| 1599 current_config_index_ = selected_range_->GetNextConfigId(); | 1599 current_config_index_ = selected_range_->GetNextConfigId(); |
| 1600 } | 1600 } |
| 1601 | 1601 |
| 1602 void SourceBufferStream::SetSelectedRangeIfNeeded( | 1602 void SourceBufferStream::SetSelectedRangeIfNeeded( |
| 1603 const DecodeTimestamp timestamp) { | 1603 const DecodeTimestamp timestamp) { |
| 1604 DVLOG(2) << __func__ << " " << GetStreamTypeName() << "(" | 1604 DVLOG(2) << __func__ << " " << GetStreamTypeName() << "(" |
| (...skipping 140 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1745 | 1745 |
| 1746 if (!have_preroll_buffer) | 1746 if (!have_preroll_buffer) |
| 1747 return false; | 1747 return false; |
| 1748 | 1748 |
| 1749 pending_buffer_.swap(*out_buffer); | 1749 pending_buffer_.swap(*out_buffer); |
| 1750 pending_buffers_complete_ = false; | 1750 pending_buffers_complete_ = false; |
| 1751 return true; | 1751 return true; |
| 1752 } | 1752 } |
| 1753 | 1753 |
| 1754 } // namespace media | 1754 } // namespace media |
| OLD | NEW |