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/audio/pulse/pulse_input.h" | 5 #include "media/audio/pulse/pulse_input.h" |
6 | 6 |
7 #include "base/logging.h" | 7 #include "base/logging.h" |
8 #include "media/audio/pulse/audio_manager_pulse.h" | 8 #include "media/audio/pulse/audio_manager_pulse.h" |
9 #include "media/audio/pulse/pulse_util.h" | 9 #include "media/audio/pulse/pulse_util.h" |
10 | 10 |
(...skipping 249 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
260 | 260 |
261 if (s && stream->callback_ && | 261 if (s && stream->callback_ && |
262 pa_stream_get_state(s) == PA_STREAM_FAILED) { | 262 pa_stream_get_state(s) == PA_STREAM_FAILED) { |
263 stream->callback_->OnError(stream); | 263 stream->callback_->OnError(stream); |
264 } | 264 } |
265 | 265 |
266 pa_threaded_mainloop_signal(stream->pa_mainloop_, 0); | 266 pa_threaded_mainloop_signal(stream->pa_mainloop_, 0); |
267 } | 267 } |
268 | 268 |
269 void PulseAudioInputStream::ReadData() { | 269 void PulseAudioInputStream::ReadData() { |
270 uint32 hardware_delay = pulse::GetHardwareLatencyInBytes( | 270 uint32_t hardware_delay = pulse::GetHardwareLatencyInBytes( |
271 handle_, params_.sample_rate(), params_.GetBytesPerFrame()); | 271 handle_, params_.sample_rate(), params_.GetBytesPerFrame()); |
272 | 272 |
273 // Update the AGC volume level once every second. Note that, | 273 // Update the AGC volume level once every second. Note that, |
274 // |volume| is also updated each time SetVolume() is called | 274 // |volume| is also updated each time SetVolume() is called |
275 // through IPC by the render-side AGC. | 275 // through IPC by the render-side AGC. |
276 // We disregard the |normalized_volume| from GetAgcVolume() | 276 // We disregard the |normalized_volume| from GetAgcVolume() |
277 // and use the value calculated by |volume_|. | 277 // and use the value calculated by |volume_|. |
278 double normalized_volume = 0.0; | 278 double normalized_volume = 0.0; |
279 GetAgcVolume(&normalized_volume); | 279 GetAgcVolume(&normalized_volume); |
280 normalized_volume = volume_ / GetMaxVolume(); | 280 normalized_volume = volume_ / GetMaxVolume(); |
(...skipping 43 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
324 return false; | 324 return false; |
325 | 325 |
326 size_t index = pa_stream_get_device_index(handle_); | 326 size_t index = pa_stream_get_device_index(handle_); |
327 pa_operation* operation = | 327 pa_operation* operation = |
328 pa_context_get_source_info_by_index(pa_context_, index, callback, this); | 328 pa_context_get_source_info_by_index(pa_context_, index, callback, this); |
329 WaitForOperationCompletion(pa_mainloop_, operation); | 329 WaitForOperationCompletion(pa_mainloop_, operation); |
330 return true; | 330 return true; |
331 } | 331 } |
332 | 332 |
333 } // namespace media | 333 } // namespace media |
OLD | NEW |