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

Side by Side Diff: content/renderer/media/websourcebuffer_impl.cc

Issue 178153004: Enable round-tripping and updating of WebSourceBufferImpl timestamp offset (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Rebase and rework to plumb double* timestamp_offset param into SourceState. Created 6 years, 9 months 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 | Annotate | Revision Log
« no previous file with comments | « content/renderer/media/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 "content/renderer/media/websourcebuffer_impl.h" 5 #include "content/renderer/media/websourcebuffer_impl.h"
6 6
7 #include "base/float_util.h" 7 #include "base/float_util.h"
8 #include "media/filters/chunk_demuxer.h" 8 #include "media/filters/chunk_demuxer.h"
9 9
10 namespace content { 10 namespace content {
(...skipping 42 matching lines...) Expand 10 before | Expand all | Expand 10 after
53 media::Ranges<base::TimeDelta> ranges = demuxer_->GetBufferedRanges(id_); 53 media::Ranges<base::TimeDelta> ranges = demuxer_->GetBufferedRanges(id_);
54 blink::WebTimeRanges result(ranges.size()); 54 blink::WebTimeRanges result(ranges.size());
55 for (size_t i = 0; i < ranges.size(); i++) { 55 for (size_t i = 0; i < ranges.size(); i++) {
56 result[i].start = ranges.start(i).InSecondsF(); 56 result[i].start = ranges.start(i).InSecondsF();
57 result[i].end = ranges.end(i).InSecondsF(); 57 result[i].end = ranges.end(i).InSecondsF();
58 } 58 }
59 return result; 59 return result;
60 } 60 }
61 61
62 void WebSourceBufferImpl::append(const unsigned char* data, unsigned length) { 62 void WebSourceBufferImpl::append(const unsigned char* data, unsigned length) {
63 demuxer_->AppendData(id_, data, length); 63 append(data, length, NULL);
64 }
65
66 void WebSourceBufferImpl::append(
67 const unsigned char* data,
68 unsigned length,
69 double* timestamp_offset) {
70 demuxer_->AppendData(id_, data, length, timestamp_offset);
64 } 71 }
65 72
66 void WebSourceBufferImpl::abort() { 73 void WebSourceBufferImpl::abort() {
67 demuxer_->Abort(id_); 74 demuxer_->Abort(id_);
68 } 75 }
69 76
70 void WebSourceBufferImpl::remove(double start, double end) { 77 void WebSourceBufferImpl::remove(double start, double end) {
71 demuxer_->Remove(id_, DoubleToTimeDelta(start), DoubleToTimeDelta(end)); 78 demuxer_->Remove(id_, DoubleToTimeDelta(start), DoubleToTimeDelta(end));
72 } 79 }
73 80
(...skipping 10 matching lines...) Expand all
84 void WebSourceBufferImpl::setAppendWindowEnd(double end) { 91 void WebSourceBufferImpl::setAppendWindowEnd(double end) {
85 demuxer_->SetAppendWindowEnd(id_, DoubleToTimeDelta(end)); 92 demuxer_->SetAppendWindowEnd(id_, DoubleToTimeDelta(end));
86 } 93 }
87 94
88 void WebSourceBufferImpl::removedFromMediaSource() { 95 void WebSourceBufferImpl::removedFromMediaSource() {
89 demuxer_->RemoveId(id_); 96 demuxer_->RemoveId(id_);
90 demuxer_ = NULL; 97 demuxer_ = NULL;
91 } 98 }
92 99
93 } // namespace content 100 } // namespace content
OLDNEW
« no previous file with comments | « content/renderer/media/websourcebuffer_impl.h ('k') | media/filters/chunk_demuxer.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698