OLD | NEW |
1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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/blink/websourcebuffer_impl.h" | 5 #include "media/blink/websourcebuffer_impl.h" |
6 | 6 |
7 #include <stdint.h> | 7 #include <stdint.h> |
8 | 8 |
9 #include <cmath> | 9 #include <cmath> |
10 #include <limits> | 10 #include <limits> |
(...skipping 73 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
84 blink::WebTimeRanges WebSourceBufferImpl::buffered() { | 84 blink::WebTimeRanges WebSourceBufferImpl::buffered() { |
85 Ranges<base::TimeDelta> ranges = demuxer_->GetBufferedRanges(id_); | 85 Ranges<base::TimeDelta> ranges = demuxer_->GetBufferedRanges(id_); |
86 blink::WebTimeRanges result(ranges.size()); | 86 blink::WebTimeRanges result(ranges.size()); |
87 for (size_t i = 0; i < ranges.size(); i++) { | 87 for (size_t i = 0; i < ranges.size(); i++) { |
88 result[i].start = ranges.start(i).InSecondsF(); | 88 result[i].start = ranges.start(i).InSecondsF(); |
89 result[i].end = ranges.end(i).InSecondsF(); | 89 result[i].end = ranges.end(i).InSecondsF(); |
90 } | 90 } |
91 return result; | 91 return result; |
92 } | 92 } |
93 | 93 |
| 94 double WebSourceBufferImpl::highestPresentationTimestamp() { |
| 95 return demuxer_->GetHighestPresentationTimestamp(id_).InSecondsF(); |
| 96 } |
| 97 |
94 bool WebSourceBufferImpl::evictCodedFrames(double currentPlaybackTime, | 98 bool WebSourceBufferImpl::evictCodedFrames(double currentPlaybackTime, |
95 size_t newDataSize) { | 99 size_t newDataSize) { |
96 return demuxer_->EvictCodedFrames( | 100 return demuxer_->EvictCodedFrames( |
97 id_, | 101 id_, |
98 base::TimeDelta::FromSecondsD(currentPlaybackTime), | 102 base::TimeDelta::FromSecondsD(currentPlaybackTime), |
99 newDataSize); | 103 newDataSize); |
100 } | 104 } |
101 | 105 |
102 bool WebSourceBufferImpl::append(const unsigned char* data, | 106 bool WebSourceBufferImpl::append(const unsigned char* data, |
103 unsigned length, | 107 unsigned length, |
(...skipping 86 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
190 trackInfo.kind = blink::WebString::fromUTF8(track->kind()); | 194 trackInfo.kind = blink::WebString::fromUTF8(track->kind()); |
191 trackInfo.label = blink::WebString::fromUTF8(track->label()); | 195 trackInfo.label = blink::WebString::fromUTF8(track->label()); |
192 trackInfo.language = blink::WebString::fromUTF8(track->language()); | 196 trackInfo.language = blink::WebString::fromUTF8(track->language()); |
193 trackInfoVector.push_back(trackInfo); | 197 trackInfoVector.push_back(trackInfo); |
194 } | 198 } |
195 | 199 |
196 client_->initializationSegmentReceived(trackInfoVector); | 200 client_->initializationSegmentReceived(trackInfoVector); |
197 } | 201 } |
198 | 202 |
199 } // namespace media | 203 } // namespace media |
OLD | NEW |