| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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/base/audio_renderer_mixer_input.h" | 5 #include "media/base/audio_renderer_mixer_input.h" |
| 6 | 6 |
| 7 #include <cmath> | 7 #include <cmath> |
| 8 | 8 |
| 9 #include "base/bind.h" | 9 #include "base/bind.h" |
| 10 #include "base/callback_helpers.h" | 10 #include "base/callback_helpers.h" |
| (...skipping 90 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 101 mixer_->RemoveMixerInput(params_, this); | 101 mixer_->RemoveMixerInput(params_, this); |
| 102 playing_ = false; | 102 playing_ = false; |
| 103 } | 103 } |
| 104 | 104 |
| 105 bool AudioRendererMixerInput::SetVolume(double volume) { | 105 bool AudioRendererMixerInput::SetVolume(double volume) { |
| 106 base::AutoLock auto_lock(volume_lock_); | 106 base::AutoLock auto_lock(volume_lock_); |
| 107 volume_ = volume; | 107 volume_ = volume; |
| 108 return true; | 108 return true; |
| 109 } | 109 } |
| 110 | 110 |
| 111 OutputDeviceInfo AudioRendererMixerInput::GetOutputDeviceInfo() { | 111 OutputDeviceInfo AudioRendererMixerInput::GetOutputDeviceInfo( |
| 112 const AudioParameters& preferred_params) { |
| 112 return mixer_ | 113 return mixer_ |
| 113 ? mixer_->GetOutputDeviceInfo() | 114 ? mixer_->GetOutputDeviceInfo() |
| 114 : mixer_pool_->GetOutputDeviceInfo(owner_id_, 0 /* session_id */, | 115 : mixer_pool_->GetOutputDeviceInfo(owner_id_, 0 /* session_id */, |
| 115 device_id_, security_origin_); | 116 device_id_, security_origin_); |
| 116 } | 117 } |
| 117 | 118 |
| 118 bool AudioRendererMixerInput::CurrentThreadIsRenderingThread() { | 119 bool AudioRendererMixerInput::CurrentThreadIsRenderingThread() { |
| 119 return mixer_->CurrentThreadIsRenderingThread(); | 120 return mixer_->CurrentThreadIsRenderingThread(); |
| 120 } | 121 } |
| 121 | 122 |
| (...skipping 66 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 188 base::AutoLock auto_lock(volume_lock_); | 189 base::AutoLock auto_lock(volume_lock_); |
| 189 return frames_filled > 0 ? volume_ : 0; | 190 return frames_filled > 0 ? volume_ : 0; |
| 190 } | 191 } |
| 191 } | 192 } |
| 192 | 193 |
| 193 void AudioRendererMixerInput::OnRenderError() { | 194 void AudioRendererMixerInput::OnRenderError() { |
| 194 callback_->OnRenderError(); | 195 callback_->OnRenderError(); |
| 195 } | 196 } |
| 196 | 197 |
| 197 } // namespace media | 198 } // namespace media |
| OLD | NEW |