Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 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 <limits> | 5 #include <limits> |
| 6 #include <vector> | 6 #include <vector> |
| 7 | 7 |
| 8 #include "services/media/audio/audio_pipe.h" | 8 #include "services/media/audio/audio_pipe.h" |
| 9 #include "services/media/audio/audio_server_impl.h" | 9 #include "services/media/audio/audio_server_impl.h" |
| 10 #include "services/media/audio/audio_track_impl.h" | 10 #include "services/media/audio/audio_track_impl.h" |
| (...skipping 113 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 124 << AudioTrackImpl::PTS_FRACTIONAL_BITS); | 124 << AudioTrackImpl::PTS_FRACTIONAL_BITS); |
| 125 next_pts_ = start_pts + pts_delta; | 125 next_pts_ = start_pts + pts_delta; |
| 126 next_pts_known_ = true; | 126 next_pts_known_ = true; |
| 127 | 127 |
| 128 owner_->OnPacketReceived(AudioPacketRefPtr( | 128 owner_->OnPacketReceived(AudioPacketRefPtr( |
| 129 new AudioPacketRef(std::move(state), | 129 new AudioPacketRef(std::move(state), |
| 130 server_, | 130 server_, |
| 131 std::move(regions), | 131 std::move(regions), |
| 132 start_pts, | 132 start_pts, |
| 133 next_pts_))); | 133 next_pts_))); |
| 134 | |
| 135 if (!prime_callback_.is_null()) { | |
| 136 // Prime was requested. Call the callback to indicate priming is complete. | |
| 137 // TODO(dalesat): Don't do this until low water mark is reached. | |
|
kulakowski
2016/03/28 20:46:12
For my edification: What is priming? What is a "lo
dalesat
2016/03/28 22:19:56
Priming is getting some initial packets of content
kulakowski
2016/03/30 20:44:55
Gotcha. Couple more questions.
How is seeking dif
dalesat
2016/03/30 21:04:14
Content is typically authored such that the first
kulakowski
2016/03/31 21:32:12
It really does not seem to me that this is a singl
dalesat
2016/03/31 21:45:14
Sure. Is this a concern for this CL?
kulakowski
2016/03/31 22:43:34
Well if you have a TODO about it in the implementa
| |
| 138 prime_callback_.Run(); | |
| 139 prime_callback_.reset(); | |
| 140 } | |
| 141 } | |
| 142 | |
| 143 void AudioPipe::OnPrimeRequested(const PrimeCallback& cbk) { | |
| 144 if (!prime_callback_.is_null()) { | |
| 145 // Prime was already requested. Complete the old one and warn. | |
| 146 LOG(WARNING) << "multiple prime requests received"; | |
| 147 prime_callback_.Run(); | |
| 148 } | |
| 149 prime_callback_ = cbk; | |
| 134 } | 150 } |
| 135 | 151 |
| 136 bool AudioPipe::OnFlushRequested(const FlushCallback& cbk) { | 152 bool AudioPipe::OnFlushRequested(const FlushCallback& cbk) { |
| 137 DCHECK(owner_); | 153 DCHECK(owner_); |
| 138 next_pts_known_ = false; | 154 next_pts_known_ = false; |
| 139 return owner_->OnFlushRequested(cbk); | 155 return owner_->OnFlushRequested(cbk); |
| 140 } | 156 } |
| 141 | 157 |
| 142 } // namespace audio | 158 } // namespace audio |
| 143 } // namespace media | 159 } // namespace media |
| 144 } // namespace mojo | 160 } // namespace mojo |
| OLD | NEW |