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_io.h" | 5 #include "media/audio/audio_io.h" |
6 | 6 |
7 #include <windows.h> | 7 #include <windows.h> |
8 #include <objbase.h> // This has to be before initguid.h | 8 #include <objbase.h> // This has to be before initguid.h |
9 #include <initguid.h> | 9 #include <initguid.h> |
10 #include <mmsystem.h> | 10 #include <mmsystem.h> |
(...skipping 20 matching lines...) Expand all Loading... |
31 #pragma comment(lib, "setupapi.lib") | 31 #pragma comment(lib, "setupapi.lib") |
32 | 32 |
33 // The following are defined in various DDK headers, and we (re)define them | 33 // The following are defined in various DDK headers, and we (re)define them |
34 // here to avoid adding the DDK as a chrome dependency. | 34 // here to avoid adding the DDK as a chrome dependency. |
35 #define DRV_QUERYDEVICEINTERFACE 0x80c | 35 #define DRV_QUERYDEVICEINTERFACE 0x80c |
36 #define DRVM_MAPPER_PREFERRED_GET 0x2015 | 36 #define DRVM_MAPPER_PREFERRED_GET 0x2015 |
37 #define DRV_QUERYDEVICEINTERFACESIZE 0x80d | 37 #define DRV_QUERYDEVICEINTERFACESIZE 0x80d |
38 DEFINE_GUID(AM_KSCATEGORY_AUDIO, 0x6994ad04, 0x93ef, 0x11d0, | 38 DEFINE_GUID(AM_KSCATEGORY_AUDIO, 0x6994ad04, 0x93ef, 0x11d0, |
39 0xa3, 0xcc, 0x00, 0xa0, 0xc9, 0x22, 0x31, 0x96); | 39 0xa3, 0xcc, 0x00, 0xa0, 0xc9, 0x22, 0x31, 0x96); |
40 | 40 |
41 namespace media { | |
42 | |
43 // Maximum number of output streams that can be open simultaneously. | 41 // Maximum number of output streams that can be open simultaneously. |
44 static const int kMaxOutputStreams = 50; | 42 static const int kMaxOutputStreams = 50; |
45 | 43 |
46 // Up to 8 channels can be passed to the driver. | 44 // Up to 8 channels can be passed to the driver. |
47 // This should work, given the right drivers, but graceful error handling is | 45 // This should work, given the right drivers, but graceful error handling is |
48 // needed. | 46 // needed. |
49 static const int kWinMaxChannels = 8; | 47 static const int kWinMaxChannels = 8; |
50 | 48 |
51 // We use 3 buffers for recording audio so that if a recording callback takes | 49 // We use 3 buffers for recording audio so that if a recording callback takes |
52 // some time to return we won't lose audio. More buffers while recording are | 50 // some time to return we won't lose audio. More buffers while recording are |
(...skipping 259 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
312 } | 310 } |
313 | 311 |
314 return new PCMWaveInAudioInputStream(this, params, kNumInputBuffers, | 312 return new PCMWaveInAudioInputStream(this, params, kNumInputBuffers, |
315 xp_device_id); | 313 xp_device_id); |
316 } | 314 } |
317 | 315 |
318 /// static | 316 /// static |
319 AudioManager* CreateAudioManager() { | 317 AudioManager* CreateAudioManager() { |
320 return new AudioManagerWin(); | 318 return new AudioManagerWin(); |
321 } | 319 } |
322 | |
323 } // namespace media | |
OLD | NEW |