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 54 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
65 case media::AudioLatency::LATENCY_EXACT_MS: | 65 case media::AudioLatency::LATENCY_EXACT_MS: |
66 // TODO(olka): add support when WebAudio requires it. | 66 // TODO(olka): add support when WebAudio requires it. |
67 default: | 67 default: |
68 NOTREACHED(); | 68 NOTREACHED(); |
69 } | 69 } |
70 | 70 |
71 DCHECK_NE(output_buffer_size, 0); | 71 DCHECK_NE(output_buffer_size, 0); |
72 | 72 |
73 // Force to 16-bit output for now since we know that works everywhere; | 73 // Force to 16-bit output for now since we know that works everywhere; |
74 // ChromeOS does not support other bit depths. | 74 // ChromeOS does not support other bit depths. |
75 return media::AudioParameters(input_params.format(), | 75 media::AudioParameters params(input_params.format(), |
76 input_params.channel_layout(), | 76 input_params.channel_layout(), |
77 output_sample_rate, 16, output_buffer_size); | 77 output_sample_rate, 16, output_buffer_size); |
| 78 |
| 79 // Specify the latency info to be passed to the browser side. |
| 80 params.set_latency_tag(latency); |
| 81 return params; |
78 } | 82 } |
79 | 83 |
80 void LogMixerUmaHistogram(media::AudioLatency::LatencyType latency, int value) { | 84 void LogMixerUmaHistogram(media::AudioLatency::LatencyType latency, int value) { |
81 switch (latency) { | 85 switch (latency) { |
82 case media::AudioLatency::LATENCY_EXACT_MS: | 86 case media::AudioLatency::LATENCY_EXACT_MS: |
83 UMA_HISTOGRAM_CUSTOM_COUNTS( | 87 UMA_HISTOGRAM_CUSTOM_COUNTS( |
84 "Media.Audio.Render.AudioInputsPerMixer.LatencyExact", value, 1, 20, | 88 "Media.Audio.Render.AudioInputsPerMixer.LatencyExact", value, 1, 20, |
85 21); | 89 21); |
86 return; | 90 return; |
87 case media::AudioLatency::LATENCY_INTERACTIVE: | 91 case media::AudioLatency::LATENCY_INTERACTIVE: |
(...skipping 155 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
243 const url::Origin& security_origin) | 247 const url::Origin& security_origin) |
244 : source_render_frame_id(source_render_frame_id), | 248 : source_render_frame_id(source_render_frame_id), |
245 params(params), | 249 params(params), |
246 latency(latency), | 250 latency(latency), |
247 device_id(device_id), | 251 device_id(device_id), |
248 security_origin(security_origin) {} | 252 security_origin(security_origin) {} |
249 | 253 |
250 AudioRendererMixerManager::MixerKey::MixerKey(const MixerKey& other) = default; | 254 AudioRendererMixerManager::MixerKey::MixerKey(const MixerKey& other) = default; |
251 | 255 |
252 } // namespace content | 256 } // namespace content |
OLD | NEW |