| 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 "content/renderer/media/audio_renderer_mixer_manager.h" | 5 #include "content/renderer/media/audio_renderer_mixer_manager.h" |
| 6 | 6 |
| 7 #include <algorithm> | 7 #include <algorithm> |
| 8 #include <string> | 8 #include <string> |
| 9 | 9 |
| 10 #include "base/bind.h" | 10 #include "base/bind.h" |
| (...skipping 183 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 194 sink->Stop(); | 194 sink->Stop(); |
| 195 return nullptr; | 195 return nullptr; |
| 196 } | 196 } |
| 197 | 197 |
| 198 const media::AudioParameters& mixer_output_params = | 198 const media::AudioParameters& mixer_output_params = |
| 199 GetMixerOutputParams(input_params, device_info.output_params(), latency); | 199 GetMixerOutputParams(input_params, device_info.output_params(), latency); |
| 200 media::AudioRendererMixer* mixer = new media::AudioRendererMixer( | 200 media::AudioRendererMixer* mixer = new media::AudioRendererMixer( |
| 201 mixer_output_params, sink, base::Bind(LogMixerUmaHistogram, latency)); | 201 mixer_output_params, sink, base::Bind(LogMixerUmaHistogram, latency)); |
| 202 AudioRendererMixerReference mixer_reference = {mixer, 1, sink.get()}; | 202 AudioRendererMixerReference mixer_reference = {mixer, 1, sink.get()}; |
| 203 mixers_[key] = mixer_reference; | 203 mixers_[key] = mixer_reference; |
| 204 DVLOG(1) << __FUNCTION__ << " mixer: " << mixer << " latency: " << latency | 204 DVLOG(1) << __func__ << " mixer: " << mixer << " latency: " << latency |
| 205 << "\n input: " << input_params.AsHumanReadableString() | 205 << "\n input: " << input_params.AsHumanReadableString() |
| 206 << "\noutput: " << mixer_output_params.AsHumanReadableString(); | 206 << "\noutput: " << mixer_output_params.AsHumanReadableString(); |
| 207 return mixer; | 207 return mixer; |
| 208 } | 208 } |
| 209 | 209 |
| 210 void AudioRendererMixerManager::ReturnMixer(media::AudioRendererMixer* mixer) { | 210 void AudioRendererMixerManager::ReturnMixer(media::AudioRendererMixer* mixer) { |
| 211 base::AutoLock auto_lock(mixers_lock_); | 211 base::AutoLock auto_lock(mixers_lock_); |
| 212 AudioRendererMixerMap::iterator it = std::find_if( | 212 AudioRendererMixerMap::iterator it = std::find_if( |
| 213 mixers_.begin(), mixers_.end(), | 213 mixers_.begin(), mixers_.end(), |
| 214 [mixer](const std::pair<MixerKey, AudioRendererMixerReference>& val) { | 214 [mixer](const std::pair<MixerKey, AudioRendererMixerReference>& val) { |
| (...skipping 28 matching lines...) Expand all Loading... |
| 243 const url::Origin& security_origin) | 243 const url::Origin& security_origin) |
| 244 : source_render_frame_id(source_render_frame_id), | 244 : source_render_frame_id(source_render_frame_id), |
| 245 params(params), | 245 params(params), |
| 246 latency(latency), | 246 latency(latency), |
| 247 device_id(device_id), | 247 device_id(device_id), |
| 248 security_origin(security_origin) {} | 248 security_origin(security_origin) {} |
| 249 | 249 |
| 250 AudioRendererMixerManager::MixerKey::MixerKey(const MixerKey& other) = default; | 250 AudioRendererMixerManager::MixerKey::MixerKey(const MixerKey& other) = default; |
| 251 | 251 |
| 252 } // namespace content | 252 } // namespace content |
| OLD | NEW |