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 <stdint.h> | 7 #include <stdint.h> |
8 | 8 |
9 #include <cmath> | 9 #include <cmath> |
10 #include <limits> | 10 #include <limits> |
11 | 11 |
12 #include "base/bind.h" | 12 #include "base/bind.h" |
13 #include "base/callback.h" | 13 #include "base/callback.h" |
14 #include "base/callback_helpers.h" | 14 #include "base/callback_helpers.h" |
15 #include "media/base/media_tracks.h" | |
15 #include "media/base/timestamp_constants.h" | 16 #include "media/base/timestamp_constants.h" |
16 #include "media/filters/chunk_demuxer.h" | 17 #include "media/filters/chunk_demuxer.h" |
17 #include "third_party/WebKit/public/platform/WebSourceBufferClient.h" | 18 #include "third_party/WebKit/public/platform/WebSourceBufferClient.h" |
18 | 19 |
19 namespace media { | 20 namespace media { |
20 | 21 |
21 static base::TimeDelta DoubleToTimeDelta(double time) { | 22 static base::TimeDelta DoubleToTimeDelta(double time) { |
22 DCHECK(!std::isnan(time)); | 23 DCHECK(!std::isnan(time)); |
23 DCHECK_NE(time, -std::numeric_limits<double>::infinity()); | 24 DCHECK_NE(time, -std::numeric_limits<double>::infinity()); |
24 | 25 |
(...skipping 126 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
151 DCHECK_GE(end, 0); | 152 DCHECK_GE(end, 0); |
152 append_window_end_ = DoubleToTimeDelta(end); | 153 append_window_end_ = DoubleToTimeDelta(end); |
153 } | 154 } |
154 | 155 |
155 void WebSourceBufferImpl::removedFromMediaSource() { | 156 void WebSourceBufferImpl::removedFromMediaSource() { |
156 demuxer_->RemoveId(id_); | 157 demuxer_->RemoveId(id_); |
157 demuxer_ = NULL; | 158 demuxer_ = NULL; |
158 client_ = NULL; | 159 client_ = NULL; |
159 } | 160 } |
160 | 161 |
161 void WebSourceBufferImpl::InitSegmentReceived() { | 162 void WebSourceBufferImpl::InitSegmentReceived(const MediaTracks& tracks) { |
162 DVLOG(1) << __FUNCTION__; | 163 DVLOG(1) << __FUNCTION__; |
163 client_->initializationSegmentReceived(); | 164 client_->initializationSegmentReceived(); |
wolenetz
2016/02/26 00:06:21
nit: if landing separately from the rest (as curre
servolk
2016/02/26 01:56:32
Done.
| |
164 } | 165 } |
165 | 166 |
166 } // namespace media | 167 } // namespace media |
OLD | NEW |