Chromium Code Reviews| Index: chromecast/media/cma/backend/alsa/stream_mixer_alsa_input_impl.cc |
| diff --git a/chromecast/media/cma/backend/alsa/stream_mixer_alsa_input_impl.cc b/chromecast/media/cma/backend/alsa/stream_mixer_alsa_input_impl.cc |
| index 656130bed534469bea6c3c3510c2195860853d9d..1ae5cc6688edaedc83f110855f80ec6fb8a17043 100644 |
| --- a/chromecast/media/cma/backend/alsa/stream_mixer_alsa_input_impl.cc |
| +++ b/chromecast/media/cma/backend/alsa/stream_mixer_alsa_input_impl.cc |
| @@ -65,10 +65,12 @@ StreamMixerAlsaInputImpl::StreamMixerAlsaInputImpl( |
| StreamMixerAlsaInput::Delegate* delegate, |
| int input_samples_per_second, |
| bool primary, |
| + std::string name, |
|
wzhong
2017/02/21 16:03:46
ditto.
bshaya
2017/02/21 23:30:14
Done.
|
| StreamMixerAlsa* mixer) |
| : delegate_(delegate), |
| input_samples_per_second_(input_samples_per_second), |
| primary_(primary), |
| + name_(name), |
| mixer_(mixer), |
| mixer_task_runner_(mixer_->task_runner()), |
| caller_task_runner_(base::ThreadTaskRunnerHandle::Get()), |
| @@ -85,14 +87,14 @@ StreamMixerAlsaInputImpl::StreamMixerAlsaInputImpl( |
| zeroed_frames_(0), |
| is_underflowing_(false), |
| weak_factory_(this) { |
| - LOG(INFO) << "Create " << this; |
| + LOG(INFO) << "Create " << name_ << " (" << this << ")"; |
| DCHECK(delegate_); |
| DCHECK(mixer_); |
| weak_this_ = weak_factory_.GetWeakPtr(); |
| } |
| StreamMixerAlsaInputImpl::~StreamMixerAlsaInputImpl() { |
| - LOG(INFO) << "Destroy " << this; |
| + LOG(INFO) << "Destroy " << name_ << " (" << this << ")"; |
| DCHECK(mixer_task_runner_->BelongsToCurrentThread()); |
| } |
| @@ -104,6 +106,10 @@ bool StreamMixerAlsaInputImpl::primary() const { |
| return primary_; |
| } |
| +std::string StreamMixerAlsaInputImpl::name() const { |
| + return name_; |
| +} |
| + |
| bool StreamMixerAlsaInputImpl::IsDeleting() const { |
| DCHECK(mixer_task_runner_->BelongsToCurrentThread()); |
| return (state_ == kStateFinalFade || state_ == kStateDeleted); |
| @@ -426,7 +432,6 @@ int StreamMixerAlsaInputImpl::NormalFadeFrames() { |
| void StreamMixerAlsaInputImpl::FadeIn(::media::AudioBus* dest, int frames) { |
| DCHECK(mixer_task_runner_->BelongsToCurrentThread()); |
| - LOG(INFO) << "Fading in, " << fade_frames_remaining_ << " frames remaining"; |
| float fade_in_frames = mixer_->output_samples_per_second() * kFadeMs / |
| base::Time::kMillisecondsPerSecond; |
| for (int f = 0; f < frames && fade_frames_remaining_; ++f) { |
| @@ -439,7 +444,6 @@ void StreamMixerAlsaInputImpl::FadeIn(::media::AudioBus* dest, int frames) { |
| void StreamMixerAlsaInputImpl::FadeOut(::media::AudioBus* dest, int frames) { |
| DCHECK(mixer_task_runner_->BelongsToCurrentThread()); |
| - LOG(INFO) << "Fading out, " << fade_frames_remaining_ << " frames remaining"; |
| int f = 0; |
| for (; f < frames && fade_frames_remaining_; ++f) { |
| float fade_multiplier = |
| @@ -515,7 +519,7 @@ void StreamMixerAlsaInputImpl::SetPaused(bool paused) { |
| void StreamMixerAlsaInputImpl::SetVolumeMultiplier(float multiplier) { |
| RUN_ON_MIXER_THREAD(SetVolumeMultiplier, multiplier); |
| - LOG(INFO) << this << ": stream volume = " << multiplier; |
| + LOG(INFO) << name_ << "(" << this << "): stream volume = " << multiplier; |
| DCHECK(!IsDeleting()); |
| if (multiplier > 1.0f) |
| multiplier = 1.0f; |