Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(194)

Side by Side Diff: media/blink/websourcebuffer_impl.cc

Issue 794343003: Implement evictFrames() to support MSE's coded frame eviction algorithm. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Updated existing SourceBufferStream unittests Created 6 years ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « media/blink/websourcebuffer_impl.h ('k') | media/filters/chunk_demuxer.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 <limits> 7 #include <limits>
8 8
9 #include "base/bind.h" 9 #include "base/bind.h"
10 #include "base/callback.h" 10 #include "base/callback.h"
(...skipping 63 matching lines...) Expand 10 before | Expand all | Expand 10 after
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() {
85 return demuxer_->EvictFrames();
86 }
87
84 void WebSourceBufferImpl::append( 88 void WebSourceBufferImpl::append(
85 const unsigned char* data, 89 const unsigned char* data,
86 unsigned length, 90 unsigned length,
87 double* timestamp_offset) { 91 double* timestamp_offset) {
88 base::TimeDelta old_offset = timestamp_offset_; 92 base::TimeDelta old_offset = timestamp_offset_;
89 demuxer_->AppendData(id_, data, length, 93 demuxer_->AppendData(id_, data, length,
90 append_window_start_, append_window_end_, 94 append_window_start_, append_window_end_,
91 &timestamp_offset_, 95 &timestamp_offset_,
92 base::Bind(&WebSourceBufferImpl::InitSegmentReceived, 96 base::Bind(&WebSourceBufferImpl::InitSegmentReceived,
93 base::Unretained(this))); 97 base::Unretained(this)));
(...skipping 51 matching lines...) Expand 10 before | Expand all | Expand 10 after
145 demuxer_ = NULL; 149 demuxer_ = NULL;
146 client_ = NULL; 150 client_ = NULL;
147 } 151 }
148 152
149 void WebSourceBufferImpl::InitSegmentReceived() { 153 void WebSourceBufferImpl::InitSegmentReceived() {
150 DVLOG(1) << __FUNCTION__; 154 DVLOG(1) << __FUNCTION__;
151 client_->initializationSegmentReceived(); 155 client_->initializationSegmentReceived();
152 } 156 }
153 157
154 } // namespace media 158 } // namespace media
OLDNEW
« no previous file with comments | « media/blink/websourcebuffer_impl.h ('k') | media/filters/chunk_demuxer.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698