-
Notifications
You must be signed in to change notification settings - Fork 570
CoreAudio iOS xcode27.0 b1
Alex Soto edited this page Jun 9, 2026
·
1 revision
#CoreAudio.framework
diff -ruN /Applications/Xcode_26.5.0.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS.sdk/System/Library/Frameworks/CoreAudio.framework/Headers/AudioHardwareBase.h /Applications/Xcode_27.0.0-beta.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS.sdk/System/Library/Frameworks/CoreAudio.framework/Headers/AudioHardwareBase.h
--- /Applications/Xcode_26.5.0.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS.sdk/System/Library/Frameworks/CoreAudio.framework/Headers/AudioHardwareBase.h 1969-12-31 19:00:00
+++ /Applications/Xcode_27.0.0-beta.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS.sdk/System/Library/Frameworks/CoreAudio.framework/Headers/AudioHardwareBase.h 2026-05-22 04:19:16
@@ -0,0 +1,1459 @@
+/*==================================================================================================
+ File: CoreAudio/AudioHardwareBase.h
+
+ Copyright: (c) 1985-2025 by Apple, Inc., all rights reserved.
+
+ Bugs?: For bug reports, consult the following page on
+ the World Wide Web:
+
+ http://developer.apple.com/bugreporter/
+
+==================================================================================================*/
+#if !defined(CoreAudio_AudioHardwareBase_h)
+#define CoreAudio_AudioHardwareBase_h
+
+//==================================================================================================
+#pragma mark -
+#pragma mark Overview
+/*!
+ @header AudioHardwareBase
+
+ This file defines the HAL's object model including the properties and their needed types and
+ constants that describe the property values.
+*/
+
+//==================================================================================================
+// Includes
+
+#include <CoreAudioTypes/CoreAudioTypes.h>
+
+//==================================================================================================
+
+CF_ASSUME_NONNULL_BEGIN
+
+#if defined(__cplusplus)
+extern "C"
+{
+#endif
+
+//==================================================================================================
+#pragma mark -
+#pragma mark Basic Types
+
+/*!
+ @typedef AudioObjectID
+ @abstract A UInt32 that provides a handle on a specific AudioObject.
+*/
+typedef UInt32 AudioObjectID;
+
+/*!
+ @typedef AudioClassID
+ @abstract AudioClassIDs are used to identify the class of an AudioObject.
+*/
+typedef UInt32 AudioClassID;
+
+/*!
+ @typedef AudioObjectPropertySelector
+ @abstract An AudioObjectPropertySelector is a four char code that identifies, along with
+ the AudioObjectPropertyScope and AudioObjectPropertyElement, a specific piece of
+ information about an AudioObject.
+ @discussion The property selector specifies the general classification of the property such
+ as volume, stream format, latency, etc. Note that each class has a different set
+ of selectors. A subclass inherits its super class's set of selectors, although
+ it may not implement them all.
+*/
+typedef UInt32 AudioObjectPropertySelector;
+
+/*!
+ @typedef AudioObjectPropertyScope
+ @abstract An AudioObjectPropertyScope is a four char code that identifies, along with the
+ AudioObjectPropertySelector and AudioObjectPropertyElement, a specific piece of
+ information about an AudioObject.
+ @discussion The scope specifies the section of the object in which to look for the property,
+ such as input, output, global, etc. Note that each class has a different set of
+ scopes. A subclass inherits its superclass's set of scopes.
+*/
+typedef UInt32 AudioObjectPropertyScope;
+
+/*!
+ @typedef AudioObjectPropertyElement
+ @abstract An AudioObjectPropertyElement is an integer that identifies, along with the
+ AudioObjectPropertySelector and AudioObjectPropertyScope, a specific piece of
+ information about an AudioObject.
+ @discussion The element selects one of possibly many items in the section of the object in
+ which to look for the property. Elements are number sequentially where 0
+ represents the main element. Elements are particular to an instance of a
+ class, meaning that two instances can have different numbers of elements in the
+ same scope. There is no inheritance of elements.
+*/
+typedef UInt32 AudioObjectPropertyElement;
+
+/*!
+ @struct AudioObjectPropertyAddress
+ @abstract An AudioObjectPropertyAddress collects the three parts that identify a specific
+ property together in a struct for easy transmission.
+ @field mSelector
+ The AudioObjectPropertySelector for the property.
+ @field mScope
+ The AudioObjectPropertyScope for the property.
+ @field mElement
+ The AudioObjectPropertyElement for the property.
+*/
+struct AudioObjectPropertyAddress
+{
+ AudioObjectPropertySelector mSelector;
+ AudioObjectPropertyScope mScope;
+ AudioObjectPropertyElement mElement;
+};
+typedef struct AudioObjectPropertyAddress AudioObjectPropertyAddress;
+
+//==================================================================================================
+#pragma mark Basic Constants
+
+/*!
+ @enum Error Constants
+ @abstract The error constants unique to the HAL.
+ @discussion These are the error constants that are unique to the HAL. Note that the HAL's
+ functions can and will return other codes that are not listed here. While these
+ constants give a general idea of what might have gone wrong during the execution
+ of an API call, if an API call returns anything other than kAudioHardwareNoError
+ it is to be viewed as the same failure regardless of what constant is actually
+ returned.
+ @constant kAudioHardwareNoError
+ The function call completed successfully.
+ @constant kAudioHardwareNotRunningError
+ The function call requires that the hardware be running but it isn't.
+ @constant kAudioHardwareUnspecifiedError
+ The function call failed while doing something that doesn't provide any
+ error messages.
+ @constant kAudioHardwareUnknownPropertyError
+ The AudioObject doesn't know about the property at the given address.
+ @constant kAudioHardwareBadPropertySizeError
+ An improperly sized buffer was provided when accessing the data of a
+ property.
+ @constant kAudioHardwareIllegalOperationError
+ The requested operation couldn't be completed.
+ @constant kAudioHardwareBadObjectError
+ The AudioObjectID passed to the function doesn't map to a valid AudioObject.
+ @constant kAudioHardwareBadDeviceError
+ The AudioObjectID passed to the function doesn't map to a valid AudioDevice.
+ @constant kAudioHardwareBadStreamError
+ The AudioObjectID passed to the function doesn't map to a valid AudioStream.
+ @constant kAudioHardwareUnsupportedOperationError
+ The AudioObject doesn't support the requested operation.
+ @constant kAudioHardwareNotReadyError
+ The AudioObject isn't ready to do the requested operation.
+ @constant kAudioDeviceUnsupportedFormatError
+ The AudioStream doesn't support the requested format.
+ @constant kAudioDevicePermissionsError
+ The requested operation can't be completed because the process doesn't have
+ permission.
+*/
+CF_ENUM(OSStatus)
+{
+ kAudioHardwareNoError = 0,
+ kAudioHardwareNotRunningError = 'stop',
+ kAudioHardwareUnspecifiedError = 'what',
+ kAudioHardwareUnknownPropertyError = 'who?',
+ kAudioHardwareBadPropertySizeError = '!siz',
+ kAudioHardwareIllegalOperationError = 'nope',
+ kAudioHardwareBadObjectError = '!obj',
+ kAudioHardwareBadDeviceError = '!dev',
+ kAudioHardwareBadStreamError = '!str',
+ kAudioHardwareUnsupportedOperationError = 'unop',
+ kAudioHardwareNotReadyError = 'nrdy',
+ kAudioDeviceUnsupportedFormatError = '!dat',
+ kAudioDevicePermissionsError = '!hog'
+};
+
+/*!
+ @enum Predefined AudioObjectID values
+ @abstract ObjectIDs that are always the same
+ @constant kAudioObjectUnknown
+ This is the sentinel value. No object will have an ID whose value is 0.
+*/
+CF_ENUM(AudioObjectID)
+{
+ kAudioObjectUnknown = 0
+};
+
+/*!
+ @enum Property Address Constants
+ @abstract The valid values for the scope in a property address.
+ @constant kAudioObjectPropertyScopeGlobal
+ The AudioObjectPropertyScope for properties that apply to the object as a
+ whole. All objects have a global scope and for most it is their only scope.
+ @constant kAudioObjectPropertyScopeInput
+ The AudioObjectPropertyScope for properties that apply to the input side of
+ an object.
+ @constant kAudioObjectPropertyScopeOutput
+ The AudioObjectPropertyScope for properties that apply to the output side of
+ an object.
+ @constant kAudioObjectPropertyScopePlayThrough
+ The AudioObjectPropertyScope for properties that apply to the play through
+ side of an object.
+ @constant kAudioObjectPropertyElementMain
+ The AudioObjectPropertyElement value for properties that apply to the main
+ element or to the entire scope.
+ @constant kAudioObjectPropertyElementMaster
+ The deprecated synonym for kAudioObjectPropertyElementMain
+*/
+CF_ENUM(AudioObjectPropertyScope)
+{
+ kAudioObjectPropertyScopeGlobal = 'glob',
+ kAudioObjectPropertyScopeInput = 'inpt',
+ kAudioObjectPropertyScopeOutput = 'outp',
+ kAudioObjectPropertyScopePlayThrough = 'ptru',
+ kAudioObjectPropertyElementMain = 0,
+ kAudioObjectPropertyElementMaster API_DEPRECATED_WITH_REPLACEMENT("kAudioObjectPropertyElementMain", macos(10.0, 12.0), ios(2.0, 15.0), watchos(1.0, 8.0), tvos(9.0, 15.0)) = kAudioObjectPropertyElementMain
+};
+
+/*!
+ @enum Wildcard Constants
+ @abstract Constants that are used as wildcards.
+ @discussion Wildcards match any and all values for their associated type. They are useful
+ when registering to receive notifications.
+ @constant kAudioObjectPropertySelectorWildcard
+ The wildcard value for AudioObjectPropertySelectors.
+ @constant kAudioObjectPropertyScopeWildcard
+ The wildcard value for AudioObjectPropertyScopes.
+ @constant kAudioObjectPropertyElementWildcard
+ The wildcard value for AudioObjectPropertyElements.
+ @constant kAudioObjectClassIDWildcard
+ The wildcard value for AudioClassIDs.
+*/
+CF_ENUM(AudioObjectPropertySelector)
+{
+ kAudioObjectPropertySelectorWildcard = '****'
+};
+
+CF_ENUM(AudioObjectPropertyScope)
+{
+ kAudioObjectPropertyScopeWildcard = '****'
+};
+
+CF_ENUM(AudioObjectPropertyElement)
+{
+ kAudioObjectPropertyElementWildcard = 0xFFFFFFFF
+};
+
+CF_ENUM(AudioClassID)
+{
+ kAudioObjectClassIDWildcard = '****'
+};
+
+//==================================================================================================
+#pragma mark -
+#pragma mark AudioObject Constants
+
+/*!
+ @enum AudioObject Class Constants
+ @abstract Various constants related to the AudioObject class.
+ @discussion The AudioObject class is the base class for all classes.
+ @constant kAudioObjectClassID
+ The AudioClassID that identifies the AudioObject class.
+*/
+CF_ENUM(AudioClassID)
+{
+ kAudioObjectClassID = 'aobj'
+};
+
+//==================================================================================================
+#pragma mark AudioObject Properties
+
+/*!
+ @enum AudioObject Property Selectors
+ @abstract AudioObjectPropertySelector values provided by objects of the AudioObject class.
+ @discussion The AudioObject class is the base class for all classes. As such, all classes
+ inherit this set of properties.
+ @constant kAudioObjectPropertyBaseClass
+ An AudioClassID that identifies the class from which the class of the
+ AudioObject is derived. This value must always be one of the standard
+ classes.
+ @constant kAudioObjectPropertyClass
+ An AudioClassID that identifies the class of the AudioObject.
+ @constant kAudioObjectPropertyOwner
+ An AudioObjectID that identifies the the AudioObject that owns the given
+ AudioObject. Note that all AudioObjects are owned by some other AudioObject.
+ The only exception is the AudioSystemObject, for which the value of this
+ property is kAudioObjectUnknown.
+ @constant kAudioObjectPropertyName
+ A CFString that contains the human readable name of the object. The caller
+ is responsible for releasing the returned CFObject.
+ @constant kAudioObjectPropertyModelName
+ A CFString that contains the human readable model name of the object. The
+ model name differs from kAudioObjectPropertyName in that two objects of the
+ same model will have the same value for this property but may have different
+ values for kAudioObjectPropertyName.
+ @constant kAudioObjectPropertyManufacturer
+ A CFString that contains the human readable name of the manufacturer of the
+ hardware the AudioObject is a part of. The caller is responsible for
+ releasing the returned CFObject.
+ @constant kAudioObjectPropertyElementName
+ A CFString that contains a human readable name for the given element in the
+ given scope. The caller is responsible for releasing the returned CFObject.
+ @constant kAudioObjectPropertyElementCategoryName
+ A CFString that contains a human readable name for the category of the given
+ element in the given scope. The caller is responsible for releasing the
+ returned CFObject.
+ @constant kAudioObjectPropertyElementNumberName
+ A CFString that contains a human readable name for the number of the given
+ element in the given scope. The caller is responsible for releasing the
+ returned CFObject.
+ @constant kAudioObjectPropertyOwnedObjects
+ An array of AudioObjectIDs that represent all the AudioObjects owned by the
+ given object. The qualifier is an array of AudioClassIDs. If it is
+ non-empty, the returned array of AudioObjectIDs will only refer to objects
+ whose class is in the qualifier array or whose is a subclass of one in the
+ qualifier array.
+ @constant kAudioObjectPropertyIdentify
+ A UInt32 where a value of one indicates that the object's hardware is
+ drawing attention to itself, typically by flashing or lighting up its front
+ panel display. A value of 0 indicates that this function is turned off. This
+ makes it easy for a user to associate the physical hardware with its
+ representation in an application. Typically, this property is only supported
+ by AudioDevices and AudioBoxes.
+ @constant kAudioObjectPropertySerialNumber
+ A CFString that contains the human readable serial number for the object.
+ This property will typically be implemented by AudioBox and AudioDevice
+ objects. Note that the serial number is not defined to be unique in the same
+ way that an AudioBox's or AudioDevice's UID property are defined. This is
+ purely an informational value. The caller is responsible for releasing the
+ returned CFObject.
+ @constant kAudioObjectPropertyFirmwareVersion
+ A CFString that contains the human readable firmware version for the object.
+ This property will typically be implemented by AudioBox and AudioDevice
+ objects. Note that this is purely an informational value. The caller is
+ responsible for releasing the returned CFObject.
+*/
+CF_ENUM(AudioObjectPropertySelector)
+{
+ kAudioObjectPropertyBaseClass = 'bcls',
+ kAudioObjectPropertyClass = 'clas',
+ kAudioObjectPropertyOwner = 'stdv',
+ kAudioObjectPropertyName = 'lnam',
+ kAudioObjectPropertyModelName = 'lmod',
+ kAudioObjectPropertyManufacturer = 'lmak',
+ kAudioObjectPropertyElementName = 'lchn',
+ kAudioObjectPropertyElementCategoryName = 'lccn',
+ kAudioObjectPropertyElementNumberName = 'lcnn',
+ kAudioObjectPropertyOwnedObjects = 'ownd',
+ kAudioObjectPropertyIdentify = 'iden',
+ kAudioObjectPropertySerialNumber = 'snum',
+ kAudioObjectPropertyFirmwareVersion = 'fwvn'
+};
+
+//==================================================================================================
+#pragma mark -
+#pragma mark AudioPlugIn Constants
+
+/*!
+ @enum AudioPlugIn Class Constants
+ @abstract Various constants related to the AudioPlugIn class.
+ @constant kAudioPlugInClassID
+ The AudioClassID that identifies the AudioPlugIn class.
+*/
+CF_ENUM(AudioClassID)
+{
+ kAudioPlugInClassID = 'aplg'
+};
+
+//==================================================================================================
+#pragma mark AudioPlugIn Properties
+
+/*!
+ @enum AudioPlugIn Properties
+ @abstract AudioObjectPropertySelector values provided by the AudioPlugIn class.
+ @discussion The AudioPlugIn class is a subclass of the AudioObject class. The class has just
+ the global scope, kAudioObjectPropertyScopeGlobal, and only a main element.
+ @constant kAudioPlugInPropertyBundleID
+ A CFString that contains the bundle identifier for the AudioPlugIn. The
+ caller is responsible for releasing the returned CFObject.
+ @constant kAudioPlugInPropertyDeviceList
+ An array of AudioObjectIDs that represent all the AudioDevices currently
+ provided by the plug-in.
+ @constant kAudioPlugInPropertyTranslateUIDToDevice
+ This property fetches the AudioObjectID that corresponds to the AudioDevice
+ that has the given UID. The UID is passed in via the qualifier as a CFString
+ while the AudioObjectID for the AudioDevice is returned to the caller as the
+ property's data. Note that an error is not returned if the UID doesn't refer
+ to any AudioDevices. Rather, this property will return kAudioObjectUnknown
+ as the value of the property.
+ @constant kAudioPlugInPropertyBoxList
+ An array of AudioObjectIDs that represent all the AudioBox objects currently
+ provided by the plug-in.
+ @constant kAudioPlugInPropertyTranslateUIDToBox
+ This property fetches the AudioObjectID that corresponds to the AudioBox
+ that has the given UID. The UID is passed in via the qualifier as a CFString
+ while the AudioObjectID for the AudioBox is returned to the caller as the
+ property's data. Note that an error is not returned if the UID doesn't refer
+ to any AudioBoxes. Rather, this property will return kAudioObjectUnknown
+ as the value of the property.
+ @constant kAudioPlugInPropertyClockDeviceList
+ An array of AudioObjectIDs that represent all the AudioClockDevice objects
+ currently provided by the plug-in.
+ @constant kAudioPlugInPropertyTranslateUIDToClockDevice
+ This property fetches the AudioObjectID that corresponds to the
+ AudioClockDevice that has the given UID. The UID is passed in via the
+ qualifier as a CFString while the AudioObjectID for the AudioClockDevice is
+ returned to the caller as the property's data. Note that an error is not
+ returned if the UID doesn't refer to any AudioClockDevices. Rather, this
+ property will return kAudioObjectUnknown as the value of the property.
+*/
+CF_ENUM(AudioObjectPropertySelector)
+{
+ kAudioPlugInPropertyBundleID = 'piid',
+ kAudioPlugInPropertyDeviceList = 'dev#',
+ kAudioPlugInPropertyTranslateUIDToDevice = 'uidd',
+ kAudioPlugInPropertyBoxList = 'box#',
+ kAudioPlugInPropertyTranslateUIDToBox = 'uidb',
+ kAudioPlugInPropertyClockDeviceList = 'clk#',
+ kAudioPlugInPropertyTranslateUIDToClockDevice = 'uidc'
+};
+
+//==================================================================================================
+#pragma mark -
+#pragma mark AudioTransportManager Constants
+
+/*!
+ @enum AudioTransportManager Class Constants
+ @abstract Various constants related to the AudioTransportManager class.
+ @discussion The AudioTransportManager class is a subclass of the AudioPlugIn class.
+ Instances manage an entire transport mechanism such as AirPlay or an AVB network
+ of devices. AudioTransportManagers present a list of AudioEndPoints that
+ represent all the devices that they manage. They can combine AudioEndPoints into
+ an AudioEndPointDevice that can be used by the system the same as any other
+ AudioDevice.
+ @constant kAudioTransportManagerClassID
+ The AudioClassID that identifies the AudioTransportManager class.
+*/
+CF_ENUM(AudioClassID)
+{
+ kAudioTransportManagerClassID = 'trpm'
+};
+
+//==================================================================================================
+#pragma mark AudioTransportManager Properties
+
+/*!
+ @enum AudioTransportManager Properties
+ @abstract AudioObjectPropertySelector values provided by the AudioTransportManager class.
+ @discussion The AudioTransportManager class is a subclass of the AudioPlugIn class. The
+ class has just the global scope, kAudioObjectPropertyScopeGlobal, and only a
+ main element.
+ @constant kAudioTransportManagerPropertyEndPointList
+ An array of AudioObjectIDs for all the AudioEndPoint objects the transport
+ manager is tracking.
+ @constant kAudioTransportManagerPropertyTranslateUIDToEndPoint
+ This property fetches the AudioObjectID that corresponds to the
+ AudioEndpoint that has the given UID. The UID is passed in via the qualifier
+ as a CFString while the AudioObjectID for the AudioEndpoint is returned to
+ the caller as the property's data. Note that an error is not returned if the
+ UID doesn't refer to any AudioEndpoints. Rather, this property will return
+ kAudioObjectUnknown as the value of the property.
+ @constant kAudioTransportManagerPorpertyTransportType
+ A UInt32 whose value indicates how the transport manager's endpoints and
+ endpoint devices are connected to the CPU. Constants for some of the values
+ for this property can be found in the enum in the AudioDevice Constants
+ section of this file.
+*/
+CF_ENUM(AudioObjectPropertySelector)
+{
+ kAudioTransportManagerPropertyEndPointList = 'end#',
+ kAudioTransportManagerPropertyTranslateUIDToEndPoint = 'uide',
+ kAudioTransportManagerPropertyTransportType = 'tran'
+};
+
+//==================================================================================================
+#pragma mark -
+#pragma mark AudioBox Constants
+
+/*!
+ @enum AudioBox Class Constants
+ @abstract Various constants related to the AudioBox class.
+ @constant kAudioBoxClassID
+ The AudioClassID that identifies the AudioBox class.
+*/
+CF_ENUM(AudioClassID)
+{
+ kAudioBoxClassID = 'abox'
+};
+
+//==================================================================================================
+#pragma mark AudioBox Properties
+
+/*!
+ @enum AudioBox Properties
+ @abstract AudioObjectPropertySelector values provided by the AudioBox class.
+ @discussion The AudioBox class is a subclass of the AudioObject class. The class has just
+ the global scope, kAudioObjectPropertyScopeGlobal, and only a main element.
+ An AudioBox is a container for other objects (typically AudioDevice objects). An
+ AudioBox publishes identifying information about itself and can be enabled or
+ disabled. A box's contents are only available to the system when the box is
+ enabled.
+ @constant kAudioBoxPropertyBoxUID
+ A CFString that contains a persistent identifier for the AudioBox. An
+ AudioBox's UID is persistent across boots. The content of the UID string is
+ a black box and may contain information that is unique to a particular
+ instance of an AudioBox's hardware or unique to the CPU. Therefore they are
+ not suitable for passing between CPUs or for identifying similar models of
+ hardware. The caller is responsible for releasing the returned CFObject.
+ @constant kAudioBoxPropertyTransportType
+ A UInt32 whose value indicates how the AudioBox is connected to the system.
+ Constants for some of the values for this property can be found in the enum
+ in the AudioDevice Constants section of AudioHardwareBase.h
+ @constant kAudioBoxPropertyHasAudio
+ A UInt32 where a non-zero value indicates that the box supports audio.
+ @constant kAudioBoxPropertyHasVideo
+ A UInt32 where a non-zero value indicates that the box supports video.
+ @constant kAudioBoxPropertyHasMIDI
+ A UInt32 where a non-zero value indicates that the box supports MIDI.
+ @constant kAudioBoxPropertyIsProtected
+ A UInt32 where a non-zero value indicates that the box requires
+ authentication to use.
+ @constant kAudioBoxPropertyAcquired
+ A UInt32 where a non-zero value indicates that the box's contents are
+ available to the system.
+ @constant kAudioBoxPropertyAcquisitionFailed
+ An OSStatus that indicates the reason for an attempt to acquire a box
+ failed. Note that this property is primarily used for notifications.
+ @constant kAudioBoxPropertyDeviceList
+ An array of AudioObjectIDs that represent all the AudioDevice objects that
+ came out of the given AudioBox. Note that until a box is enabled, this list
+ will be empty.
+ @constant kAudioBoxPropertyClockDeviceList
+ An array of AudioObjectIDs that represent all the AudioClockDevice objects
+ that came out of the given AudioBox. Note that until a box is enabled, this
+ list will be empty.
+*/
+CF_ENUM(AudioObjectPropertySelector)
+{
+ kAudioBoxPropertyBoxUID = 'buid',
+ kAudioBoxPropertyTransportType = 'tran',
+ kAudioBoxPropertyHasAudio = 'bhau',
+ kAudioBoxPropertyHasVideo = 'bhvi',
+ kAudioBoxPropertyHasMIDI = 'bhmi',
+ kAudioBoxPropertyIsProtected = 'bpro',
+ kAudioBoxPropertyAcquired = 'bxon',
+ kAudioBoxPropertyAcquisitionFailed = 'bxof',
+ kAudioBoxPropertyDeviceList = 'bdv#',
+ kAudioBoxPropertyClockDeviceList = 'bcl#'
+};
+
+//==================================================================================================
+#pragma mark -
+#pragma mark AudioDevice Constants
+
+/*!
+ @enum AudioDevice Class Constants
+ @abstract Various constants related to the AudioDevice class.
+ @constant kAudioDeviceClassID
+ The AudioClassID that identifies the AudioDevice class.
+*/
+CF_ENUM(AudioClassID)
+{
+ kAudioDeviceClassID = 'adev'
+};
+
+/*!
+ @enum Transport Type IDs
+ @abstract Commonly used values for kAudioDevicePropertyTransportType and
+ kAudioTransportManagerPropertyTransportType
+ @constant kAudioDeviceTransportTypeUnknown
+ The transport type ID returned when a device doesn't provide a transport
+ type.
+ @constant kAudioDeviceTransportTypeBuiltIn
+ The transport type ID for AudioDevices built into the system.
+ @constant kAudioDeviceTransportTypeAggregate
+ The transport type ID for aggregate devices.
+ @constant kAudioDeviceTransportTypeAutoAggregate
+ The transport type ID for automatically generated aggregate devices.
+ @constant kAudioDeviceTransportTypeVirtual
+ The transport type ID for AudioDevices that don't correspond to real audio
+ hardware.
+ @constant kAudioDeviceTransportTypePCI
+ The transport type ID for AudioDevices connected via the PCI bus.
+ @constant kAudioDeviceTransportTypeUSB
+ The transport type ID for AudioDevices connected via USB.
+ @constant kAudioDeviceTransportTypeFireWire
+ The transport type ID for AudioDevices connected via FireWire.
+ @constant kAudioDeviceTransportTypeBluetooth
+ The transport type ID for AudioDevices connected via Bluetooth.
+ @constant kAudioDeviceTransportTypeBluetoothLE
+ The transport type ID for AudioDevices connected via Bluetooth Low Energy.
+ @constant kAudioDeviceTransportTypeHDMI
+ The transport type ID for AudioDevices connected via HDMI.
+ @constant kAudioDeviceTransportTypeDisplayPort
+ The transport type ID for AudioDevices connected via DisplayPort.
+ @constant kAudioDeviceTransportTypeAirPlay
+ The transport type ID for AudioDevices connected via AirPlay.
+ @constant kAudioDeviceTransportTypeAVB
+ The transport type ID for AudioDevices connected via AVB.
+ @constant kAudioDeviceTransportTypeThunderbolt
+ The transport type ID for AudioDevices connected via Thunderbolt.
+ @constant kAudioDeviceTransportTypeContinuityCaptureWired
+ The transport type ID for Continuity Capture AudioDevices connected via a
+ cable.
+ @constant kAudioDeviceTransportTypeContinuityCaptureWireless
+ The transport type ID for Continuity Capture AudioDevices connected
+ via wireless networking.
+ @constant kAudioDeviceTransportTypeRemoteScreen
+ The transport type ID for remote screen sharing devices.
+ @constant kAudioDeviceTransportTypeRemoteStreaming
+ The transport type ID for remote high-latency streaming devices.
+*/
+CF_ENUM(UInt32)
+{
+ kAudioDeviceTransportTypeUnknown = 0,
+ kAudioDeviceTransportTypeBuiltIn = 'bltn',
+ kAudioDeviceTransportTypeAggregate = 'grup',
+ kAudioDeviceTransportTypeVirtual = 'virt',
+ kAudioDeviceTransportTypePCI = 'pci ',
+ kAudioDeviceTransportTypeUSB = 'usb ',
+ kAudioDeviceTransportTypeFireWire = '1394',
+ kAudioDeviceTransportTypeBluetooth = 'blue',
+ kAudioDeviceTransportTypeBluetoothLE = 'blea',
+ kAudioDeviceTransportTypeHDMI = 'hdmi',
+ kAudioDeviceTransportTypeDisplayPort = 'dprt',
+ kAudioDeviceTransportTypeAirPlay = 'airp',
+ kAudioDeviceTransportTypeAVB = 'eavb',
+ kAudioDeviceTransportTypeThunderbolt = 'thun',
+ kAudioDeviceTransportTypeContinuityCaptureWired = 'ccwd',
+ kAudioDeviceTransportTypeContinuityCaptureWireless = 'ccwl',
+ kAudioDeviceTransportTypeRemoteScreen = 'rscr',
+ kAudioDeviceTransportTypeRemoteStreaming = 'rstr'
+};
+
+//==================================================================================================
+#pragma mark AudioDevice Properties
+
+/*!
+ @enum AudioDevice Properties
+ @abstract AudioObjectPropertySelector values provided by the AudioDevice class.
+ @discussion The AudioDevice class is a subclass of the AudioObjectClass. The class has four
+ scopes, kAudioObjectPropertyScopeGlobal, kAudioObjectPropertyScopeInput,
+ kAudioObjectPropertyScopeOutput, and kAudioObjectPropertyScopePlayThrough. The
+ class has a main element and an element for each channel in each stream
+ numbered according to the starting channel number of each stream.
+ @constant kAudioDevicePropertyConfigurationApplication
+ A CFString that contains the bundle ID for an application that provides a
+ GUI for configuring the AudioDevice. By default, the value of this property
+ is the bundle ID for Audio MIDI Setup. The caller is responsible for
+ releasing the returned CFObject.
+ @constant kAudioDevicePropertyDeviceUID
+ A CFString that contains a persistent identifier for the AudioDevice. An
+ AudioDevice's UID is persistent across boots. The content of the UID string
+ is a black box and may contain information that is unique to a particular
+ instance of an AudioDevice's hardware or unique to the CPU. Therefore they
+ are not suitable for passing between CPUs or for identifying similar models
+ of hardware. The caller is responsible for releasing the returned CFObject.
+ @constant kAudioDevicePropertyModelUID
+ A CFString that contains a persistent identifier for the model of an
+ AudioDevice. The identifier is unique such that the identifier from two
+ AudioDevices are equal if and only if the two AudioDevices are the exact
+ same model from the same manufacturer. Further, the identifier has to be the
+ same no matter on what machine the AudioDevice appears. The caller is
+ responsible for releasing the returned CFObject.
+ @constant kAudioDevicePropertyTransportType
+ A UInt32 whose value indicates how the AudioDevice is connected to the CPU.
+ Constants for some of the values for this property can be found in the enum
+ in the AudioDevice Constants section of this file.
+ @constant kAudioDevicePropertyRelatedDevices
+ An array of AudioDeviceIDs for devices related to the AudioDevice. For
+ IOAudio-based devices, AudioDevices are related if they share the same
+ IOAudioDevice object.
+ @constant kAudioDevicePropertyClockDomain
+ A UInt32 whose value indicates the clock domain to which this AudioDevice
+ belongs. AudioDevices that have the same value for this property are able to
+ be synchronized in hardware. However, a value of 0 indicates that the clock
+ domain for the device is unspecified and should be assumed to be separate
+ from every other device's clock domain, even if they have the value of 0 as
+ their clock domain as well.
+ @constant kAudioDevicePropertyDeviceIsAlive
+ A UInt32 where a value of 1 means the device is ready and available and 0
+ means the device is unusable and will most likely go away shortly.
+ @constant kAudioDevicePropertyDeviceIsRunning
+ A UInt32 where a value of 0 means the AudioDevice is not performing IO and
+ a value of 1 means that it is. Note that the device can be running even if
+ there are no active IOProcs such as by calling AudioDeviceStart() and
+ passing a NULL IOProc. Note that the notification for this property is
+ usually sent from the AudioDevice's IO thread.
+ @constant kAudioDevicePropertyDeviceCanBeDefaultDevice
+ A UInt32 where 1 means that the AudioDevice is a possible selection for
+ kAudioHardwarePropertyDefaultInputDevice or
+ kAudioHardwarePropertyDefaultOutputDevice depending on the scope.
+ @constant kAudioDevicePropertyDeviceCanBeDefaultSystemDevice
+ A UInt32 where 1 means that the AudioDevice is a possible selection for
+ kAudioHardwarePropertyDefaultSystemOutputDevice.
+ @constant kAudioDevicePropertyLatency
+ A UInt32 containing the number of frames of latency in the AudioDevice. Note
+ that input and output latency may differ. Further, the AudioDevice's
+ AudioStreams may have additional latency so they should be queried as well.
+ If both the device and the stream say they have latency, then the total
+ latency for the stream is the device latency summed with the stream latency.
+ @constant kAudioDevicePropertyStreams
+ An array of AudioStreamIDs that represent the AudioStreams of the
+ AudioDevice. Note that if a notification is received for this property, any
+ cached AudioStreamIDs for the device become invalid and need to be
+ re-fetched.
+ @constant kAudioObjectPropertyControlList
+ An array of AudioObjectIDs that represent the AudioControls of the
+ AudioDevice. Note that if a notification is received for this property, any
+ cached AudioObjectIDs for the device become invalid and need to be
+ re-fetched.
+ @constant kAudioDevicePropertySafetyOffset
+ A UInt32 whose value indicates the number for frames in ahead (for output)
+ or behind (for input the current hardware position that is safe to do IO.
+ @constant kAudioDevicePropertyNominalSampleRate
+ A Float64 that indicates the current nominal sample rate of the AudioDevice.
+ @constant kAudioDevicePropertyAvailableNominalSampleRates
+ An array of AudioValueRange structs that indicates the valid ranges for the
+ nominal sample rate of the AudioDevice.
+ @constant kAudioDevicePropertyIcon
+ A CFURLRef that indicates an image file that can be used to represent the
+ device visually. The caller is responsible for releasing the returned
+ CFObject.
+ @constant kAudioDevicePropertyIsHidden
+ A UInt32 where a non-zero value indicates that the device is not included
+ in the normal list of devices provided by kAudioHardwarePropertyDevices nor
+ can it be the default device. Hidden devices can only be discovered by
+ knowing their UID and using kAudioHardwarePropertyDeviceForUID.
+ @constant kAudioDevicePropertyPreferredChannelsForStereo
+ An array of two UInt32s, the first for the left channel, the second for the
+ right channel, that indicate the channel numbers to use for stereo IO on the
+ device. The value of this property can be different for input and output and
+ there are no restrictions on the channel numbers that can be used.
+ @constant kAudioDevicePropertyPreferredChannelLayout
+ An AudioChannelLayout that indicates how each channel of the AudioDevice
+ should be used.
+ @constant kAudioDevicePropertyWantsControlsRestored
+ A UInt32 where a value of 0 indicates that the controls for the device should not be
+ saved/restored when the device is first published. If the device doesn't implement
+ this property, it is assumed that the settings should be saved and restored.
+ @constant kAudioDevicePropertyWantsStreamFormatsRestored
+ A UInt32 where a value of 0 indicates that the stream formats for the device should
+ not be saved/restored when the device is first published. If the device doesn't
+ implement this property, it is assumed that the settings should be saved and restored.
+*/
+CF_ENUM(AudioObjectPropertySelector)
+{
+ kAudioDevicePropertyConfigurationApplication = 'capp',
+ kAudioDevicePropertyDeviceUID = 'uid ',
+ kAudioDevicePropertyModelUID = 'muid',
+ kAudioDevicePropertyTransportType = 'tran',
+ kAudioDevicePropertyRelatedDevices = 'akin',
+ kAudioDevicePropertyClockDomain = 'clkd',
+ kAudioDevicePropertyDeviceIsAlive = 'livn',
+ kAudioDevicePropertyDeviceIsRunning = 'goin',
+ kAudioDevicePropertyDeviceCanBeDefaultDevice = 'dflt',
+ kAudioDevicePropertyDeviceCanBeDefaultSystemDevice = 'sflt',
+ kAudioDevicePropertyLatency = 'ltnc',
+ kAudioDevicePropertyStreams = 'stm#',
+ kAudioObjectPropertyControlList = 'ctrl',
+ kAudioDevicePropertySafetyOffset = 'saft',
+ kAudioDevicePropertyNominalSampleRate = 'nsrt',
+ kAudioDevicePropertyAvailableNominalSampleRates = 'nsr#',
+ kAudioDevicePropertyIcon = 'icon',
+ kAudioDevicePropertyIsHidden = 'hidn',
+ kAudioDevicePropertyPreferredChannelsForStereo = 'dch2',
+ kAudioDevicePropertyPreferredChannelLayout = 'srnd',
+ kAudioDevicePropertyWantsControlsRestored = 'resc',
+ kAudioDevicePropertyWantsStreamFormatsRestored = 'resf'
+};
+
+//==================================================================================================
+#pragma mark -
+#pragma mark AudioClockDevice Constants
+
+/*!
+ @enum AudioClockDevice Class Constants
+ @abstract Various constants related to the AudioClockDevice class.
+ @constant kAudioClockDeviceClassID
+ The AudioClassID that identifies the AudioClockDevice class.
+*/
+CF_ENUM(AudioObjectPropertySelector)
+{
+ kAudioClockDeviceClassID = 'aclk'
+};
+
+ //==================================================================================================
+#pragma mark AudioClockDevice Properties
+
+/*!
+ @enum AudioClockDevice Properties
+ @abstract AudioObjectPropertySelector values provided by the AudioClockDevice class.
+ @discussion The AudioClockDevice class is a subclass of the AudioObject class. The class has just
+ the global scope, kAudioObjectPropertyScopeGlobal, and only a main element.
+ @constant kAudioClockDevicePropertyDeviceUID
+ A CFString that contains a persistent identifier for the AudioClockDevice.
+ An AudioClockDevice's UID is persistent across boots. The content of the UID
+ string is a black box and may contain information that is unique to a
+ particular instance of an clock's hardware or unique to the CPU. Therefore
+ they are not suitable for passing between CPUs or for identifying similar
+ models of hardware. The caller is responsible for releasing the returned
+ CFObject.
+ @constant kAudioClockDevicePropertyTransportType
+ A UInt32 whose value indicates how the AudioClockDevice is connected to the
+ CPU. Constants for some of the values for this property can be found in the
+ enum in the AudioDevice Constants section of this file.
+ @constant kAudioClockDevicePropertyClockDomain
+ A UInt32 whose value indicates the clock domain to which this
+ AudioClockDevice belongs. AudioClockDevices and AudioDevices that have the
+ same value for this property are able to be synchronized in hardware.
+ However, a value of 0 indicates that the clock domain for the device is
+ unspecified and should be assumed to be separate from every other device's
+ clock domain, even if they have the value of 0 as their clock domain as well.
+ @constant kAudioClockDevicePropertyDeviceIsAlive
+ A UInt32 where a value of 1 means the device is ready and available and 0
+ means the device is usable and will most likely go away shortly.
+ @constant kAudioClockDevicePropertyDeviceIsRunning
+ A UInt32 where a value of 0 means the AudioClockDevice is not providing
+ times and a value of 1 means that it is. Note that the notification for this
+ property is usually sent from the AudioClockDevice's IO thread.
+ @constant kAudioClockDevicePropertyLatency
+ A UInt32 containing the number of frames of latency in the AudioClockDevice.
+ @constant kAudioClockDevicePropertyControlList
+ An array of AudioObjectIDs that represent the AudioControls of the
+ AudioClockDevice. Note that if a notification is received for this property,
+ any cached AudioObjectIDs for the device become invalid and need to be
+ re-fetched.
+ @constant kAudioClockDevicePropertyNominalSampleRate
+ A Float64 that indicates the current nominal sample rate of the
+ AudioClockDevice.
+ @constant kAudioClockDevicePropertyAvailableNominalSampleRates
+ An array of AudioValueRange structs that indicates the valid ranges for the
+ nominal sample rate of the AudioClockDevice.
+*/
+CF_ENUM(AudioObjectPropertySelector)
+{
+ kAudioClockDevicePropertyDeviceUID = 'cuid',
+ kAudioClockDevicePropertyTransportType = 'tran',
+ kAudioClockDevicePropertyClockDomain = 'clkd',
+ kAudioClockDevicePropertyDeviceIsAlive = 'livn',
+ kAudioClockDevicePropertyDeviceIsRunning = 'goin',
+ kAudioClockDevicePropertyLatency = 'ltnc',
+ kAudioClockDevicePropertyControlList = 'ctrl',
+ kAudioClockDevicePropertyNominalSampleRate = 'nsrt',
+ kAudioClockDevicePropertyAvailableNominalSampleRates = 'nsr#'
+};
+//==================================================================================================
+#pragma mark -
+#pragma mark AudioEndPointDevice Constants
+
+/*!
+ @enum AudioEndPointDevice Class Constants
+ @abstract Various constants related to the AudioEndPointDevice class.
+ @constant kAudioEndPointDeviceClassID
+ The AudioClassID that identifies the AudioEndPointDevice class.
+*/
+CF_ENUM(AudioClassID)
+{
+ kAudioEndPointDeviceClassID = 'edev'
+};
+
+/*!
+ @defined kAudioEndPointDeviceUIDKey
+ @discussion The key used in a CFDictionary that describes the composition of an
+ AudioEndPointDevice. The value for this key is a CFString that contains the UID
+ of the AudioEndPointDevice.
+*/
+#define kAudioEndPointDeviceUIDKey "uid"
+
+/*!
+ @defined kAudioEndPointDeviceNameKey
+ @discussion The key used in a CFDictionary that describes the composition of an
+ AudioEndPointDevice. The value for this key is a CFString that contains the
+ human readable name of the AudioEndPointDevice.
+*/
+#define kAudioEndPointDeviceNameKey "name"
+
+/*!
+ @defined kAudioEndPointDeviceEndPointListKey
+ @discussion The key used in a CFDictionary that describes the composition of an
+ AudioEndPointDevice. The value for this key is a CFArray of CFDictionaries that
+ describe each AudioEndPoint in the AudioEndPointDevice. The keys for this
+ CFDictionary are defined in the AudioEndPoint Constants section.
+*/
+#define kAudioEndPointDeviceEndPointListKey "endpoints"
+
+/*!
+ @defined kAudioEndPointDeviceMainEndPointKey
+ @discussion The key used in a CFDictionary that describes the composition of an
+ AudioEndPointDevice. The value for this key is a CFString that contains the UID
+ for the AudioEndPoint that is the time source for the
+ AudioEndPointDevice.
+*/
+#define kAudioEndPointDeviceMainEndPointKey "main"
+
+/*!
+ @defined kAudioEndPointDeviceIsPrivateKey
+ @discussion The key used in a CFDictionary that describes the composition of an
+ AudioEndPointDevice. The value for this key is a CFNumber where a value of 0
+ means that the AudioEndPointDevice is to be published to the entire system and a
+ value of 1 means that the AudioEndPointDevice is private to the process that
+ created it. Note that a private AudioEndPointDevice is not persistent across
+ launches of the process that created it. Note that if this key is not present,
+ it implies that the AudioEndPointDevice is published to the entire system.
+*/
+#define kAudioEndPointDeviceIsPrivateKey "private"
+
+//==================================================================================================
+#pragma mark AudioEndPointDevice Properties
+
+/*!
+ @enum AudioEndPointDevice Properties
+ @abstract AudioObjectPropertySelector values provided by the AudioEndPointDevice class.
+ @discussion AudioEndPointDevice is a subclass of AudioDevice and has the same scope and
+ element structure.
+ @constant kAudioEndPointDevicePropertyComposition
+ A CFDictionary that describes the composition of the AudioEndPointDevice.
+ The keys for this CFDicitionary are defined in the AudioEndPointDevice
+ Constants section. The caller is responsible for releasing the returned
+ CFObject.
+ @constant kAudioEndPointDevicePropertyEndPointList
+ An array of AudioObjectIDs for all the AudioEndPoints in the device.
+ @constant kAudioEndPointDevicePropertyIsPrivate
+ A pid_t where a value of 0 indicates that the device is public and a non-zero
+ value indicates the pid of the process that owns the device.
+*/
+CF_ENUM(AudioObjectPropertySelector)
+{
+ kAudioEndPointDevicePropertyComposition = 'acom',
+ kAudioEndPointDevicePropertyEndPointList = 'agrp',
+ kAudioEndPointDevicePropertyIsPrivate = 'priv'
+};
+
+//==================================================================================================
+#pragma mark -
+#pragma mark AudioEndPoint Constants
+
+/*!
+ @enum AudioEndPoint Class Constants
+ @abstract Various constants related to the AudioEndPoint class.
+ @discussion The AudioEndPoint class is a subclass of AudioDevice class and has the same
+ scope and element structure. However, AudioEndPoint objects do not implement an
+ IO path of their own and as such do not implement any AudioDevice properties
+ associated with the IO path.
+ @constant kAudioEndPointDeviceClassID
+ The AudioClassID that identifies the AudioEndPointDevice class.
+*/
+CF_ENUM(AudioClassID)
+{
+ kAudioEndPointClassID = 'endp'
+};
+
+/*!
+ @defined kAudioEndPointUIDKey
+ @discussion The key used in a CFDictionary that describes the state of an AudioEndPoint in a
+ description dictionary for an AudioEndPointDevice. The value for this key is a
+ CFString that contains the UID for the AudioEndPoint.
+*/
+#define kAudioEndPointUIDKey "uid"
+
+/*!
+ @defined kAudioEndPointNameKey
+ @discussion The key used in a CFDictionary that describes the state of an AudioEndPoint in a
+ description dictionary for an AudioEndPointDevice. The value for this key is a
+ CFString that contains the human readable name of the AudioEndPoint.
+*/
+#define kAudioEndPointNameKey "name"
+
+/*!
+ @defined kAudioEndPointInputChannelsKey
+ @discussion The key used in a CFDictionary that describes the state of an AudioEndPoint in a
+ description dictionary for an AudioEndPointDevice. The value for this key is a
+ CFNumber that indicates the total number of input channels for the
+ AudioEndPoint.
+*/
+#define kAudioEndPointInputChannelsKey "channels-in"
+
+/*!
+ @defined kAudioEndPointOutputChannelsKey
+ @discussion The key used in a CFDictionary that describes the state of an AudioEndPoint in a
+ description dictionary for an AudioEndPointDevice. The value for this key is a
+ CFNumber that indicates the total number of output channels for the
+ AudioEndPoint.
+*/
+#define kAudioEndPointOutputChannelsKey "channels-out"
+
+//==================================================================================================
+#pragma mark -
+#pragma mark AudioStream Types
+
+/*!
+ @struct AudioStreamRangedDescription
+ @abstract This structure allows a specific sample rate range to be associated with an
+ AudioStreamBasicDescription that specifies its sample rate as
+ kAudioStreamAnyRate.
+ @discussion Note that this structure is only used to describe the the available formats
+ for a stream. It is not used for the current format.
+ @field mFormat
+ The AudioStreamBasicDescription that describes the format of the stream.
+ Note that the mSampleRate field of the structure will be the same as the
+ the values in mSampleRateRange when only a single sample rate is supported.
+ It will be kAudioStreamAnyRate when there is a range with more elements.
+ @field mSampleRateRange
+ The AudioValueRange that describes the minimum and maximum sample rate for
+ the stream. If the mSampleRate field of mFormat is kAudioStreamAnyRate the
+ format supports the range of sample rates described by this structure.
+ Otherwise, the minimum will be the same as the maximum which will be the
+ same as the mSampleRate field of mFormat.
+*/
+struct AudioStreamRangedDescription
+{
+ AudioStreamBasicDescription mFormat;
+ AudioValueRange mSampleRateRange;
+};
+typedef struct AudioStreamRangedDescription AudioStreamRangedDescription;
+
+//==================================================================================================
+#pragma mark AudioStream Constants
+
+/*!
+ @enum AudioStream Class Constants
+ @abstract Various constants related to the AudioStream class.
+ @constant kAudioStreamClassID
+ The AudioClassID that identifies the AudioStream class.
+*/
+CF_ENUM(AudioClassID)
+{
+ kAudioStreamClassID = 'astr'
+};
+
+/*!
+ @enum AudioStream Terminal Types
+ @abstract Various constants that describe the terminal type of an AudioStream.
+ @constant kAudioStreamTerminalTypeUnknown
+ The ID used when the terminal type for the AudioStream is non known.
+ @constant kAudioStreamTerminalTypeLine
+ The ID for a terminal type of a line level stream. Note that this applies to
+ both input streams and output streams
+ @constant kAudioStreamTerminalTypeDigitalAudioInterface
+ The ID for a terminal type of stream from/to a digital audio interface as
+ defined by ISO 60958 (aka SPDIF or AES/EBU). Note that this applies to both
+ input streams and output streams
+ @constant kAudioStreamTerminalTypeSpeaker
+ The ID for a terminal type of a speaker.
+ @constant kAudioStreamTerminalTypeHeadphones
+ The ID for a terminal type of headphones.
+ @constant kAudioStreamTerminalTypeLFESpeaker
+ The ID for a terminal type of a speaker for low frequency effects.
+ @constant kAudioStreamTerminalTypeReceiverSpeaker
+ The ID for a terminal type of a speaker on a telephone handset receiver.
+ @constant kAudioStreamTerminalTypeMicrophone
+ The ID for a terminal type of a microphone.
+ @constant kAudioStreamTerminalTypeHeadsetMicrophone
+ The ID for a terminal type of a microphone attached to an headset.
+ @constant kAudioStreamTerminalTypeReceiverMicrophone
+ The ID for a terminal type of a microphone on a telephone handset receiver.
+ @constant kAudioStreamTerminalTypeTTY
+ The ID for a terminal type of a device providing a TTY signal.
+ @constant kAudioStreamTerminalTypeHDMI
+ The ID for a terminal type of a stream from/to an HDMI port.
+ @constant kAudioStreamTerminalTypeDisplayPort
+ The ID for a terminal type of a stream from/to an DisplayPort port.
+*/
+CF_ENUM(UInt32)
+{
+ kAudioStreamTerminalTypeUnknown = 0,
+ kAudioStreamTerminalTypeLine = 'line',
+ kAudioStreamTerminalTypeDigitalAudioInterface = 'spdf',
+ kAudioStreamTerminalTypeSpeaker = 'spkr',
+ kAudioStreamTerminalTypeHeadphones = 'hdph',
+ kAudioStreamTerminalTypeLFESpeaker = 'lfes',
+ kAudioStreamTerminalTypeReceiverSpeaker = 'rspk',
+ kAudioStreamTerminalTypeMicrophone = 'micr',
+ kAudioStreamTerminalTypeHeadsetMicrophone = 'hmic',
+ kAudioStreamTerminalTypeReceiverMicrophone = 'rmic',
+ kAudioStreamTerminalTypeTTY = 'tty_',
+ kAudioStreamTerminalTypeHDMI = 'hdmi',
+ kAudioStreamTerminalTypeDisplayPort = 'dprt'
+};
+
+//==================================================================================================
+#pragma mark AudioStream Properties
+
+/*!
+ @enum AudioStream Properties
+ @abstract AudioObjectPropertySelector values provided by the AudioStream class.
+ @discussion AudioStream is a subclass of AudioObject and has only the single scope,
+ kAudioObjectPropertyScopeGlobal. They have a main element and an element for
+ each channel in the stream numbered upward from 1.
+ @constant kAudioStreamPropertyIsActive
+ A UInt32 where a non-zero value indicates that the stream is enabled and
+ doing IO.
+ @constant kAudioStreamPropertyDirection
+ A UInt32 where a value of 0 means that this AudioStream is an output stream
+ and a value of 1 means that it is an input stream.
+ @constant kAudioStreamPropertyTerminalType
+ A UInt32 whose value describes the general kind of functionality attached
+ to the AudioStream.
+ @constant kAudioStreamPropertyStartingChannel
+ A UInt32 that specifies the first element in the owning device that
+ corresponds to element one of this stream.
+ @constant kAudioStreamPropertyLatency
+ A UInt32 containing the number of frames of latency in the AudioStream. Note
+ that the owning AudioDevice may have additional latency so it should be
+ queried as well. If both the device and the stream say they have latency,
+ then the total latency for the stream is the device latency summed with the
+ stream latency.
+ @constant kAudioStreamPropertyVirtualFormat
+ An AudioStreamBasicDescription that describes the current data format for
+ the AudioStream. The virtual format refers to the data format in which all
+ IOProcs for the owning AudioDevice will perform IO transactions.
+ @constant kAudioStreamPropertyAvailableVirtualFormats
+ An array of AudioStreamRangedDescriptions that describe the available data
+ formats for the AudioStream. The virtual format refers to the data format in
+ which all IOProcs for the owning AudioDevice will perform IO transactions.
+ @constant kAudioStreamPropertyPhysicalFormat
+ An AudioStreamBasicDescription that describes the current data format for
+ the AudioStream. The physical format refers to the data format in which the
+ hardware for the owning AudioDevice performs its IO transactions.
+ @constant kAudioStreamPropertyAvailablePhysicalFormats
+ An array of AudioStreamRangedDescriptions that describe the available data
+ formats for the AudioStream. The physical format refers to the data format
+ in which the hardware for the owning AudioDevice performs its IO
+ transactions.
+*/
+CF_ENUM(AudioObjectPropertySelector)
+{
+ kAudioStreamPropertyIsActive = 'sact',
+ kAudioStreamPropertyDirection = 'sdir',
+ kAudioStreamPropertyTerminalType = 'term',
+ kAudioStreamPropertyStartingChannel = 'schn',
+ kAudioStreamPropertyLatency = kAudioDevicePropertyLatency,
+ kAudioStreamPropertyVirtualFormat = 'sfmt',
+ kAudioStreamPropertyAvailableVirtualFormats = 'sfma',
+ kAudioStreamPropertyPhysicalFormat = 'pft ',
+ kAudioStreamPropertyAvailablePhysicalFormats = 'pfta'
+};
+//==================================================================================================
+#pragma mark -
+#pragma mark AudioControl Constants
+
+/*!
+ @enum AudioControl Class Constants
+ @abstract Various constants related to the AudioControl class.
+ @constant kAudioControlClassID
+ The AudioClassID that identifies the AudioControl class.
+*/
+CF_ENUM(AudioClassID)
+{
+ kAudioControlClassID = 'actl'
+};
+
+/*!
+ @enum AudioControl Property Selectors
+ @abstract AudioObjectPropertySelector values provided by the AudioControl class.
+ @discussion The AudioControl class is a subclass of the AudioObject class.
+ It has the same scopes and elements as its owning device.
+ @constant kAudioControlPropertyScope
+ An AudioObjectPropertyScope that indicates which part of the owning device
+ the control applies to.
+ @constant kAudioControlPropertyElement
+ An AudioObjectPropertyElement that indicates which element of the
+ owning device the control applies to.
+*/
+CF_ENUM(AudioObjectPropertySelector)
+{
+ kAudioControlPropertyScope = 'cscp',
+ kAudioControlPropertyElement = 'celm'
+};
+
+//==================================================================================================
+#pragma mark -
+#pragma mark AudioSliderControl Constants
+
+/*!
+ @enum AudioSliderControl Class Constants
+ @abstract Various constants related to the AudioSliderControl class.
+ @constant kAudioSliderControlClassID
+ The AudioClassID that identifies the AudioSliderControl class.
+*/
+CF_ENUM(AudioClassID)
+{
+ kAudioSliderControlClassID = 'sldr'
+};
+
+/*!
+ @enum AudioSliderControl Property Selectors
+ @abstract AudioObjectPropertySelector values provided by the AudioSliderControl class.
+ @discussion The AudioSliderControl class is a subclass of the AudioControl class and has the
+ same scope and element structure.
+ @constant kAudioSliderControlPropertyValue
+ A UInt32 that represents the value of the slider control.
+ @constant kAudioSliderControlPropertyRange
+ An array of two UInt32s that represents the inclusive range of values the
+ slider control can take.
+*/
+CF_ENUM(AudioObjectPropertySelector)
+{
+ kAudioSliderControlPropertyValue = 'sdrv',
+ kAudioSliderControlPropertyRange = 'sdrr'
+};
+
+//==================================================================================================
+#pragma mark -
+#pragma mark AudioLevelControl Constants
+
+/*!
+ @enum AudioLevelControl Class Constants
+ @abstract Various constants related to the AudioLevelControl class.
+ @constant kAudioLevelControlClassID
+ The AudioClassID that identifies the LevelControl class.
+ @constant kAudioVolumeControlClassID
+ A subclass of the LevelControl class that implements a general
+ gain/attenuation stage.
+ @constant kAudioLFEVolumeControlClassID
+ A subclass of the LevelControl class for an LFE channel that results from
+ bass management. Note that LFE channels that are represented as normal audio
+ channels must use kAudioVolumeControlClassID to manipulate the level.
+*/
+CF_ENUM(AudioClassID)
+{
+ kAudioLevelControlClassID = 'levl',
+ kAudioVolumeControlClassID = 'vlme',
+ kAudioLFEVolumeControlClassID = 'subv'
+};
+
+/*!
+ @enum AudioLevelControl Property Selectors
+ @abstract AudioObjectPropertySelector values provided by the AudioLevelControl class.
+ @discussion The AudioLevelControl class is a subclass of the AudioControl class and has the
+ same scope and element structure.
+ @constant kAudioLevelControlPropertyScalarValue
+ A Float32 that represents the value of the volume control. The range is
+ between 0.0 and 1.0 (inclusive). Note that the set of all Float32 values
+ between 0.0 and 1.0 inclusive is much larger than the set of actual values
+ that the hardware can select. This means that the Float32 range has a many
+ to one mapping with the underlying hardware values. As such, setting a
+ scalar value will result in the control taking on the value nearest to what
+ was set.
+ @constant kAudioLevelControlPropertyDecibelValue
+ A Float32 that represents the value of the volume control in dB. Note that
+ the set of all Float32 values in the dB range for the control is much larger
+ than the set of actual values that the hardware can select. This means that
+ the Float32 range has a many to one mapping with the underlying hardware
+ values. As such, setting a dB value will result in the control taking on the
+ value nearest to what was set.
+ @constant kAudioLevelControlPropertyDecibelRange
+ An AudioValueRange that contains the minimum and maximum dB values the
+ control can have.
+ @constant kAudioLevelControlPropertyConvertScalarToDecibels
+ A Float32 that on input contains a scalar volume value for the and on exit
+ contains the equivalent dB value.
+ @constant kAudioLevelControlPropertyConvertDecibelsToScalar
+ A Float32 that on input contains a dB volume value for the and on exit
+ contains the equivalent scalar value.
+*/
+CF_ENUM(AudioObjectPropertySelector)
+{
+ kAudioLevelControlPropertyScalarValue = 'lcsv',
+ kAudioLevelControlPropertyDecibelValue = 'lcdv',
+ kAudioLevelControlPropertyDecibelRange = 'lcdr',
+ kAudioLevelControlPropertyConvertScalarToDecibels = 'lcsd',
+ kAudioLevelControlPropertyConvertDecibelsToScalar = 'lcds'
+};
+
+//==================================================================================================
+#pragma mark -
+#pragma mark AudioBooleanControl Constants
+
+/*!
+ @enum AudioBooleanControl Class Constants
+ @abstract Various constants related to the AudioBooleanControl class.
+ @constant kAudioBooleanControlClassID
+ The AudioClassID that identifies the BooleanControl class.
+ @constant kAudioMuteControlClassID
+ A subclass of the AudioBooleanControl class where a true value means that
+ mute is enabled making that element inaudible.
+ @constant kAudioSoloControlClassID
+ A subclass of the AudioBooleanControl class where a true value means that
+ solo is enabled making just that element audible and the other elements
+ inaudible.
+ @constant kAudioJackControlClassID
+ A subclass of the AudioBooleanControl class where a true value means
+ something is plugged into that element.
+ @constant kAudioLFEMuteControlClassID
+ A subclass of the AudioBooleanControl class where true means that mute is
+ enabled making that LFE element inaudible. This control is for LFE channels
+ that result from bass management. Note that LFE channels that are
+ represented as normal audio channels must use an AudioMuteControl.
+ @constant kAudioPhantomPowerControlClassID
+ A subclass of the AudioBooleanControl class where true means that the
+ element's hardware has phantom power enabled.
+ @constant kAudioPhaseInvertControlClassID
+ A subclass of the AudioBooleanControl class where true means that the phase
+ of the signal on the given element is being inverted by 180 degrees.
+ @constant kAudioClipLightControlClassID
+ A subclass of the AudioBooleanControl class where true means that the signal
+ for the element has exceeded the sample range. Once a clip light is turned
+ on, it is to stay on until either the value of the control is set to false
+ or the current IO session stops and a new IO session starts.
+ @constant kAudioTalkbackControlClassID
+ An AudioBooleanControl where true means that the talkback channel is
+ enabled. This control is for talkback channels that are handled outside of
+ the regular IO channels. If the talkback channel is among the normal IO
+ channels, it will use AudioMuteControl.
+ @constant kAudioListenbackControlClassID
+ An AudioBooleanControl where true means that the listenback channel is
+ audible. This control is for listenback channels that are handled outside of
+ the regular IO channels. If the listenback channel is among the normal IO
+ channels, it will use AudioMuteControl.
+*/
+CF_ENUM(AudioClassID)
+{
+ kAudioBooleanControlClassID = 'togl',
+ kAudioMuteControlClassID = 'mute',
+ kAudioSoloControlClassID = 'solo',
+ kAudioJackControlClassID = 'jack',
+ kAudioLFEMuteControlClassID = 'subm',
+ kAudioPhantomPowerControlClassID = 'phan',
+ kAudioPhaseInvertControlClassID = 'phsi',
+ kAudioClipLightControlClassID = 'clip',
+ kAudioTalkbackControlClassID = 'talb',
+ kAudioListenbackControlClassID = 'lsnb'
+};
+
+/*!
+ @enum AudioBooleanControl Property Selectors
+ @abstract AudioObjectPropertySelector values provided by the AudioBooleanControl class.
+ @discussion The AudioBooleanControl class is a subclass of the AudioControl class and has
+ the same scope and element structure.
+ @constant kAudioBooleanControlPropertyValue
+ A UInt32 where 0 means off/false and non-zero means on/true.
+*/
+CF_ENUM(AudioObjectPropertySelector)
+{
+ kAudioBooleanControlPropertyValue = 'bcvl'
+};
+
+//==================================================================================================
+#pragma mark -
+#pragma mark AudioSelectorControl Constants
+
+/*!
+ @enum AudioSelectorControl Class Constants
+ @abstract Various constants related to the AudioSelectorControl class.
+ @constant kAudioSelectorControlClassID
+ The AudioClassID that identifies the AudioSelectorControl class.
+ @constant kAudioDataSourceControlClassID
+ A subclass of the AudioSelectorControl class that identifies where the data
+ for the element is coming from.
+ @constant kAudioDataDestinationControlClassID
+ A subclass of the AudioSelectorControl class that identifies where the data
+ for the element is going.
+ @constant kAudioClockSourceControlClassID
+ A subclass of the AudioSelectorControl class that identifies where the
+ timing info for the object is coming from.
+ @constant kAudioLineLevelControlClassID
+ A subclass of the AudioSelectorControl class that identifies the nominal
+ line level for the element. Note that this is not a gain stage but rather
+ indicating the voltage standard (if any) used for the element, such as
+ +4dBu, -10dBV, instrument, etc.
+ @constant kAudioHighPassFilterControlClassID
+ A subclass of the AudioSelectorControl class that indicates the setting for
+ the high pass filter on the given element.
+*/
+CF_ENUM(AudioClassID)
+{
+ kAudioSelectorControlClassID = 'slct',
+ kAudioDataSourceControlClassID = 'dsrc',
+ kAudioDataDestinationControlClassID = 'dest',
+ kAudioClockSourceControlClassID = 'clck',
+ kAudioLineLevelControlClassID = 'nlvl',
+ kAudioHighPassFilterControlClassID = 'hipf'
+};
+
+/*!
+ @enum AudioSelectorControl Property Selectors
+ @abstract AudioObjectPropertySelector values provided by the AudioSelectorControl class.
+ @discussion The AudioSelectorControl class is a subclass of the AudioControl class and has
+ the same scope and element structure.
+ @constant kAudioSelectorControlPropertyCurrentItem
+ An array of UInt32s that are the IDs of the items currently selected.
+ @constant kAudioSelectorControlPropertyAvailableItems
+ An array of UInt32s that represent the IDs of all the items available.
+ @constant kAudioSelectorControlPropertyItemName
+ This property translates the given item ID into a human readable name. The
+ qualifier contains the ID of the item to be translated and name is returned
+ as a CFString as the property data. The caller is responsible for releasing
+ the returned CFObject.
+ @constant kAudioSelectorControlPropertyItemKind
+ This property returns a UInt32 that identifies the kind of selector item the
+ item ID refers to. The qualifier contains the ID of the item. Note that this
+ property is optional for selector controls and that the meaning of the value
+ depends on the specific subclass being queried.
+*/
+CF_ENUM(AudioObjectPropertySelector)
+{
+ kAudioSelectorControlPropertyCurrentItem = 'scci',
+ kAudioSelectorControlPropertyAvailableItems = 'scai',
+ kAudioSelectorControlPropertyItemName = 'scin',
+ kAudioSelectorControlPropertyItemKind = 'clkk'
+};
+
+/*!
+ @enum Constants for the value of the property, kAudioSelectorControlPropertyItemKind
+ for any selector control item
+ @constant kAudioSelectorControlItemKindSpacer
+ This ID represents an item in a selector control's range that represents a
+ spacer item in a pop-up menu. Items with this kind are not be selectable.
+*/
+CF_ENUM(UInt32)
+{
+ kAudioSelectorControlItemKindSpacer = 'spcr'
+};
+
+/*!
+ @enum Constants for the value of the property, kAudioSelectorControlPropertyItemKind
+ for AudioClockSourceControls.
+ @constant kAudioClockSourceItemKindInternal
+ This ID represents the device's internal clock.
+*/
+CF_ENUM(UInt32)
+{
+ kAudioClockSourceItemKindInternal = 'int '
+};
+
+//==================================================================================================
+#pragma mark -
+#pragma mark AudioStereoPanControl Constants
+
+/*!
+ @enum AudioStereoPanControl Class Constants
+ @abstract Various constants related to the AudioStereoPanControl class.
+ @constant kAudioStereoPanControlClassID
+ The AudioClassID that identifies the StereoPanControl class.
+*/
+CF_ENUM(AudioClassID)
+{
+ kAudioStereoPanControlClassID = 'span'
+};
+
+/*!
+ @enum AudioStereoPanControl Property Selectors
+ @abstract AudioObjectPropertySelector values provided by the AudioStereoPanControl class.
+ @discussion The AudioStereoPanControl class is a subclass of the AudioControl class and has
+ the same scope and element structure.
+ @constant kAudioStereoPanControlPropertyValue
+ A Float32 where 0.0 is full left, 1.0 is full right, and 0.5 is center.
+ @constant kAudioStereoPanControlPropertyPanningChannels
+ An array of two UInt32s that indicate which elements of the device the
+ signal is being panned between.
+*/
+CF_ENUM(AudioObjectPropertySelector)
+{
+ kAudioStereoPanControlPropertyValue = 'spcv',
+ kAudioStereoPanControlPropertyPanningChannels = 'spcc'
+};
+
+//==================================================================================================
+
+#if defined(__cplusplus)
+}
+#endif
+
+CF_ASSUME_NONNULL_END
+
+#endif // CoreAudio_AudioHardwareBase_h
diff -ruN /Applications/Xcode_26.5.0.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS.sdk/System/Library/Frameworks/CoreAudio.framework/Headers/AudioServerPlugIn.h /Applications/Xcode_27.0.0-beta.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS.sdk/System/Library/Frameworks/CoreAudio.framework/Headers/AudioServerPlugIn.h
--- /Applications/Xcode_26.5.0.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS.sdk/System/Library/Frameworks/CoreAudio.framework/Headers/AudioServerPlugIn.h 1969-12-31 19:00:00
+++ /Applications/Xcode_27.0.0-beta.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS.sdk/System/Library/Frameworks/CoreAudio.framework/Headers/AudioServerPlugIn.h 2026-05-22 04:27:41
@@ -0,0 +1,1193 @@
+/*==================================================================================================
+ File: CoreAudio/AudioServerPlugIn.h
+
+ Copyright: (c) 1985-2025 by Apple Inc., all rights reserved.
+
+ Bugs?: For bug reports, consult the following page on
+ the World Wide Web:
+
+ http://developer.apple.com/bugreporter/
+
+==================================================================================================*/
+#if !defined(CoreAudio_AudioServerPlugIn_h)
+#define CoreAudio_AudioServerPlugIn_h
+
+//==================================================================================================
+#pragma mark -
+#pragma mark Overview
+/*!
+ @header AudioServerPlugIn
+
+ An AudioServerPlugIn on macOS is a CFPlugIn that is loaded by the host process as a driver.
+ The plug-in bundle is installed in /Library/Audio/Plug-Ins/HAL. The bundle's name has the suffix
+ ".driver". When loading the plug-in, the host looks for factories with the plug-in type,
+ kAudioServerPlugInTypeUUID. The plug-in provides an object that conforms to the interface,
+ kAudioServerPlugInDriverInterfaceUUID.
+
+ An AudioServerPlugIn can provide the host with information that describes the conditions that
+ must be met to load the plug-in. This is done through plug-in bundle's info.plist in a key named
+ "AudioServerPlugIn_LoadingConditions". The value of this key is a dictionary whose keys describe
+ the loading conditions for the plug-in. Currently, the only defined key is named
+ "IOService Matching" whose value is an array of IOService matching dictionaries. The host will
+ load the plug-in if any of these matching dictionaries match an IOService.
+
+ An AudioServerPlugIn operates in its own process separate from the system daemon. First and
+ foremost, an AudioServerPlugIn may not make any calls to the client HAL API in the
+ CoreAudio.framework. This will result in undefined (but generally bad) behavior.
+
+ Further, the host process is sandboxed. As such, an AudioServerPlugIn may only read files in its
+ bundle in addition to the system libraries and frameworks. It may not access user documents or
+ write to any filesystem locations other than the system's cache and temporary directories as
+ derived through Apple API. The host provides a means for the plug-in to store and retrieve data
+ from persistent storage.
+
+ An AudioServerPlugIn may communicate with other processes on the system. However, the plug-in
+ must list the name of the mach services to be accessed in the plug-in bundle's info.plist in a
+ key named "AudioServerPlugIn_MachServices". The value of this key is an array of the names of
+ the mach services that need to be accessed.
+
+ An AudioServerPlugIn may create user-clients via IOServiceOpen() for standard IOKit objects
+ without restriction. However, if a plug-in needs to create a custom user-client, it must list
+ the name of the class of the user-client in the plug-in bundle's info.plist in a key named
+ "AudioServerPlugIn_IOKitUserClients". The value of this key is an array of the names of the
+ classes.
+
+ An AudioServerPlugIn may also use network resources. However, the plug-in must declare this in
+ its bundle's info.plist with the key named, "AudioServerPlugIn_Network". The value of this key
+ is a boolean and must be set to true if the key is present.
+
+ An AudioServerPlugIn provides the same property-based object model as the HAL's client
+ framework. The basic objects and properties are defined in <CoreAudio/AudioHardwareBase.h> and
+ are supplemented with properties declared here. The plug-in is responsible for defining the
+ AudioObjectIDs to be used as handles for the AudioObjects the plug-in provides. However, the
+ AudioObjectID for the one and only AudioPlugIn object must be kAudioObjectPlugInObject.
+
+ When the state of an AudioObject implemented by the plug-in changes, it notifies the host using
+ the host routine, PropertiesChanged(). The only exception to this is for AudioDevice objects.
+ AudioDevices may call the host's PropertiesChanged() routine only for state changes that don't
+ have any effect on IO or on the structure of the AudioDevice, such as a change to the value of a
+ volume control.
+
+ For changes to an AudioDevice's state that will affect IO or its structure, the change may not
+ be made without first making a call to the host's RequestDeviceConfigurationChange() routine.
+ This allows the host an opportunity to stop any outstanding IO and otherwise return the device
+ to its ground state. The host will inform the plug-in that it is safe to make the change by
+ calling the plug-in routine, PerformDeviceConfigurationChange(). It is only at this point that
+ the device can make the state change. When PerformDeviceConfigurationChange() returns, the host
+ will figure out what changed and restart any outstanding IO.
+
+ The host is in control of IO. It tells the plug-in's AudioDevice when to start and when to stop
+ the hardware. The host drives its timing using the timestamps provided by the AudioDevice's
+ implementation of GetZeroTimeStamp(). The series of timestamps provides a mapping between the
+ device's sample time and mach_absolute_time().
+
+ The host provides the plug-in's device access to several tap points into the system's mix engine
+ to allow for a variety of features, including adding processing to the signal. The host breaks
+ these tap points down into IO operations that the host asks the plug-in to perform at the
+ appropriate time. Prior to starting IO, the host will ask the plug-in which operations are to be
+ performed. Note that the IO operations are performed on a real time thread on a deadline. As
+ such the plug-in must avoid avoid blocking and return as quickly as possible.
+
+ An AudioServerPlugIn can talk to a DriverKit-based Driver Extension. To do so requires adjusting
+ the packaging of the CFPlugIn bundle slightly in order to carry the required entitlements. This
+ requires turning the AudioServerPlugIn bundle into an executable. Coding the AudioServerPlugIn
+ is the same as described above but there are some additional packaging changes to make:
+ - Add the "Load As Application" key with the value of the number 1 to the
+ AudioServerPlugIn's info.plist.
+ - Export the symbol for the plug-in's factory function using a .exp file or other mechanism.
+ - Set the "Mach-O Type" build setting for the target to Executable.
+ - Add "-e _AudioServerPlugInMain" to the "Other Linker Flags" build setting and link
+ against CoreAudio.framework.
+ - Code sign the binary such that it includes the
+ "com.apple.developer.driverkit.userclient-access" entitlements necessary for talking to
+ the Driver Extension.
+*/
+
+//==================================================================================================
+#pragma mark -
+#pragma mark Includes
+
+#include <CoreAudioTypes/CoreAudioTypes.h>
+#include <CoreAudio/AudioHardwareBase.h>
+#include <CoreFoundation/CoreFoundation.h>
+#if COREFOUNDATION_CFPLUGINCOM_SEPARATE
+ #include <CoreFoundation/CFPlugInCOM.h>
+#endif
+
+//==================================================================================================
+
+CF_ASSUME_NONNULL_BEGIN
+
+#if defined(__cplusplus)
+extern "C"
+{
+#endif
+
+//==================================================================================================
+#pragma mark -
+#pragma mark Types
+
+/*!
+ @typedef AudioServerPlugInHostInterface
+ @abstract Forward declaration of AudioServerPlugInHostInterface.
+*/
+typedef struct AudioServerPlugInHostInterface AudioServerPlugInHostInterface;
+
+/*!
+ @typedef AudioServerPlugInHostRef
+ @abstract A reference to an AudioServerPlugInHostInterface.
+*/
+typedef const AudioServerPlugInHostInterface* AudioServerPlugInHostRef;
+
+/*!
+ @typedef AudioServerPlugInDriverInterface
+ @abstract Forward declaration of AudioServerPlugInDriverInterface.
+*/
+typedef struct AudioServerPlugInDriverInterface AudioServerPlugInDriverInterface;
+
+/*!
+ @typedef AudioServerPlugInDriverRef
+ @abstract A reference to an AudioServerPlugInDriverInterface.
+*/
+typedef AudioServerPlugInDriverInterface* __nullable * AudioServerPlugInDriverRef;
+
+/*!
+ @struct AudioServerPlugInCustomPropertyInfo
+ @abstract The AudioServerPlugInCustomPropertyInfo struct is used to describe enough about
+ a custom property to allow the Host to marshal the data between the Host and
+ its clients.
+ @field mSelector
+ The AudioObjectPropertySelector of the custom property.
+ @field mPropertyDataType
+ A UInt32 whose value indicates the data type of the data of the custom
+ property. Constants for this value are defined in the Basic Constants
+ section.
+ @field mQualifierDataType
+ A UInt32 whose value indicates the data type of the data of the custom
+ property. Constants for this value are defined in the Basic Constants
+ section.
+*/
+struct AudioServerPlugInCustomPropertyInfo
+{
+ AudioObjectPropertySelector mSelector;
+ UInt32 mPropertyDataType;
+ UInt32 mQualifierDataType;
+};
+typedef struct AudioServerPlugInCustomPropertyInfo AudioServerPlugInCustomPropertyInfo;
+
+/*!
+ @struct AudioServerPlugInClientInfo
+ @abstract The AudioServerPlugInClientInfo struct is used to identify a client of the Host
+ to the plug-in.
+ @field mClientID
+ An ID that allows for differentiating multiple clients in the same process.
+ This ID is passed to the plug-in during IO so that the plug-in can associate
+ the IO with the client easily.
+ @field mProcessID
+ The pid_t of the process that contains the client.
+ @field mIsNativeEndian
+ A Boolean indicating whether or not the client has the same endianness as
+ the server.
+ @field mBundleID
+ A CFStringRef that contains the bundle ID of the main bundle of the process
+ that contains the client. Note that the plug-in is expected to retain this
+ string itself if the plug-in wishes to keep it around.
+*/
+struct AudioServerPlugInClientInfo
+{
+ UInt32 mClientID;
+ pid_t mProcessID;
+ Boolean mIsNativeEndian;
+ CFStringRef __nullable mBundleID;
+};
+typedef struct AudioServerPlugInClientInfo AudioServerPlugInClientInfo;
+
+/*!
+ @struct AudioServerPlugInIOCycleInfo
+ @abstract This structure holds the common items passed to all the plug-in's IO routines to
+ describe an IO cycle
+ @field mCycleCounter
+ The cycle ordinal number. This number starts at 1 for the first IO cycle and
+ increments for each subsequent IO cycle. The count will recycle back to 1
+ whenever the IO thread resynchronizes with the hardware.
+ @field mNominalIOBufferFrameSize
+ The number of sample frames that will nominally be read/written in the new
+ IO cycle. Note that the actual IO buffers that get read/written might be a
+ different size depending on whether or not any drift compensation is being
+ applied by the Host.
+ @field mInputTime
+ The time stamp that indicates from where in the device's time line the input
+ data for the new IO cycle will start at.
+ @field mOutputTime
+ The time stamp that indicates from where in the device's time line the output
+ data for the new IO cycle will start at.
+ @field mMainHostTicksPerFrame
+ The number of host ticks per frame that the Host's clock is measuring for
+ the main device.
+ @field mDeviceHostTicksPerFrame
+ The number of host ticks per frame that the Host's clock is measuring for
+ this device. Note that this value will be equal to the main value for
+ clockless devices or when the device is the main device in an aggregate.
+*/
+struct AudioServerPlugInIOCycleInfo
+{
+ UInt64 mIOCycleCounter;
+ UInt32 mNominalIOBufferFrameSize;
+ AudioTimeStamp mCurrentTime;
+ AudioTimeStamp mInputTime;
+ AudioTimeStamp mOutputTime;
+ Float64 mMainHostTicksPerFrame;
+ Float64 mDeviceHostTicksPerFrame;
+};
+typedef struct AudioServerPlugInIOCycleInfo AudioServerPlugInIOCycleInfo;
+
+//==================================================================================================
+#pragma mark -
+#pragma mark Basic Constants
+
+/*!
+ @defined kAudioServerPlugInTypeUUID
+ @abstract The UUID of the plug-in type (443ABAB8-E7B3-491A-B985-BEB9187030DB).
+*/
+#define kAudioServerPlugInTypeUUID CFUUIDGetConstantUUIDWithBytes(NULL, 0x44, 0x3A, 0xBA, 0xB8, 0xE7, 0xB3, 0x49, 0x1A, 0xB9, 0x85, 0xBE, 0xB9, 0x18, 0x70, 0x30, 0xDB)
+
+/*!
+ @enum Predefined AudioObjectID values
+ @abstract ObjectIDs that are always the same
+ @constant kAudioObjectPlugInObject
+ The AudioObjectID that always refers to the one and only instance of the
+ AudioPlugIn for the plug-in.
+*/
+CF_ENUM(AudioObjectID)
+{
+ kAudioObjectPlugInObject = 1
+};
+
+/*!
+ @enum Predefined client ID values
+ @constant kAudioServerPlugInHostClientID
+ No actual client will have this value as its ID. It is only used when the
+ Host is making a request on its own behalf.
+*/
+CF_ENUM(AudioObjectID)
+{
+ kAudioServerPlugInHostClientID = 0
+};
+
+/*!
+ @enum Custom Property Data Types
+ @abstract The set of data types the Host knows how to marshal between the server and the
+ client. These are the only types supported for custom properties. See
+ AudioServerPlugInCustomPropertyInfo for more information.
+ @constant kAudioServerPlugInCustomPropertyDataTypeNone
+ This is used to declare that the property doesn't have any property or
+ qualifier data.
+ @constant kAudioServerPlugInCustomPropertyDataTypeCFString
+ The property/qualifier data is a CFStringRef.
+ @constant kAudioServerPlugInCustomPropertyDataTypeCFPropertyList
+ The property/qualifier data is a CFPropertyListRef.
+*/
+typedef UInt32 AudioServerPlugInCustomPropertyDataType;
+CF_ENUM(AudioServerPlugInCustomPropertyDataType)
+{
+ kAudioServerPlugInCustomPropertyDataTypeNone = 0,
+ kAudioServerPlugInCustomPropertyDataTypeCFString = 'cfst',
+ kAudioServerPlugInCustomPropertyDataTypeCFPropertyList = 'plst'
+};
+
+/*!
+ @enum IO Operation IDs
+ @abstract The valid values for the inOperationID argument to the various IO methods.
+ @constant kAudioServerPlugInIOOperationThread
+ This operation marks the beginning and the ending of the IO thread. Note
+ that DoIOOperation() will never be called with this ID.
+ @constant kAudioServerPlugInIOOperationCycle
+ This operation marks the beginning and ending of each IO cycle. Note that
+ DoIOOperation() will never be called with this ID.
+ @constant kAudioServerPlugInIOOperationReadInput
+ This operation transfers the input data from the device's ring buffer to the
+ provided buffer in the stream's native format. Note that this operation
+ always happens in-place in the main buffer passed to DoIOOperation(). It is
+ required that this operation be implemented if the AudioDevice has input
+ streams.
+ @constant kAudioServerPlugInIOOperationConvertInput
+ This operation converts the input data from its native format to the
+ canonical format.
+ @constant kAudioServerPlugInIOOperationProcessInput
+ This operation performs arbitrary signal processing on the input data in the
+ canonical format.
+ @constant kAudioServerPlugInIOOperationProcessOutput
+ This operation performs arbitrary signal processing on the output data in
+ the canonical format.
+ @constant kAudioServerPlugInIOOperationMixOutput
+ This operation mixes the output data into the device's ring buffer. Note
+ that if a plug-in implements this operation, no further output operations
+ will occur for that cycle. It is assumed that the device handles everything
+ from there down including preparing the data for consumption by the
+ hardware. Note also that this operation always happens in-place in the main
+ buffer passed to DoIOOperation().
+ @constant kAudioServerPlugInIOOperationProcessMix
+ This operation processes the full mix of all clients' data in the canonical
+ format.
+ @constant kAudioServerPlugInIOOperationConvertMix
+ This operation converts the fully mixed data from the canonical format to
+ the device's native format.
+ @constant kAudioServerPlugInIOOperationWriteMix
+ This operation puts the data into the device's ring buffer for consumption
+ of the hardware. Note that this operation always happens in-place in the
+ main buffer passed to DoIOOperation(). It is required that this operation be
+ implemented if the AudioDevice has output streams.
+*/
+typedef CF_ENUM(UInt32, AudioServerPlugInIOOperation)
+{
+ kAudioServerPlugInIOOperationThread = 'thrd',
+ kAudioServerPlugInIOOperationCycle = 'cycl',
+ kAudioServerPlugInIOOperationReadInput = 'read',
+ kAudioServerPlugInIOOperationConvertInput = 'cinp',
+ kAudioServerPlugInIOOperationProcessInput = 'pinp',
+ kAudioServerPlugInIOOperationProcessOutput = 'pout',
+ kAudioServerPlugInIOOperationMixOutput = 'mixo',
+ kAudioServerPlugInIOOperationProcessMix = 'pmix',
+ kAudioServerPlugInIOOperationConvertMix = 'cmix',
+ kAudioServerPlugInIOOperationWriteMix = 'rite'
+};
+
+//==================================================================================================
+#pragma mark -
+#pragma mark AudioObject Properties
+
+/*!
+ @enum AudioObject Property Selectors
+ @abstract AudioObjectPropertySelector values provided by objects of the AudioObject class.
+ @discussion The AudioObject class is the base class for all classes. As such, all classes
+ inherit this set of properties.
+ @constant kAudioObjectPropertyCustomPropertyInfoList
+ An array of AudioServerPlugInCustomPropertyInfo that describe the custom
+ properties the object has.
+*/
+CF_ENUM(AudioObjectPropertySelector)
+{
+ kAudioObjectPropertyCustomPropertyInfoList = 'cust'
+};
+
+//==================================================================================================
+#pragma mark -
+#pragma mark AudioPlugIn Properties
+
+/*!
+ @enum AudioPlugIn Class Constants
+ @abstract Various constants related to the AudioPlugIn class.
+ @constant kAudioPlugInPropertyResourceBundle
+ A CFString that contains a path to a resource bundle to use for localizing
+ strings and fetching resources like icons from the client process. The path
+ is relative to the path of the plug-in's bundle. The caller is responsible
+ for releasing the returned CFObject.
+*/
+CF_ENUM(AudioObjectPropertySelector)
+{
+ kAudioPlugInPropertyResourceBundle = 'rsrc'
+};
+
+//==================================================================================================
+#pragma mark -
+#pragma mark Device Constants
+
+/*!
+ @enum Clock Smoothing Algorithm Selectors
+ @abstract The valid values for kAudioDevicePropertyClockAlgorithm
+ @constant kAudioDeviceClockAlgorithmRaw
+ When this value for the clock algorithm is specified, the Host will not
+ apply any filtering to the time stamps returned from GetZeroTimeStamp(). The
+ values will be used as-is.
+ @constant kAudioDeviceClockAlgorithmSimpleIIR
+ When this value for the clock algorithm is specified, the Host applies a
+ simple IIR filter to the time stamp stream. This is the default algorithm
+ used for devices that don't implement kAudioDevicePropertyClockAlgorithm.
+ @constant kAudioDeviceClockAlgorithm12PtMovingWindowAverage
+ This clock algorithm uses a 12 point moving window average to filter the time
+ stamps returned from GetZeroTimeStamp().
+*/
+typedef CF_ENUM(UInt32, AudioDeviceClockAlgorithmSelector)
+{
+ kAudioDeviceClockAlgorithmRaw = 'raww',
+ kAudioDeviceClockAlgorithmSimpleIIR = 'iirf',
+ kAudioDeviceClockAlgorithm12PtMovingWindowAverage = 'mavg'
+};
+
+//==================================================================================================
+#pragma mark Device Properties
+
+/*!
+ @enum AudioDevice Properties
+ @abstract AudioObjectPropertySelector values provided by the AudioDevice class.
+ @discussion The AudioDevice class is a subclass of the AudioObjectClass. The class has four
+ scopes, kAudioObjectPropertyScopeGlobal, kAudioObjectPropertyScopeInput,
+ kAudioObjectPropertyScopeOutput, and kAudioObjectPropertyScopePlayThrough. The
+ class has a main element and an element for each channel in each stream
+ numbered according to the starting channel number of each stream.
+ @constant kAudioDevicePropertyZeroTimeStampPeriod
+ A UInt32 whose value indicates the number of sample frames the host can
+ expect between successive time stamps returned from GetZeroTimeStamp(). In
+ other words, if GetZeroTimeStamp() returned a sample time of X, the host can
+ expect that the next valid time stamp that will be returned will be X plus
+ the value of this property. The minimum allowed value for this is 10923 sample frames.
+ @constant kAudioDevicePropertyClockAlgorithm
+ A UInt32 whose value indicates to the Host what smoothing algorithm to use
+ for a device's clock. The only legal values for this property are specified
+ in the enum below.
+ @constant kAudioDevicePropertyClockIsStable
+ A UInt32 where a non-zero value indicates that the device's clock runs at or
+ very near the nominal rate with only small variations. If this property is
+ not implemented, it is assumed that the device's clock is stable.
+*/
+CF_ENUM(AudioObjectPropertySelector)
+{
+ kAudioDevicePropertyZeroTimeStampPeriod = 'ring',
+ kAudioDevicePropertyClockAlgorithm = 'clok',
+ kAudioDevicePropertyClockIsStable = 'cstb'
+};
+
+//==================================================================================================
+#pragma mark -
+#pragma mark AudioServerPlugInHostInterface
+
+/*!
+ @interface AudioServerPlugInHostInterface
+ @abstract The interface that audio server plug-ins use to communicate with the Host.
+*/
+struct AudioServerPlugInHostInterface
+{
+
+#pragma mark Property Operations
+
+ /*!
+ @method PropertiesChanged
+ @abstract This method informs the Host when the state of an plug-in's object changes.
+ @discussion Note that for Device objects, this method is only used for state changes
+ that don't affect IO or the structure of the device.
+ @param inHost
+ The AudioServerPlugInHostRef passed to the plug-in at initialization.
+ @param inObjectID
+ The AudioObjectID of the object whose state has changed.
+ @param inNumberAddresses
+ The number of elements in the inAddresses array.
+ @param inAddresses
+ An array of AudioObjectPropertyAddresses for the changed properties.
+ @result An OSStatus indicating success or failure.
+ */
+ OSStatus
+ (*PropertiesChanged)( AudioServerPlugInHostRef inHost,
+ AudioObjectID inObjectID,
+ UInt32 inNumberAddresses,
+ const AudioObjectPropertyAddress* inAddresses);
+
+#pragma mark Storage Operations
+
+ /*!
+ @method CopyFromStorage
+ @abstract This method will fetch the data associated with the named storage key.
+ @param inHost
+ The AudioServerPlugInHostRef passed to the plug-in at initialization.
+ @param inKey
+ A CFStringRef that contains the name of the key whose data is to be
+ fetched. Note that the Host will make sure that the keys for one plug-in
+ do not collide with the keys for other plug-ins.
+ @param outData
+ The data associated with the named storage key in the form of
+ CFPropertyList. The caller is responsible for releasing the returned
+ CFObject.
+ @result An OSStatus indicating success or failure.
+ */
+ OSStatus
+ (*CopyFromStorage)( AudioServerPlugInHostRef inHost,
+ CFStringRef inKey,
+ CFPropertyListRef __nullable * __nonnull outData);
+
+ /*!
+ @method WriteToStorage
+ @abstract This method will associate the given data with the named storage key,
+ replacing any existing data.
+ @discussion Note that any data stored this way is persists beyond the life span of the
+ Host including across rebooting.
+ @param inHost
+ The AudioServerPlugInHostRef passed to the plug-in at initialization.
+ @param inKey
+ A CFStringRef that contains the name of the key whose data is to be
+ written. Note that the Host will make sure that the keys for one plug-in
+ do not collide with the keys for other plug-ins.
+ @param inData
+ A CFPropertyListRef containing the data to associate with the key.
+ @result An OSStatus indicating success or failure.
+ */
+ OSStatus
+ (*WriteToStorage)( AudioServerPlugInHostRef inHost,
+ CFStringRef inKey,
+ CFPropertyListRef inData);
+
+ /*!
+ @method DeleteFromStorage
+ @abstract This method will remove the given key and any associated data from storage.
+ @param inHost
+ The AudioServerPlugInHostRef passed to the plug-in at initialization.
+ @param inKey
+ A CFStringRef that contains the name of the key to be deleted. Note that
+ the Host will make sure that the keys for one plug-in do not collide
+ with the keys for other plug-ins.
+ @result An OSStatus indicating success or failure.
+ */
+ OSStatus
+ (*DeleteFromStorage)( AudioServerPlugInHostRef inHost,
+ CFStringRef inKey);
+
+#pragma mark Device Operations
+
+ /*!
+ @typedef RequestDeviceConfigurationChange
+ @abstract Plug-ins invoke this routine to tell the Host to initiate a configuration
+ change operation.
+ @discussion When a plug-in's device object needs to change its structure or change any
+ state related to IO for any reason, it must begin this operation by invoking
+ this Host method. The device object may not perform the state change until
+ the Host gives the device clearance to do so by invoking the plug-in's
+ PerformDeviceConfigurationChange() routine. Note that the call to
+ PerformDeviceConfigurationChange() may be deferred to another thread at the
+ discretion of the host.
+ The sorts of changes that must go through this mechanism are anything that
+ affects either the structure of the device or IO. This includes, but is not
+ limited to, changing stream layout, adding/removing controls, changing the
+ nominal sample rate of the device, changing any sample formats on any stream
+ on the device, changing the size of the ring buffer, changing presentation
+ latency, and changing the safety offset.
+ @param inHost
+ The AudioServerPlugInHostRef passed to the plug-in at initialization.
+ @param inDeviceObjectID
+ The AudioObjectID of the device making the request.
+ @param inChangeAction
+ A UInt64 indicating the action the device object wants to take. It will
+ be passed back to the device in the invocation of
+ PerformDeviceConfigurationChange(). Note that this value is purely for
+ the plug-in's usage. The Host does not look at this value.
+ @param inChangeInfo
+ A pointer to information about the configuration change. It will be
+ passed back to the device in the invocation of
+ PerformDeviceConfigurationChange(). Note that this value is purely for
+ the plug-in's usage. The Host does not look at this value.
+ @result An OSStatus indicating success or failure. Note that even if this method
+ indicates success, the Host may still abort the change later.
+ */
+ OSStatus
+ (*RequestDeviceConfigurationChange)( AudioServerPlugInHostRef inHost,
+ AudioObjectID inDeviceObjectID,
+ UInt64 inChangeAction,
+ void* __nullable inChangeInfo);
+};
+
+//==================================================================================================
+#pragma mark -
+#pragma mark AudioServerPlugInDriverInterface
+
+/*!
+ @interface AudioServerPlugInDriverInterface
+ @abstract The CFPlugIn interface for a plug-in for the Audio Server that implements a
+ device driver.
+ @discussion In CFPlugIn terms, AudioServerPlugInDriverInterface is a subclass of IUnknown.
+*/
+struct AudioServerPlugInDriverInterface
+{
+
+#pragma mark Inheritence
+ /*!
+ @field _reserved
+ @abstract A standard part of the IUnknown interface.
+ */
+ void* __nullable _reserved;
+
+ /*!
+ @method QueryInterface
+ @abstract The IUnknown method for interface discovery.
+ @param inDriver
+ The CFPlugIn type to query.
+ @param inUUID
+ The UUID of the interface to find.
+ @param outInterface
+ The returned interface or NULL if none was found.
+ @result An error code indicating success of failure.
+ */
+ HRESULT
+ (STDMETHODCALLTYPE *QueryInterface)( void* __nullable inDriver,
+ REFIID inUUID,
+ LPVOID __nullable * __nullable outInterface);
+
+ /*!
+ @method AddRef
+ @abstract The IUnknown method for retaining a reference to a CFPlugIn type.
+ @param inDriver
+ The CFPlugIn type to retain.
+ @result The resulting reference count after the new reference is added.
+ */
+ ULONG
+ (STDMETHODCALLTYPE *AddRef)( void* __nullable inDriver);
+
+ /*!
+ @method Release
+ @abstract The IUnknown method for releasing a reference to a CFPlugIn type.
+ @param inDriver
+ The CFPlugIn type to release.
+ @result The resulting reference count after the reference has been removed.
+ */
+ ULONG
+ (STDMETHODCALLTYPE *Release)( void* __nullable inDriver);
+
+#pragma mark Basic Operations
+
+ /*!
+ @method Initialize
+ @abstract This method is called to initialize the instance of the plug-in.
+ @discussion As part of initialization, the plug-in should publish all the objects it
+ knows about at the time.
+ @param inDriver
+ The plug-in to initialize.
+ @param inHost
+ An AudioServerPlugInHostInterface struct that the plug-in is to use for
+ communication with the Host. The Host guarantees that the storage
+ pointed to by inHost will remain valid for the lifetime of the plug-in.
+ @result An OSStatus indicating success or failure.
+ */
+ OSStatus
+ (STDMETHODCALLTYPE *Initialize)( AudioServerPlugInDriverRef __nonnull inDriver,
+ AudioServerPlugInHostRef inHost);
+
+ /*!
+ @method CreateDevice
+ @abstract Tells the plug-in to create a new device based on the given description.
+ @param inDriver
+ The plug-in that owns the device.
+ @param inDescription
+ A CFDictionaryRef that contains a description of the device to create.
+ @param inClientInfo
+ A pointer to an AudioServerPlugInClientInfo structure describing the
+ client creating the device. Note that the mClientID field will be set to
+ kAudioServerPlugInHostClientID since the device hasn't been created yet.
+ The client info is passed here to give enough context to allow for the
+ creation of private devices.
+ @param outDeviceObjectID
+ On successful exit, this will contain the object ID of the newly created
+ device.
+ @result An OSStatus indicating success or failure.
+ */
+ OSStatus
+ (STDMETHODCALLTYPE *CreateDevice)( AudioServerPlugInDriverRef __nonnull inDriver,
+ CFDictionaryRef inDescription,
+ const AudioServerPlugInClientInfo* inClientInfo,
+ AudioObjectID* outDeviceObjectID);
+
+ /*!
+ @method DestroyDevice
+ @abstract Called to tell the plug-in about to destroy the given device.
+ @param inDriver
+ The plug-in that owns the device.
+ @param inDeviceObjectID
+ The ID of the device to destroy.
+ @result An OSStatus indicating success or failure.
+ */
+ OSStatus
+ (STDMETHODCALLTYPE *DestroyDevice)( AudioServerPlugInDriverRef __nonnull inDriver,
+ AudioObjectID inDeviceObjectID);
+
+ /*!
+ @method AddDeviceClient
+ @abstract Called to tell the plug-in about a new client of the Host for a particular
+ device.
+ @param inDriver
+ The plug-in that owns the device.
+ @param inDeviceObjectID
+ The ID of the device that the client is using.
+ @param inClientInfo
+ A pointer to an AudioServerPlugInClientInfo structure describing the new
+ client. The plug-in should cache this data (including taking a retain on
+ the bundle ID) as the memory pointed is only valid for the duration of
+ the call.
+ @result An OSStatus indicating success or failure.
+ */
+ OSStatus
+ (STDMETHODCALLTYPE *AddDeviceClient)( AudioServerPlugInDriverRef __nonnull inDriver,
+ AudioObjectID inDeviceObjectID,
+ const AudioServerPlugInClientInfo* inClientInfo);
+
+ /*!
+ @method RemoveDeviceClient
+ @abstract Called to tell the plug-in about a client that is no longer using the device.
+ @param inDriver
+ The plug-in that owns the device.
+ @param inDeviceObjectID
+ The ID of the device that the client is no longer using.
+ @param inClientInfo
+ A pointer to an AudioServerPlugInClientInfo structure describing the
+ client.
+ @result An OSStatus indicating success or failure.
+ */
+ OSStatus
+ (STDMETHODCALLTYPE *RemoveDeviceClient)( AudioServerPlugInDriverRef __nonnull inDriver,
+ AudioObjectID inDeviceObjectID,
+ const AudioServerPlugInClientInfo* inClientInfo);
+
+ /*!
+ @method PerformDeviceConfigurationChange
+ @abstract This is called by the Host to allow the device to perform a configuration
+ change that had been previously requested via a call to the Host method,
+ RequestDeviceConfigurationChange().
+ @param inDriver
+ The plug-in that owns the device.
+ @param inDeviceObjectID
+ The ID of the device that wants to change its configuration.
+ @param inChangeAction
+ A UInt64 indicating the action the device object wants to take. This is
+ the same value that was passed to RequestDeviceConfigurationChange().
+ Note that this value is purely for the plug-in's usage. The Host does
+ not look at this value.
+ @param inChangeInfo
+ A pointer to information about the configuration change. This is the
+ same value that was passed to RequestDeviceConfigurationChange(). Note
+ that this value is purely for the plug-in's usage. The Host does not
+ look at this value.
+ @result An OSStatus indicating success or failure.
+ */
+ OSStatus
+ (STDMETHODCALLTYPE *PerformDeviceConfigurationChange)( AudioServerPlugInDriverRef __nonnull inDriver,
+ AudioObjectID inDeviceObjectID,
+ UInt64 inChangeAction,
+ void* __nullable inChangeInfo);
+
+ /*!
+ @method AbortDeviceConfigurationChange
+ @abstract This is called by the Host to tell the plug-in not to perform a
+ configuration change that had been requested via a call to the Host method,
+ RequestDeviceConfigurationChange().
+ @param inDriver
+ The plug-in that owns the device.
+ @param inDeviceObjectID
+ The ID of the device that wants to change its configuration.
+ @param inChangeAction
+ A UInt64 indicating the action the device object wants to take. This is
+ the same value that was passed to RequestDeviceConfigurationChange().
+ Note that this value is purely for the plug-in's usage. The Host does
+ not look at this value.
+ @param inChangeInfo
+ A pointer to information about the configuration change. This is the
+ same value that was passed to RequestDeviceConfigurationChange(). Note
+ that this value is purely for the plug-in's usage. The Host does not
+ look at this value.
+ @result An OSStatus indicating success or failure.
+ */
+ OSStatus
+ (STDMETHODCALLTYPE *AbortDeviceConfigurationChange)( AudioServerPlugInDriverRef __nonnull inDriver,
+ AudioObjectID inDeviceObjectID,
+ UInt64 inChangeAction,
+ void* __nullable inChangeInfo);
+
+#pragma mark Property Operations
+
+ /*!
+ @method HasProperty
+ @abstract Queries an object about whether or not it has the given property.
+ @param inDriver
+ The plug-in that owns the object.
+ @param inObjectID
+ The object to query.
+ @param inClientProcessID
+ A pid_t indicating the process of the client. Note that this will often
+ be zero indicating that the Host is making the request.
+ @param inAddress
+ An AudioObjectPropertyAddress indicating the property being queried.
+ @result A Boolean indicating whether or not the object has the given property.
+ */
+ Boolean
+ (STDMETHODCALLTYPE *HasProperty)( AudioServerPlugInDriverRef __nonnull inDriver,
+ AudioObjectID inObjectID,
+ pid_t inClientProcessID,
+ const AudioObjectPropertyAddress* inAddress);
+
+ /*!
+ @method IsPropertySettable
+ @abstract Queries an object about whether or not the given property can be set.
+ @param inDriver
+ The plug-in that owns the object.
+ @param inObjectID
+ The object to query.
+ @param inClientProcessID
+ A pid_t indicating the process of the client. Note that this will often
+ be zero indicating that the Host is making the request.
+ @param inAddress
+ An AudioObjectPropertyAddress indicating the property being queried.
+ @param outIsSettable
+ A Boolean indicating whether or not the property can be set.
+ @result An OSStatus indicating success or failure.
+ */
+ OSStatus
+ (STDMETHODCALLTYPE *IsPropertySettable)( AudioServerPlugInDriverRef __nonnull inDriver,
+ AudioObjectID inObjectID,
+ pid_t inClientProcessID,
+ const AudioObjectPropertyAddress* inAddress,
+ Boolean* outIsSettable);
+
+ /*!
+ @method GetPropertyDataSize
+ @abstract Queries an object to find the size of the data for the given property.
+ @param inDriver
+ The plug-in that owns the object.
+ @param inObjectID
+ The object to query.
+ @param inAddress
+ An AudioObjectPropertyAddress indicating the property being queried.
+ @param inClientProcessID
+ A pid_t indicating the process of the client. Note that this will often
+ be zero indicating that the Host is making the request.
+ @param inQualifierDataSize
+ A UInt32 indicating the size of the buffer pointed to by
+ inQualifierData. Note that not all properties require qualification, in
+ which case this value will be 0.
+ @param inQualifierData,
+ A buffer of data to be used in determining the data of the property
+ being queried. Note that not all properties require qualification, in
+ which case this value will be NULL.
+ @param outDataSize
+ A UInt32 indicating how many bytes the data for the given property
+ occupies.
+ @result An OSStatus indicating success or failure.
+ */
+ OSStatus
+ (STDMETHODCALLTYPE *GetPropertyDataSize)( AudioServerPlugInDriverRef __nonnull inDriver,
+ AudioObjectID inObjectID,
+ pid_t inClientProcessID,
+ const AudioObjectPropertyAddress* inAddress,
+ UInt32 inQualifierDataSize,
+ const void* __nullable inQualifierData,
+ UInt32* outDataSize);
+
+ /*!
+ @method GetPropertyData
+ @abstract Fetches the data of the given property and places it in the provided buffer.
+ @param inDriver
+ The plug-in that owns the object.
+ @param inObjectID
+ The object to query.
+ @param inClientProcessID
+ A pid_t indicating the process of the client. Note that this will often
+ be zero indicating that the Host is making the request.
+ @param inAddress
+ An AudioObjectPropertyAddress indicating the property being queried.
+ @param inQualifierDataSize
+ A UInt32 indicating the size of the buffer pointed to by
+ inQualifierData. Note that not all properties require qualification, in
+ which case this value will be 0.
+ @param inQualifierData,
+ A buffer of data to be used in determining the data of the property
+ being queried. Note that not all properties require qualification, in
+ which case this value will be NULL.
+ @param inDataSize
+ A UInt32 that indicates the size of the buffer pointed to by outData
+ @param outDataSize
+ A UInt32 which on exit indicates how much of the buffer pointed to by
+ outData was used.
+ @param outData
+ The buffer into which the data for the given property will be put.
+ @result An OSStatus indicating success or failure.
+ */
+ OSStatus
+ (STDMETHODCALLTYPE *GetPropertyData)( AudioServerPlugInDriverRef __nonnull inDriver,
+ AudioObjectID inObjectID,
+ pid_t inClientProcessID,
+ const AudioObjectPropertyAddress* inAddress,
+ UInt32 inQualifierDataSize,
+ const void* __nullable inQualifierData,
+ UInt32 inDataSize,
+ UInt32* outDataSize,
+ void* outData);
+
+ /*!
+ @method SetPropertyData
+ @abstract Tells an object to change the value of the given property.
+ @discussion Note that the value of the property cannot be considered set until the
+ appropriate notification has been received by the Host.
+ @param inDriver
+ The plug-in that owns the object.
+ @param inObjectID
+ The object to change.
+ @param inClientProcessID
+ A pid_t indicating the process of the client. Note that this will often
+ be zero indicating that the Host is making the request.
+ @param inAddress
+ An AudioObjectPropertyAddress indicating the property being changed.
+ @param inQualifierDataSize
+ A UInt32 indicating the size of the buffer pointed to by
+ inQualifierData. Note that not all properties require qualification, in
+ which case this value will be 0.
+ @param inQualifierData,
+ A buffer of data to be used in determining the data of the property
+ being queried. Note that not all properties require qualification, in
+ which case this value will be NULL.
+ @param inDataSize
+ A UInt32 indicating the size of the buffer pointed to by inData.
+ @param inData
+ The buffer containing the data for the property's value.
+ @result An OSStatus indicating success or failure.
+ */
+ OSStatus
+ (STDMETHODCALLTYPE *SetPropertyData)( AudioServerPlugInDriverRef __nonnull inDriver,
+ AudioObjectID inObjectID,
+ pid_t inClientProcessID,
+ const AudioObjectPropertyAddress* inAddress,
+ UInt32 inQualifierDataSize,
+ const void* __nullable inQualifierData,
+ UInt32 inDataSize,
+ const void* inData);
+
+#pragma mark IO Operations
+
+ /*!
+ @method StartIO
+ @abstract Tells the device to start IO.
+ @discussion This call is expect to always succeed or fail. The hardware can take as long
+ as necessary in this call such that it always either succeeds (and returns
+ 0) or fails.
+ @param inDriver
+ The plug-in that owns the device.
+ @param inDeviceObjectID
+ The device to start.
+ @param inClientID
+ The ID of the client making the request. This will have been established
+ with the device by a previous call to AddDeviceClient(). Note that the
+ device should consider IO running for as long as at least one client has
+ started IO.
+ @result An OSStatus indicating success or failure.
+ */
+ OSStatus
+ (STDMETHODCALLTYPE *StartIO)( AudioServerPlugInDriverRef __nonnull inDriver,
+ AudioObjectID inDeviceObjectID,
+ UInt32 inClientID);
+
+ /*!
+ @method StopIO
+ @abstract Tells the device to stop IO.
+ @param inDriver
+ The plug-in that owns the device.
+ @param inDeviceObjectID
+ The device to stop.
+ @param inClientID
+ The ID of the client making the request. This will have been established
+ with the device by a previous call to AddDeviceClient().
+ @result An OSStatus indicating success or failure.
+ */
+ OSStatus
+ (STDMETHODCALLTYPE *StopIO)( AudioServerPlugInDriverRef __nonnull inDriver,
+ AudioObjectID inDeviceObjectID,
+ UInt32 inClientID);
+
+ /*!
+ @method GetZeroTimeStamp
+ @abstract Retrieves the most recent zero time stamp for the device.
+ @discussion Devices that do not provide their own clock do not need to implement this call.
+ @param inDriver
+ The plug-in that owns the device.
+ @param inDeviceObjectID
+ The device whose zero time stamp is being requested.
+ @param inClientID
+ The ID of the client making the request. This will have been established
+ with the device by a previous call to AddDeviceClient().
+ @param outSampleTime
+ Upon return, the sample time portion of the zero time stamp.
+ @param outHostTime
+ Upon return, the host time portion of the zero time stamp.
+ @param outSeed
+ Upon return, the current seed value for the device's clock. If
+ successive calls return different seed values, the caller will assume
+ that the device's clock has established a new time line and that the
+ caller should resynchronize to the new state.
+ @result An OSStatus indicating success or failure.
+ */
+ OSStatus
+ (STDMETHODCALLTYPE *GetZeroTimeStamp)( AudioServerPlugInDriverRef __nonnull inDriver,
+ AudioObjectID inDeviceObjectID,
+ UInt32 inClientID,
+ Float64* outSampleTime,
+ UInt64* outHostTime,
+ UInt64* outSeed) CA_REALTIME_API;
+
+ /*!
+ @method WillDoIOOperation
+ @abstract Asks the plug-in whether or not the device will perform the given phase of
+ the IO cycle for a particular device.
+ @discussion As part of starting IO, the Host will ask the plug-in whether or not the
+ device in question will perform the given IO operation. This method is not
+ called during the IO cycle. A device is allowed to do different sets of
+ operations for different clients.
+ @param inDriver
+ The plug-in that owns the device.
+ @param inDeviceObjectID
+ The ID of the device.
+ @param inClientID
+ The ID of the client doing the operation. This will have been
+ established with the device by a previous call to AddDeviceClient().
+ @param inOperationID
+ A UInt32 that identifies the operation being asked about. Constants for
+ the valid values of this argument are listed in the Constants section.
+ @param outWillDo
+ Upon return, a Boolean indicating whether or not the device will perform
+ the given operation.
+ @param outWillDoInPlace
+ Upon return, a Boolean where true indicates that the device will perform
+ the requested operation entirely within the main buffer passed to the
+ DoIOOperation routine. If this value is false, it indicates that the
+ device requires that the secondary buffer be passed.
+ @result An OSStatus indicating success or failure.
+ */
+ OSStatus
+ (STDMETHODCALLTYPE *WillDoIOOperation)( AudioServerPlugInDriverRef __nonnull inDriver,
+ AudioObjectID inDeviceObjectID,
+ UInt32 inClientID,
+ UInt32 inOperationID,
+ Boolean* outWillDo,
+ Boolean* outWillDoInPlace);
+
+ /*!
+ @method BeginIOOperation
+ @abstract Tells the plug-in that the Host is about to begin a phase of the IO cycle for a
+ particular device.
+ @param inDriver
+ The plug-in that owns the device.
+ @param inDeviceObjectID
+ The ID of the device.
+ @param inClientID
+ The ID of the client doing the operation. This will have been
+ established with the device by a previous call to AddDeviceClient().
+ @param inOperationID
+ A UInt32 that identifies the operation being performed. Constants for
+ the valid values of this argument are listed in the Constants section.
+ @param inIOBufferFrameSize
+ The number of sample frames that will be processed in this operation.
+ Note that for some operations, this will be different than the nominal
+ buffer frame size.
+ @param inIOCycleInfo
+ The basic information about the current IO cycle.
+ @result An OSStatus indicating success or failure.
+ */
+ OSStatus
+ (STDMETHODCALLTYPE *BeginIOOperation)( AudioServerPlugInDriverRef __nonnull inDriver,
+ AudioObjectID inDeviceObjectID,
+ UInt32 inClientID,
+ UInt32 inOperationID,
+ UInt32 inIOBufferFrameSize,
+ const AudioServerPlugInIOCycleInfo* inIOCycleInfo) CA_REALTIME_API;
+
+ /*!
+ @method DoIOOperation
+ @abstract Tells the device to perform an IO operation for a particular stream.
+ @param inDriver
+ The plug-in that owns the device.
+ @param inDeviceObjectID
+ The ID of the device.
+ @param inStreamObjectID
+ The ID of the stream whose data is being processed.
+ @param inClientID
+ The ID of the client doing the operation. This will have been
+ established with the device by a previous call to AddDeviceClient().
+ @param inOperationID
+ A UInt32 that identifies the operation being performed. Constants for
+ the valid values of this argument are listed in the Constants section.
+ @param inIOBufferFrameSize
+ The number of sample frames that will be processed in this operation.
+ Note that for some operations, this will be different than the nominal
+ buffer frame size.
+ @param inIOCycleInfo
+ The basic information about the current IO cycle.
+ @param ioMainBuffer
+ The primary buffer for the data for the operation. If the device
+ signaled through WillDoIOOperation() that the operation will be handled
+ in-place, this will be the only buffer passed in.
+ @param ioSecondaryBuffer
+ The secondary buffer for performing the operation. If the device
+ signaled through WillDoIOOperation() that the operation will not be
+ handled in place, the results of the operation must end up in this
+ buffer.
+ @result An OSStatus indicating success or failure.
+ */
+ OSStatus
+ (STDMETHODCALLTYPE *DoIOOperation)( AudioServerPlugInDriverRef __nonnull inDriver,
+ AudioObjectID inDeviceObjectID,
+ AudioObjectID inStreamObjectID,
+ UInt32 inClientID,
+ UInt32 inOperationID,
+ UInt32 inIOBufferFrameSize,
+ const AudioServerPlugInIOCycleInfo* inIOCycleInfo,
+ void* __nullable ioMainBuffer,
+ void* __nullable ioSecondaryBuffer) CA_REALTIME_API;
+
+ /*!
+ @method EndIOOperation
+ @abstract Tells the plug-in that the Host is about to end a phase of the IO cycle for
+ a particular device.
+ @param inDriver
+ The plug-in that owns the device.
+ @param inDeviceObjectID
+ The ID of the device.
+ @param inClientID
+ The ID of the client doing the operation. This will have been
+ established with the device by a previous call to AddDeviceClient().
+ @param inOperationID
+ A UInt32 that identifies the operation being performed. Constants for
+ the valid values of this argument are listed in the Constants section.
+ @param inIOBufferFrameSize
+ The number of sample frames that will be processed in this operation.
+ Note that for some operations, this will be different than the nominal
+ buffer frame size.
+ @param inIOCycleInfo
+ The basic information about the current IO cycle.
+ @result An OSStatus indicating success or failure.
+ */
+ OSStatus
+ (STDMETHODCALLTYPE *EndIOOperation)( AudioServerPlugInDriverRef __nonnull inDriver,
+ AudioObjectID inDeviceObjectID,
+ UInt32 inClientID,
+ UInt32 inOperationID,
+ UInt32 inIOBufferFrameSize,
+ const AudioServerPlugInIOCycleInfo* inIOCycleInfo) CA_REALTIME_API;
+
+};
+
+/*!
+ @defined kAudioServerPlugInDriverInterfaceUUID
+ @abstract The UUID of the driver interface (EEA5773D-CC43-49F1-8E00-8F96E7D23B17).
+*/
+#define kAudioServerPlugInDriverInterfaceUUID CFUUIDGetConstantUUIDWithBytes(NULL, 0xEE, 0xA5, 0x77, 0x3D, 0xCC, 0x43, 0x49, 0xF1, 0x8E, 0x00, 0x8F, 0x96, 0xE7, 0xD2, 0x3B, 0x17)
+
+//==================================================================================================
+
+/*!
+ @function AudioServerPlugInRegisterMediaDeviceExtension
+ @abstract This is used to register an AudioServerPlugin interface to host a driver
+ for a remote media device to be used in conjunction with
+ SystemMediaCastingExtension.
+ @discussion AudioServerPlugIns that are registered this way are restricted to presenting
+ a single output audio device, which must have a transport type of
+ kAudioDeviceTransportTypeRemoteScreen or
+ kAudioDeviceTransportTypeRemoteStreaming. If these conditions are not met,
+ the registration will fail with a result of kAudioHardwareIllegalOperationError.
+ @param inPlugIn
+ The plug-in interface that will be called by the system.
+ @param interruptionHandler
+ The handler that will be called when the connection to the audio server
+ is interrupted
+ @result An OSStatus indicating success or failure.
+*/
+extern OSStatus
+AudioServerPlugInRegisterMediaDeviceExtension(AudioServerPlugInDriverRef __nullable inPlugIn, void (^ __nullable interruptionHandler)()) API_AVAILABLE(ios(27.0)) API_UNAVAILABLE(macos, watchos, tvos);
+
+//==================================================================================================
+
+#if defined(__cplusplus)
+}
+#endif
+
+CF_ASSUME_NONNULL_END
+
+#endif // CoreAudio_AudioServerPlugIn_h