From 38f0214e8a579664d19c3eb95ff1df660e519420 Mon Sep 17 00:00:00 2001 From: "Ryan C. Gordon" Date: Fri, 14 Jun 2024 17:57:14 -0400 Subject: [PATCH] audio: Refer to audio devices to "playback" and "recording". Fixes #9619. --- .github/workflows/android.yml | 2 +- .gitignore | 2 +- VisualC-GDK/SDL/SDL.vcxproj.filters | 1 - VisualC-GDK/tests/testgdk/src/testgdk.cpp | 2 +- WhatsNew.txt | 2 +- .../SDLTest/SDLTest.xcodeproj/project.pbxproj | 4 +- android-project/app/proguard-rules.pro | 10 +- .../app/src/main/AndroidManifest.xml | 4 +- .../java/org/libsdl/app/SDLAudioManager.java | 36 +-- docs/README-emscripten.md | 2 +- docs/README-migration.md | 14 +- docs/README-winrt.md | 2 +- include/SDL3/SDL_audio.h | 74 ++--- include/SDL3/SDL_camera.h | 2 +- include/SDL3/SDL_events.h | 2 +- include/SDL3/SDL_hints.h | 2 +- src/audio/SDL_audio.c | 264 +++++++++--------- src/audio/SDL_audiocvt.c | 2 +- src/audio/SDL_audiodev.c | 12 +- src/audio/SDL_sysaudio.h | 64 ++--- src/audio/aaudio/SDL_aaudio.c | 30 +- src/audio/alsa/SDL_alsa_audio.c | 66 ++--- src/audio/android/SDL_androidaudio.c | 70 ++--- src/audio/coreaudio/SDL_coreaudio.m | 134 +++++---- src/audio/directsound/SDL_directsound.c | 38 +-- src/audio/disk/SDL_diskaudio.c | 34 +-- src/audio/dsp/SDL_dspaudio.c | 20 +- src/audio/dummy/SDL_dummyaudio.c | 14 +- src/audio/emscripten/SDL_emscriptenaudio.c | 150 +++++----- src/audio/haiku/SDL_haikuaudio.cc | 4 +- src/audio/jack/SDL_jackaudio.c | 40 +-- src/audio/n3ds/SDL_n3dsaudio.c | 4 +- src/audio/netbsd/SDL_netbsdaudio.c | 38 +-- src/audio/openslES/SDL_openslES.c | 26 +- src/audio/pipewire/SDL_pipewire.c | 52 ++-- src/audio/ps2/SDL_ps2audio.c | 2 +- src/audio/psp/SDL_pspaudio.c | 6 +- src/audio/pulseaudio/SDL_pulseaudio.c | 78 +++--- src/audio/pulseaudio/SDL_pulseaudio.h | 4 +- src/audio/qnx/SDL_qsa_audio.c | 42 +-- src/audio/sndio/SDL_sndioaudio.c | 32 +-- src/audio/vita/SDL_vitaaudio.c | 30 +- src/audio/wasapi/SDL_wasapi.c | 34 +-- src/audio/wasapi/SDL_wasapi.h | 2 +- src/audio/wasapi/SDL_wasapi_win32.c | 8 +- src/audio/wasapi/SDL_wasapi_winrt.cpp | 38 +-- src/camera/SDL_camera.c | 4 +- src/core/android/SDL_android.c | 138 ++++----- src/core/android/SDL_android.h | 8 +- src/core/windows/SDL_immdevice.c | 24 +- src/core/windows/SDL_immdevice.h | 4 +- src/dynapi/SDL_dynapi.sym | 4 +- src/dynapi/SDL_dynapi_overrides.h | 4 +- src/dynapi/SDL_dynapi_procs.h | 4 +- src/events/SDL_events.c | 2 +- src/test/SDL_test_common.c | 2 +- test/CMakeLists.txt | 2 +- test/loopwave.c | 2 +- test/testaudio.c | 76 ++--- test/testaudiohotplug.c | 14 +- test/testaudioinfo.c | 18 +- ...estaudiocapture.c => testaudiorecording.c} | 28 +- test/testautomation_audio.c | 20 +- test/testffmpeg.c | 2 +- test/testmultiaudio.c | 4 +- test/testsurround.c | 4 +- 66 files changed, 939 insertions(+), 924 deletions(-) rename test/{testaudiocapture.c => testaudiorecording.c} (88%) diff --git a/.github/workflows/android.yml b/.github/workflows/android.yml index 037121c18..fc083958d 100644 --- a/.github/workflows/android.yml +++ b/.github/workflows/android.yml @@ -82,7 +82,7 @@ jobs: - name: Build test apk's (CMake) if: ${{ matrix.platform.cmake }} run: | - cmake --build build --config Release --parallel --verbose --target testautomation-apk testaudiocapture-apk testcontroller-apk testmultiaudio-apk testsprite-apk + cmake --build build --config Release --parallel --verbose --target testautomation-apk testaudiorecording-apk testcontroller-apk testmultiaudio-apk testsprite-apk - name: Install (CMake) if: ${{ matrix.platform.cmake }} run: | diff --git a/.gitignore b/.gitignore index 109fe0441..ef5cc7137 100644 --- a/.gitignore +++ b/.gitignore @@ -94,7 +94,7 @@ test/gamepadmap test/loopwave test/loopwavequeue test/testatomic -test/testaudiocapture +test/testaudiorecording test/testaudiohotplug test/testaudioinfo test/testautomation diff --git a/VisualC-GDK/SDL/SDL.vcxproj.filters b/VisualC-GDK/SDL/SDL.vcxproj.filters index eb8308ff0..d0dde99d3 100644 --- a/VisualC-GDK/SDL/SDL.vcxproj.filters +++ b/VisualC-GDK/SDL/SDL.vcxproj.filters @@ -221,7 +221,6 @@ - diff --git a/VisualC-GDK/tests/testgdk/src/testgdk.cpp b/VisualC-GDK/tests/testgdk/src/testgdk.cpp index bddecf3c5..cd8f5e321 100644 --- a/VisualC-GDK/tests/testgdk/src/testgdk.cpp +++ b/VisualC-GDK/tests/testgdk/src/testgdk.cpp @@ -438,7 +438,7 @@ main(int argc, char *argv[]) SDL_Log("Using audio driver: %s\n", SDL_GetCurrentAudioDriver()); - stream = SDL_OpenAudioDeviceStream(SDL_AUDIO_DEVICE_DEFAULT_OUTPUT, &wave.spec, NULL, NULL); + stream = SDL_OpenAudioDeviceStream(SDL_AUDIO_DEVICE_DEFAULT_PLAYBACK, &wave.spec, NULL, NULL); if (!stream) { SDL_LogError(SDL_LOG_CATEGORY_APPLICATION, "Couldn't create audio stream: %s\n", SDL_GetError()); return -1; diff --git a/WhatsNew.txt b/WhatsNew.txt index 654997118..6e5a1dbed 100644 --- a/WhatsNew.txt +++ b/WhatsNew.txt @@ -18,7 +18,7 @@ There have been too many changes to list them all, but here are some of the high * An example of hardware accelerated video playback using ffmpeg has been added in test/testffmpeg.c * The shaped window API has been replaced with transparent windows * Time and date functions have been added in SDL_time.h -* Support for webcam video capture has been added in SDL_camera.h +* Support for webcam video recording has been added in SDL_camera.h * Support for handling pens and tablets has been added in SDL_pen.h * Support for file open and save dialogs has been added in SDL_dialog.h * Cross-platform functions for working with files and directories are available in SDL_filesystem.h diff --git a/Xcode/SDLTest/SDLTest.xcodeproj/project.pbxproj b/Xcode/SDLTest/SDLTest.xcodeproj/project.pbxproj index 85c840650..c0c1cb8a5 100644 --- a/Xcode/SDLTest/SDLTest.xcodeproj/project.pbxproj +++ b/Xcode/SDLTest/SDLTest.xcodeproj/project.pbxproj @@ -4677,7 +4677,7 @@ buildSettings = { CODE_SIGN_IDENTITY = "Apple Development"; CODE_SIGN_STYLE = Automatic; - INFOPLIST_KEY_NSCameraUsageDescription = "Testing camera capture"; + INFOPLIST_KEY_NSCameraUsageDescription = "Testing camera recording"; INFOPLIST_KEY_UIApplicationSupportsIndirectInputEvents = YES; PRODUCT_NAME = "$(TARGET_NAME)"; PROVISIONING_PROFILE_SPECIFIER = ""; @@ -4689,7 +4689,7 @@ buildSettings = { CODE_SIGN_IDENTITY = "Apple Development"; CODE_SIGN_STYLE = Automatic; - INFOPLIST_KEY_NSCameraUsageDescription = "Testing camera capture"; + INFOPLIST_KEY_NSCameraUsageDescription = "Testing camera recording"; INFOPLIST_KEY_UIApplicationSupportsIndirectInputEvents = YES; PRODUCT_NAME = "$(TARGET_NAME)"; PROVISIONING_PROFILE_SPECIFIER = ""; diff --git a/android-project/app/proguard-rules.pro b/android-project/app/proguard-rules.pro index ab66646af..c0462d982 100644 --- a/android-project/app/proguard-rules.pro +++ b/android-project/app/proguard-rules.pro @@ -68,12 +68,12 @@ void audioWriteFloatBuffer(float[]); void audioWriteShortBuffer(short[]); void audioWriteByteBuffer(byte[]); - int[] captureOpen(int, int, int, int, int); - int captureReadFloatBuffer(float[], boolean); - int captureReadShortBuffer(short[], boolean); - int captureReadByteBuffer(byte[], boolean); + int[] recordingOpen(int, int, int, int, int); + int recordingReadFloatBuffer(float[], boolean); + int recordingReadShortBuffer(short[], boolean); + int recordingReadByteBuffer(byte[], boolean); void audioClose(); - void captureClose(); + void recordingClose(); void audioSetThreadPriority(boolean, int); int nativeSetupJNI(); void removeAudioDevice(boolean, int); diff --git a/android-project/app/src/main/AndroidManifest.xml b/android-project/app/src/main/AndroidManifest.xml index 98821942e..acefc495d 100644 --- a/android-project/app/src/main/AndroidManifest.xml +++ b/android-project/app/src/main/AndroidManifest.xml @@ -32,7 +32,7 @@ android:required="false" /> - + @@ -55,7 +55,7 @@ - +