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/win/audio_low_latency_output_win.h" | 5 #include "media/audio/win/audio_low_latency_output_win.h" |
6 | 6 |
7 #include <Functiondiscoverykeys_devpkey.h> | 7 #include <Functiondiscoverykeys_devpkey.h> |
8 | 8 |
9 #include "base/command_line.h" | 9 #include "base/command_line.h" |
10 #include "base/debug/trace_event.h" | 10 #include "base/debug/trace_event.h" |
11 #include "base/logging.h" | 11 #include "base/logging.h" |
12 #include "base/memory/scoped_ptr.h" | 12 #include "base/memory/scoped_ptr.h" |
13 #include "base/metrics/histogram.h" | 13 #include "base/metrics/histogram.h" |
14 #include "base/strings/utf_string_conversions.h" | 14 #include "base/strings/utf_string_conversions.h" |
15 #include "base/win/scoped_propvariant.h" | 15 #include "base/win/scoped_propvariant.h" |
16 #include "media/audio/win/audio_manager_win.h" | 16 #include "media/audio/win/audio_manager_win.h" |
17 #include "media/audio/win/avrt_wrapper_win.h" | 17 #include "media/audio/win/avrt_wrapper_win.h" |
18 #include "media/audio/win/core_audio_util_win.h" | 18 #include "media/audio/win/core_audio_util_win.h" |
19 #include "media/base/limits.h" | 19 #include "media/base/limits.h" |
20 #include "media/base/media_switches.h" | 20 #include "media/base/media_switches.h" |
21 | 21 |
22 using base::win::ScopedComPtr; | 22 using base::win::ScopedComPtr; |
23 using base::win::ScopedCOMInitializer; | 23 using base::win::ScopedCOMInitializer; |
24 using base::win::ScopedCoMem; | 24 using base::win::ScopedCoMem; |
25 | 25 |
26 namespace media { | 26 namespace media { |
27 | 27 |
28 // static | 28 // static |
29 AUDCLNT_SHAREMODE WASAPIAudioOutputStream::GetShareMode() { | 29 AUDCLNT_SHAREMODE WASAPIAudioOutputStream::GetShareMode() { |
30 const CommandLine* cmd_line = CommandLine::ForCurrentProcess(); | 30 const base::CommandLine* cmd_line = base::CommandLine::ForCurrentProcess(); |
31 if (cmd_line->HasSwitch(switches::kEnableExclusiveAudio)) | 31 if (cmd_line->HasSwitch(switches::kEnableExclusiveAudio)) |
32 return AUDCLNT_SHAREMODE_EXCLUSIVE; | 32 return AUDCLNT_SHAREMODE_EXCLUSIVE; |
33 return AUDCLNT_SHAREMODE_SHARED; | 33 return AUDCLNT_SHAREMODE_SHARED; |
34 } | 34 } |
35 | 35 |
36 // static | 36 // static |
37 int WASAPIAudioOutputStream::HardwareSampleRate(const std::string& device_id) { | 37 int WASAPIAudioOutputStream::HardwareSampleRate(const std::string& device_id) { |
38 WAVEFORMATPCMEX format; | 38 WAVEFORMATPCMEX format; |
39 ScopedComPtr<IAudioClient> client; | 39 ScopedComPtr<IAudioClient> client; |
40 if (device_id.empty()) { | 40 if (device_id.empty()) { |
(...skipping 575 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
616 | 616 |
617 // Ensure that we don't quit the main thread loop immediately next | 617 // Ensure that we don't quit the main thread loop immediately next |
618 // time Start() is called. | 618 // time Start() is called. |
619 ResetEvent(stop_render_event_.Get()); | 619 ResetEvent(stop_render_event_.Get()); |
620 } | 620 } |
621 | 621 |
622 source_ = NULL; | 622 source_ = NULL; |
623 } | 623 } |
624 | 624 |
625 } // namespace media | 625 } // namespace media |
OLD | NEW |