| 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_manager.h" | 5 #include "media/audio/audio_manager.h" |
| 6 | 6 |
| 7 #include <stdint.h> | 7 #include <stdint.h> |
| 8 | 8 |
| 9 #include <utility> | 9 #include <utility> |
| 10 | 10 |
| 11 #include "base/bind.h" | 11 #include "base/bind.h" |
| 12 #include "base/bind_helpers.h" | 12 #include "base/bind_helpers.h" |
| 13 #include "base/command_line.h" | 13 #include "base/command_line.h" |
| 14 #include "base/logging.h" | 14 #include "base/logging.h" |
| 15 #include "base/macros.h" | 15 #include "base/macros.h" |
| 16 #include "base/message_loop/message_loop.h" | 16 #include "base/message_loop/message_loop.h" |
| 17 #include "base/metrics/histogram_macros.h" | 17 #include "base/metrics/histogram_macros.h" |
| 18 #include "base/power_monitor/power_monitor.h" | 18 #include "base/power_monitor/power_monitor.h" |
| 19 #include "base/single_thread_task_runner.h" | 19 #include "base/single_thread_task_runner.h" |
| 20 #include "base/strings/stringprintf.h" | 20 #include "base/strings/stringprintf.h" |
| 21 #include "build/build_config.h" | 21 #include "build/build_config.h" |
| 22 #include "media/audio/fake_audio_log_factory.h" | 22 #include "media/audio/fake_audio_log_factory.h" |
| 23 #include "media/base/media_switches.h" | 23 #include "media/base/media_switches.h" |
| 24 | 24 |
| 25 #if defined(OS_MACOSX) | |
| 26 #include "media/audio/mac/audio_manager_mac.h" | |
| 27 #endif | |
| 28 | |
| 29 #if defined(OS_WIN) | 25 #if defined(OS_WIN) |
| 30 #include "base/win/scoped_com_initializer.h" | 26 #include "base/win/scoped_com_initializer.h" |
| 31 #include "media/audio/win/core_audio_util_win.h" | |
| 32 #endif | 27 #endif |
| 33 | 28 |
| 34 namespace media { | 29 namespace media { |
| 35 namespace { | 30 namespace { |
| 36 | 31 |
| 37 // The singleton instance of AudioManager. This is set when Create() is called. | 32 // The singleton instance of AudioManager. This is set when Create() is called. |
| 38 AudioManager* g_last_created = nullptr; | 33 AudioManager* g_last_created = nullptr; |
| 39 | 34 |
| 40 // Maximum number of failed pings to the audio thread allowed. A UMA will be | 35 // Maximum number of failed pings to the audio thread allowed. A UMA will be |
| 41 // recorded once this count is reached; if enabled, a non-crash dump will be | 36 // recorded once this count is reached; if enabled, a non-crash dump will be |
| (...skipping 309 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 351 audio_thread_->GetTaskRunner()->PostTask( | 346 audio_thread_->GetTaskRunner()->PostTask( |
| 352 FROM_HERE, base::Bind(&AudioManager::ShutdownOnAudioThread, | 347 FROM_HERE, base::Bind(&AudioManager::ShutdownOnAudioThread, |
| 353 base::Unretained(this))); | 348 base::Unretained(this))); |
| 354 } | 349 } |
| 355 audio_thread_->Stop(); | 350 audio_thread_->Stop(); |
| 356 shutdown_ = true; | 351 shutdown_ = true; |
| 357 return true; | 352 return true; |
| 358 } | 353 } |
| 359 | 354 |
| 360 } // namespace media | 355 } // namespace media |
| OLD | NEW |