[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PATCH v5 10/16] audio/coreaudio: Remove a deprecation warning on macOS
From: |
Philippe Mathieu-Daudé |
Subject: |
[PATCH v5 10/16] audio/coreaudio: Remove a deprecation warning on macOS 12 |
Date: |
Mon, 14 Feb 2022 19:55:59 +0100 |
When building on macOS 12 we get:
audio/coreaudio.c:50:5: error: 'kAudioObjectPropertyElementMaster' is
deprecated: first deprecated in macOS 12.0 [-Werror,-Wdeprecated-declarations]
kAudioObjectPropertyElementMaster
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
kAudioObjectPropertyElementMain
/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreAudio.framework/Headers/AudioHardwareBase.h:208:5:
note: 'kAudioObjectPropertyElementMaster' has been explicitly marked
deprecated here
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
^
Replace by kAudioObjectPropertyElementMain, redefining it to
kAudioObjectPropertyElementMaster if not available.
Suggested-by: Akihiko Odaki <akihiko.odaki@gmail.com>
Suggested-by: Christian Schoenebeck <qemu_oss@crudebyte.com>
Suggested-by: Roman Bolshakov <roman@roolebo.dev>
Reviewed-by: Christian Schoenebeck <qemu_oss@crudebyte.com>
Signed-off-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
---
audio/coreaudio.c | 17 +++++++++++------
1 file changed, 11 insertions(+), 6 deletions(-)
diff --git a/audio/coreaudio.c b/audio/coreaudio.c
index d8a21d3e50..5b3aeaced0 100644
--- a/audio/coreaudio.c
+++ b/audio/coreaudio.c
@@ -44,10 +44,15 @@ typedef struct coreaudioVoiceOut {
bool enabled;
} coreaudioVoiceOut;
+#if !defined(MAC_OS_VERSION_12_0) \
+ || (MAC_OS_X_VERSION_MAX_ALLOWED < MAC_OS_VERSION_12_0)
+#define kAudioObjectPropertyElementMain kAudioObjectPropertyElementMaster
+#endif
+
static const AudioObjectPropertyAddress voice_addr = {
kAudioHardwarePropertyDefaultOutputDevice,
kAudioObjectPropertyScopeGlobal,
- kAudioObjectPropertyElementMaster
+ kAudioObjectPropertyElementMain
};
static OSStatus coreaudio_get_voice(AudioDeviceID *id)
@@ -69,7 +74,7 @@ static OSStatus coreaudio_get_framesizerange(AudioDeviceID id,
AudioObjectPropertyAddress addr = {
kAudioDevicePropertyBufferFrameSizeRange,
kAudioDevicePropertyScopeOutput,
- kAudioObjectPropertyElementMaster
+ kAudioObjectPropertyElementMain
};
return AudioObjectGetPropertyData(id,
@@ -86,7 +91,7 @@ static OSStatus coreaudio_get_framesize(AudioDeviceID id,
UInt32 *framesize)
AudioObjectPropertyAddress addr = {
kAudioDevicePropertyBufferFrameSize,
kAudioDevicePropertyScopeOutput,
- kAudioObjectPropertyElementMaster
+ kAudioObjectPropertyElementMain
};
return AudioObjectGetPropertyData(id,
@@ -103,7 +108,7 @@ static OSStatus coreaudio_set_framesize(AudioDeviceID id,
UInt32 *framesize)
AudioObjectPropertyAddress addr = {
kAudioDevicePropertyBufferFrameSize,
kAudioDevicePropertyScopeOutput,
- kAudioObjectPropertyElementMaster
+ kAudioObjectPropertyElementMain
};
return AudioObjectSetPropertyData(id,
@@ -121,7 +126,7 @@ static OSStatus coreaudio_set_streamformat(AudioDeviceID id,
AudioObjectPropertyAddress addr = {
kAudioDevicePropertyStreamFormat,
kAudioDevicePropertyScopeOutput,
- kAudioObjectPropertyElementMaster
+ kAudioObjectPropertyElementMain
};
return AudioObjectSetPropertyData(id,
@@ -138,7 +143,7 @@ static OSStatus coreaudio_get_isrunning(AudioDeviceID id,
UInt32 *result)
AudioObjectPropertyAddress addr = {
kAudioDevicePropertyDeviceIsRunning,
kAudioDevicePropertyScopeOutput,
- kAudioObjectPropertyElementMaster
+ kAudioObjectPropertyElementMain
};
return AudioObjectGetPropertyData(id,
--
2.34.1
- [PATCH v5 02/16] configure: Allow passing extra Objective C compiler flags, (continued)
- [PATCH v5 02/16] configure: Allow passing extra Objective C compiler flags, Philippe Mathieu-Daudé, 2022/02/14
- [PATCH v5 03/16] tests/fp/berkeley-testfloat-3: Ignore ignored #pragma directives, Philippe Mathieu-Daudé, 2022/02/14
- [PATCH v5 04/16] hvf: Use standard CR0 and CR4 register definitions, Philippe Mathieu-Daudé, 2022/02/14
- [PATCH v5 05/16] hvf: Fix OOB write in RDTSCP instruction decode, Philippe Mathieu-Daudé, 2022/02/14
- [PATCH v5 06/16] hvf: Enable RDTSCP support, Philippe Mathieu-Daudé, 2022/02/14
- [PATCH v5 07/16] hvf: Make hvf_get_segments() / hvf_put_segments() local, Philippe Mathieu-Daudé, 2022/02/14
- [PATCH v5 08/16] hvf: Remove deprecated hv_vcpu_flush() calls, Philippe Mathieu-Daudé, 2022/02/14
- [PATCH v5 09/16] block/file-posix: Remove a deprecation warning on macOS 12, Philippe Mathieu-Daudé, 2022/02/14
- [PATCH v5 10/16] audio/coreaudio: Remove a deprecation warning on macOS 12,
Philippe Mathieu-Daudé <=
- [PATCH v5 11/16] audio/dbus: Fix building with modules on macOS, Philippe Mathieu-Daudé, 2022/02/14
- [PATCH v5 12/16] ui/cocoa: Remove allowedFileTypes restriction in SavePanel, Philippe Mathieu-Daudé, 2022/02/14
- [PATCH v5 13/16] ui/cocoa: Add Services menu, Philippe Mathieu-Daudé, 2022/02/14
- [PATCH v5 14/16] ui/cocoa: Do not alert even without block devices, Philippe Mathieu-Daudé, 2022/02/14
- [PATCH v5 15/16] lcitool: refresh, Philippe Mathieu-Daudé, 2022/02/14
- [PATCH v5 16/16] gitlab-ci: Support macOS 12 via cirrus-run, Philippe Mathieu-Daudé, 2022/02/14