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/chunk_demuxer.h" | 5 #include "media/filters/chunk_demuxer.h" |
6 | 6 |
7 #include <algorithm> | 7 #include <algorithm> |
8 #include <deque> | 8 #include <deque> |
9 | 9 |
10 #include "base/bind.h" | 10 #include "base/bind.h" |
(...skipping 1098 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1109 if (!video_->Append(buffers)) | 1109 if (!video_->Append(buffers)) |
1110 return false; | 1110 return false; |
1111 | 1111 |
1112 IncreaseDurationIfNecessary(buffers, video_); | 1112 IncreaseDurationIfNecessary(buffers, video_); |
1113 return true; | 1113 return true; |
1114 } | 1114 } |
1115 | 1115 |
1116 // TODO(acolwell): Remove bool from StreamParser::NeedKeyCB so that | 1116 // TODO(acolwell): Remove bool from StreamParser::NeedKeyCB so that |
1117 // this method can be removed and need_key_cb_ can be passed directly | 1117 // this method can be removed and need_key_cb_ can be passed directly |
1118 // to the parser. | 1118 // to the parser. |
1119 bool ChunkDemuxer::OnNeedKey(scoped_array<uint8> init_data, | 1119 bool ChunkDemuxer::OnNeedKey(const std::string& type, |
| 1120 scoped_array<uint8> init_data, |
1120 int init_data_size) { | 1121 int init_data_size) { |
1121 lock_.AssertAcquired(); | 1122 lock_.AssertAcquired(); |
1122 need_key_cb_.Run(init_data.Pass(), init_data_size); | 1123 need_key_cb_.Run(type, init_data.Pass(), init_data_size); |
1123 return true; | 1124 return true; |
1124 } | 1125 } |
1125 | 1126 |
1126 void ChunkDemuxer::OnNewMediaSegment(const std::string& source_id, | 1127 void ChunkDemuxer::OnNewMediaSegment(const std::string& source_id, |
1127 TimeDelta timestamp) { | 1128 TimeDelta timestamp) { |
1128 DCHECK(timestamp != kNoTimestamp()); | 1129 DCHECK(timestamp != kNoTimestamp()); |
1129 DVLOG(2) << "OnNewMediaSegment(" << source_id << ", " | 1130 DVLOG(2) << "OnNewMediaSegment(" << source_id << ", " |
1130 << timestamp.InSecondsF() << ")"; | 1131 << timestamp.InSecondsF() << ")"; |
1131 lock_.AssertAcquired(); | 1132 lock_.AssertAcquired(); |
1132 | 1133 |
(...skipping 66 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1199 | 1200 |
1200 Ranges<TimeDelta> ChunkDemuxer::GetBufferedRanges() const { | 1201 Ranges<TimeDelta> ChunkDemuxer::GetBufferedRanges() const { |
1201 if (audio_ && !video_) | 1202 if (audio_ && !video_) |
1202 return audio_->GetBufferedRanges(duration_); | 1203 return audio_->GetBufferedRanges(duration_); |
1203 else if (!audio_ && video_) | 1204 else if (!audio_ && video_) |
1204 return video_->GetBufferedRanges(duration_); | 1205 return video_->GetBufferedRanges(duration_); |
1205 return ComputeIntersection(); | 1206 return ComputeIntersection(); |
1206 } | 1207 } |
1207 | 1208 |
1208 } // namespace media | 1209 } // namespace media |
OLD | NEW |