1 // Copyright 2013 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
5 #ifndef MEDIA_AUDIO_MAC_AGGREGATE_DEVICE_MANAGER_H_
6 #define MEDIA_AUDIO_MAC_AGGREGATE_DEVICE_MANAGER_H_
8 #include <CoreAudio/CoreAudio.h>
10 #include "base/basictypes.h"
11 #include "base/compiler_specific.h"
12 #include "media/base/media_export.h"
16 class MEDIA_EXPORT AggregateDeviceManager
{
18 AggregateDeviceManager();
19 ~AggregateDeviceManager();
21 // Lazily creates an aggregate device based on the default
22 // input and output devices.
23 // It will either return a valid device or kAudioDeviceUnknown
24 // if the default devices are not suitable for aggregate devices.
25 AudioDeviceID
GetDefaultAggregateDevice();
28 // The caller is responsible for releasing the CFStringRef.
29 static CFStringRef
GetDeviceUID(AudioDeviceID id
);
31 static void GetDeviceName(AudioDeviceID id
, char* name
, UInt32 size
);
32 static UInt32
GetClockDomain(AudioDeviceID device_id
);
33 static OSStatus
GetPluginID(AudioObjectID
* id
);
35 CFMutableDictionaryRef
CreateAggregateDeviceDictionary(
36 AudioDeviceID input_id
,
37 AudioDeviceID output_id
);
39 CFMutableArrayRef
CreateSubDeviceArray(CFStringRef input_device_UID
,
40 CFStringRef output_device_UID
);
42 OSStatus
CreateAggregateDevice(AudioDeviceID input_id
,
43 AudioDeviceID output_id
,
44 AudioDeviceID
* aggregate_device
);
45 void DestroyAggregateDevice();
47 AudioObjectID plugin_id_
;
48 AudioDeviceID input_device_
;
49 AudioDeviceID output_device_
;
51 AudioDeviceID aggregate_device_
;
53 DISALLOW_COPY_AND_ASSIGN(AggregateDeviceManager
);
58 #endif // MEDIA_AUDIO_MAC_AGGREGATE_DEVICE_MANAGER_H_