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 "chromecast/media/cma/backend/alsa/stream_mixer_alsa_input_impl.h" | 5 #include "chromecast/media/cma/backend/alsa/stream_mixer_alsa_input_impl.h" |
6 | 6 |
7 #include <algorithm> | 7 #include <algorithm> |
8 #include <limits> | 8 #include <limits> |
9 | 9 |
10 #include "base/bind.h" | 10 #include "base/bind.h" |
(...skipping 217 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
228 DCHECK(!IsDeleting()); | 228 DCHECK(!IsDeleting()); |
229 if (end_of_stream) { | 229 if (end_of_stream) { |
230 LOG(INFO) << "End of stream for " << this; | 230 LOG(INFO) << "End of stream for " << this; |
231 state_ = kStateGotEos; | 231 state_ = kStateGotEos; |
232 } else if (state_ == kStateUninitialized) { | 232 } else if (state_ == kStateUninitialized) { |
233 state_ = kStateNormalPlayback; | 233 state_ = kStateNormalPlayback; |
234 } | 234 } |
235 mixer_->OnFramesQueued(); | 235 mixer_->OnFramesQueued(); |
236 } | 236 } |
237 | 237 |
| 238 void StreamMixerAlsaInputImpl::OnSkipped() { |
| 239 DCHECK(mixer_task_runner_->BelongsToCurrentThread()); |
| 240 if (state_ == kStateNormalPlayback) { |
| 241 // Fade in once this input starts providing data again. |
| 242 fade_frames_remaining_ = NormalFadeFrames(); |
| 243 } |
| 244 } |
| 245 |
238 void StreamMixerAlsaInputImpl::AfterWriteFrames( | 246 void StreamMixerAlsaInputImpl::AfterWriteFrames( |
239 const MediaPipelineBackendAlsa::RenderingDelay& mixer_rendering_delay) { | 247 const MediaPipelineBackendAlsa::RenderingDelay& mixer_rendering_delay) { |
240 DCHECK(mixer_task_runner_->BelongsToCurrentThread()); | 248 DCHECK(mixer_task_runner_->BelongsToCurrentThread()); |
241 double resampler_queued_frames = | 249 double resampler_queued_frames = |
242 (resampler_ ? resampler_->BufferedFrames() : 0); | 250 (resampler_ ? resampler_->BufferedFrames() : 0); |
243 | 251 |
244 bool queued_more_data = false; | 252 bool queued_more_data = false; |
245 MediaPipelineBackendAlsa::RenderingDelay total_delay; | 253 MediaPipelineBackendAlsa::RenderingDelay total_delay; |
246 { | 254 { |
247 base::AutoLock lock(queue_lock_); | 255 base::AutoLock lock(queue_lock_); |
(...skipping 253 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
501 DCHECK(!IsDeleting()); | 509 DCHECK(!IsDeleting()); |
502 if (multiplier > 1.0f) | 510 if (multiplier > 1.0f) |
503 multiplier = 1.0f; | 511 multiplier = 1.0f; |
504 if (multiplier < 0.0f) | 512 if (multiplier < 0.0f) |
505 multiplier = 0.0f; | 513 multiplier = 0.0f; |
506 volume_multiplier_ = multiplier; | 514 volume_multiplier_ = multiplier; |
507 } | 515 } |
508 | 516 |
509 } // namespace media | 517 } // namespace media |
510 } // namespace chromecast | 518 } // namespace chromecast |
OLD | NEW |