| 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 <limits> | 8 #include <limits> |
| 8 | 9 |
| 9 #include "base/bind.h" | 10 #include "base/bind.h" |
| 10 #include "base/callback.h" | 11 #include "base/callback.h" |
| 11 #include "base/callback_helpers.h" | 12 #include "base/callback_helpers.h" |
| 12 #include "base/float_util.h" | |
| 13 #include "media/filters/chunk_demuxer.h" | 13 #include "media/filters/chunk_demuxer.h" |
| 14 #include "third_party/WebKit/public/platform/WebSourceBufferClient.h" | 14 #include "third_party/WebKit/public/platform/WebSourceBufferClient.h" |
| 15 | 15 |
| 16 namespace media { | 16 namespace media { |
| 17 | 17 |
| 18 static base::TimeDelta DoubleToTimeDelta(double time) { | 18 static base::TimeDelta DoubleToTimeDelta(double time) { |
| 19 DCHECK(!base::IsNaN(time)); | 19 DCHECK(!std::isnan(time)); |
| 20 DCHECK_NE(time, -std::numeric_limits<double>::infinity()); | 20 DCHECK_NE(time, -std::numeric_limits<double>::infinity()); |
| 21 | 21 |
| 22 if (time == std::numeric_limits<double>::infinity()) | 22 if (time == std::numeric_limits<double>::infinity()) |
| 23 return kInfiniteDuration(); | 23 return kInfiniteDuration(); |
| 24 | 24 |
| 25 // Don't use base::TimeDelta::Max() here, as we want the largest finite time | 25 // Don't use base::TimeDelta::Max() here, as we want the largest finite time |
| 26 // delta. | 26 // delta. |
| 27 base::TimeDelta max_time = base::TimeDelta::FromInternalValue(kint64max - 1); | 27 base::TimeDelta max_time = base::TimeDelta::FromInternalValue(kint64max - 1); |
| 28 double max_time_in_seconds = max_time.InSecondsF(); | 28 double max_time_in_seconds = max_time.InSecondsF(); |
| 29 | 29 |
| (...skipping 115 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 145 demuxer_ = NULL; | 145 demuxer_ = NULL; |
| 146 client_ = NULL; | 146 client_ = NULL; |
| 147 } | 147 } |
| 148 | 148 |
| 149 void WebSourceBufferImpl::InitSegmentReceived() { | 149 void WebSourceBufferImpl::InitSegmentReceived() { |
| 150 DVLOG(1) << __FUNCTION__; | 150 DVLOG(1) << __FUNCTION__; |
| 151 client_->initializationSegmentReceived(); | 151 client_->initializationSegmentReceived(); |
| 152 } | 152 } |
| 153 | 153 |
| 154 } // namespace media | 154 } // namespace media |
| OLD | NEW |