| 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 "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 54 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 65 | 65 |
| 66 void WebSourceBufferImpl::abort() { | 66 void WebSourceBufferImpl::abort() { |
| 67 demuxer_->Abort(id_); | 67 demuxer_->Abort(id_); |
| 68 } | 68 } |
| 69 | 69 |
| 70 void WebSourceBufferImpl::remove(double start, double end) { | 70 void WebSourceBufferImpl::remove(double start, double end) { |
| 71 demuxer_->Remove(id_, DoubleToTimeDelta(start), DoubleToTimeDelta(end)); | 71 demuxer_->Remove(id_, DoubleToTimeDelta(start), DoubleToTimeDelta(end)); |
| 72 } | 72 } |
| 73 | 73 |
| 74 bool WebSourceBufferImpl::setTimestampOffset(double offset) { | 74 bool WebSourceBufferImpl::setTimestampOffset(double offset) { |
| 75 base::TimeDelta time_offset = base::TimeDelta::FromMicroseconds( | 75 return demuxer_->SetTimestampOffset(id_, offset); |
| 76 offset * base::Time::kMicrosecondsPerSecond); | 76 } |
| 77 return demuxer_->SetTimestampOffset(id_, time_offset); | 77 |
| 78 double WebSourceBufferImpl::getTimestampOffset() { |
| 79 return demuxer_->GetTimestampOffset(id_); |
| 78 } | 80 } |
| 79 | 81 |
| 80 void WebSourceBufferImpl::setAppendWindowStart(double start) { | 82 void WebSourceBufferImpl::setAppendWindowStart(double start) { |
| 81 demuxer_->SetAppendWindowStart(id_, DoubleToTimeDelta(start)); | 83 demuxer_->SetAppendWindowStart(id_, DoubleToTimeDelta(start)); |
| 82 } | 84 } |
| 83 | 85 |
| 84 void WebSourceBufferImpl::setAppendWindowEnd(double end) { | 86 void WebSourceBufferImpl::setAppendWindowEnd(double end) { |
| 85 demuxer_->SetAppendWindowEnd(id_, DoubleToTimeDelta(end)); | 87 demuxer_->SetAppendWindowEnd(id_, DoubleToTimeDelta(end)); |
| 86 } | 88 } |
| 87 | 89 |
| 88 void WebSourceBufferImpl::removedFromMediaSource() { | 90 void WebSourceBufferImpl::removedFromMediaSource() { |
| 89 demuxer_->RemoveId(id_); | 91 demuxer_->RemoveId(id_); |
| 90 demuxer_ = NULL; | 92 demuxer_ = NULL; |
| 91 } | 93 } |
| 92 | 94 |
| 93 } // namespace content | 95 } // namespace content |
| OLD | NEW |