| 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/audio_output_device.h" | 5 #include "media/audio/audio_output_device.h" |
| 6 | 6 |
| 7 #include <stddef.h> | 7 #include <stddef.h> |
| 8 #include <stdint.h> | 8 #include <stdint.h> |
| 9 | 9 |
| 10 #include <cmath> | 10 #include <cmath> |
| 11 #include <utility> | 11 #include <utility> |
| 12 | 12 |
| 13 #include "base/callback_helpers.h" | 13 #include "base/callback_helpers.h" |
| 14 #include "base/macros.h" | 14 #include "base/macros.h" |
| 15 #include "base/threading/thread_restrictions.h" | 15 #include "base/threading/thread_restrictions.h" |
| 16 #include "base/time/time.h" | 16 #include "base/time/time.h" |
| 17 #include "base/trace_event/trace_event.h" | 17 #include "base/trace_event/trace_event.h" |
| 18 #include "build/build_config.h" | 18 #include "build/build_config.h" |
| 19 #include "media/audio/audio_output_controller.h" | 19 #include "media/audio/audio_output_controller.h" |
| 20 #include "media/base/limits.h" | 20 #include "media/base/limits.h" |
| 21 #include "content/renderer/media/audio_output_client.h" |
| 22 #include "content/browser/mojo/mojo_application_host.h" |
| 21 | 23 |
| 22 namespace media { | 24 namespace media { |
| 23 | 25 |
| 24 // Takes care of invoking the render callback on the audio thread. | 26 // Takes care of invoking the render callback on the audio thread. |
| 25 // An instance of this class is created for each capture stream in | 27 // An instance of this class is created for each capture stream in |
| 26 // OnStreamCreated(). | 28 // OnStreamCreated(). |
| 27 class AudioOutputDevice::AudioThreadCallback | 29 class AudioOutputDevice::AudioThreadCallback |
| 28 : public AudioDeviceThread::Callback { | 30 : public AudioDeviceThread::Callback { |
| 29 public: | 31 public: |
| 30 AudioThreadCallback(const AudioParameters& audio_parameters, | 32 AudioThreadCallback(const AudioParameters& audio_parameters, |
| (...skipping 410 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 441 | 443 |
| 442 // Update the audio-delay measurement, inform about the number of skipped | 444 // Update the audio-delay measurement, inform about the number of skipped |
| 443 // frames, and ask client to render audio. Since |output_bus_| is wrapping | 445 // frames, and ask client to render audio. Since |output_bus_| is wrapping |
| 444 // the shared memory the Render() call is writing directly into the shared | 446 // the shared memory the Render() call is writing directly into the shared |
| 445 // memory. | 447 // memory. |
| 446 render_callback_->Render(output_bus_.get(), std::round(frames_delayed), | 448 render_callback_->Render(output_bus_.get(), std::round(frames_delayed), |
| 447 frames_skipped); | 449 frames_skipped); |
| 448 } | 450 } |
| 449 | 451 |
| 450 } // namespace media | 452 } // namespace media |
| OLD | NEW |