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 <cmath> | 7 #include <cmath> |
8 #include <limits> | 8 #include <limits> |
9 | 9 |
10 #include "base/bind.h" | 10 #include "base/bind.h" |
(...skipping 63 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
74 blink::WebTimeRanges WebSourceBufferImpl::buffered() { | 74 blink::WebTimeRanges WebSourceBufferImpl::buffered() { |
75 Ranges<base::TimeDelta> ranges = demuxer_->GetBufferedRanges(id_); | 75 Ranges<base::TimeDelta> ranges = demuxer_->GetBufferedRanges(id_); |
76 blink::WebTimeRanges result(ranges.size()); | 76 blink::WebTimeRanges result(ranges.size()); |
77 for (size_t i = 0; i < ranges.size(); i++) { | 77 for (size_t i = 0; i < ranges.size(); i++) { |
78 result[i].start = ranges.start(i).InSecondsF(); | 78 result[i].start = ranges.start(i).InSecondsF(); |
79 result[i].end = ranges.end(i).InSecondsF(); | 79 result[i].end = ranges.end(i).InSecondsF(); |
80 } | 80 } |
81 return result; | 81 return result; |
82 } | 82 } |
83 | 83 |
84 bool WebSourceBufferImpl::evictCodedFrames(double currentPlaybackTime, | |
85 size_t newDataSize) { | |
wolenetz
2015/08/12 21:09:57
newDataSize is unused. Please provide comment in c
wolenetz
2015/08/12 21:13:26
Hmm. disregard the TODO/bug request. There is noth
servolk
2015/08/13 00:31:42
I was actually hoping to use the newDataSize to de
servolk
2015/08/20 02:45:27
Update: I've implemented the logic described above
wolenetz
2015/08/20 23:23:37
Oops. There is actually spec line-item in the code
servolk
2015/08/21 01:32:08
Yes, step 3 of 3.5.14
| |
86 return demuxer_->EvictCodedFrames( | |
87 base::TimeDelta::FromSecondsD(currentPlaybackTime)); | |
88 } | |
89 | |
84 void WebSourceBufferImpl::append( | 90 void WebSourceBufferImpl::append( |
85 const unsigned char* data, | 91 const unsigned char* data, |
86 unsigned length, | 92 unsigned length, |
87 double* timestamp_offset) { | 93 double* timestamp_offset) { |
88 base::TimeDelta old_offset = timestamp_offset_; | 94 base::TimeDelta old_offset = timestamp_offset_; |
89 demuxer_->AppendData(id_, data, length, | 95 demuxer_->AppendData(id_, data, length, |
90 append_window_start_, append_window_end_, | 96 append_window_start_, append_window_end_, |
91 ×tamp_offset_, | 97 ×tamp_offset_, |
92 base::Bind(&WebSourceBufferImpl::InitSegmentReceived, | 98 base::Bind(&WebSourceBufferImpl::InitSegmentReceived, |
93 base::Unretained(this))); | 99 base::Unretained(this))); |
(...skipping 51 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
145 demuxer_ = NULL; | 151 demuxer_ = NULL; |
146 client_ = NULL; | 152 client_ = NULL; |
147 } | 153 } |
148 | 154 |
149 void WebSourceBufferImpl::InitSegmentReceived() { | 155 void WebSourceBufferImpl::InitSegmentReceived() { |
150 DVLOG(1) << __FUNCTION__; | 156 DVLOG(1) << __FUNCTION__; |
151 client_->initializationSegmentReceived(); | 157 client_->initializationSegmentReceived(); |
152 } | 158 } |
153 | 159 |
154 } // namespace media | 160 } // namespace media |
OLD | NEW |