From 85fd2e281bc7c798e30fc0ffd9fdf4a74842f72d Mon Sep 17 00:00:00 2001 From: Jelle Raaijmakers Date: Wed, 28 Aug 2024 12:08:38 +0200 Subject: [PATCH] LibMedia: Absorb LibAudio LibMedia will be responsible for both audio and video decoding. --- CONTRIBUTING.md | 2 +- .../src/main/cpp/WebContentService.cpp | 2 +- Ladybird/Qt/AudioCodecPluginQt.cpp | 2 +- Ladybird/Qt/AudioCodecPluginQt.h | 2 +- Ladybird/Qt/AudioThread.h | 4 +- Ladybird/WebContent/CMakeLists.txt | 2 +- Ladybird/WebContent/main.cpp | 2 +- Meta/CMake/flac_spec_tests.cmake | 2 +- Meta/Lagom/CMakeLists.txt | 13 +----- Meta/Lagom/Fuzzers/AudioFuzzerCommon.h | 2 +- Meta/Lagom/Fuzzers/FuzzFlacLoader.cpp | 2 +- Meta/Lagom/Fuzzers/FuzzMP3Loader.cpp | 2 +- Meta/Lagom/Fuzzers/FuzzQOALoader.cpp | 2 +- Meta/Lagom/Fuzzers/FuzzWAVLoader.cpp | 2 +- Meta/Lagom/Fuzzers/fuzzers.cmake | 8 ++-- Meta/gn/build/libs/pulse/enable.gni | 2 +- Meta/gn/secondary/Ladybird/BUILD.gn | 4 +- .../Userland/Libraries/LibAudio/BUILD.gn | 41 ---------------- .../Userland/Libraries/LibMedia/BUILD.gn | 40 ++++++++++++++++ .../Userland/Libraries/LibVideo/BUILD.gn | 2 +- .../Userland/Libraries/LibWeb/BUILD.gn | 2 +- README.md | 2 +- Tests/CMakeLists.txt | 1 - Tests/LibAudio/CMakeLists.txt | 9 ---- Tests/LibMedia/CMakeLists.txt | 11 ++++- Tests/{LibAudio => LibMedia}/TestFLACSpec.cpp | 2 +- .../TestPlaybackStream.cpp | 4 +- Tests/{LibAudio => LibMedia}/TestWav.cpp | 4 +- .../WAV/tone_11025_mono.wav | Bin .../WAV/tone_11025_stereo.wav | Bin .../WAV/tone_16000_mono.wav | Bin .../WAV/tone_16000_stereo.wav | Bin .../WAV/tone_22050_mono.wav | Bin .../WAV/tone_22050_stereo.wav | Bin .../WAV/tone_44100_mono.wav | Bin .../WAV/tone_44100_stereo.wav | Bin .../WAV/tone_8000_mono.wav | Bin .../WAV/tone_8000_stereo.wav | Bin Userland/Libraries/LibAudio/CMakeLists.txt | 44 ------------------ .../{LibAudio => LibMedia/Audio}/Encoder.h | 4 +- .../Audio}/FlacLoader.cpp | 14 +++--- .../{LibAudio => LibMedia/Audio}/FlacLoader.h | 0 .../{LibAudio => LibMedia/Audio}/FlacTypes.h | 0 .../Audio}/FlacWriter.cpp | 4 +- .../{LibAudio => LibMedia/Audio}/FlacWriter.h | 12 ++--- .../{LibAudio => LibMedia/Audio}/Forward.h | 0 .../Audio}/GenericTypes.cpp | 0 .../Audio}/GenericTypes.h | 0 .../{LibAudio => LibMedia/Audio}/Loader.cpp | 10 ++-- .../{LibAudio => LibMedia/Audio}/Loader.h | 10 ++-- .../Audio}/LoaderError.h | 0 .../{LibAudio => LibMedia/Audio}/MDCT.h | 0 .../Audio}/MP3HuffmanTables.h | 0 .../Audio}/MP3Loader.cpp | 0 .../{LibAudio => LibMedia/Audio}/MP3Loader.h | 2 +- .../{LibAudio => LibMedia/Audio}/MP3Tables.h | 0 .../{LibAudio => LibMedia/Audio}/MP3Types.h | 0 .../{LibAudio => LibMedia/Audio}/Metadata.cpp | 2 +- .../{LibAudio => LibMedia/Audio}/Metadata.h | 0 .../Audio}/MultiChannel.h | 2 +- .../Audio}/PlaybackStream.cpp | 6 +-- .../Audio}/PlaybackStream.h | 2 +- .../Audio}/PlaybackStreamAudioUnit.cpp | 2 +- .../Audio}/PlaybackStreamAudioUnit.h | 2 +- .../Audio}/PlaybackStreamOboe.cpp | 2 +- .../Audio}/PlaybackStreamOboe.h | 2 +- .../Audio}/PlaybackStreamPulseAudio.cpp | 0 .../Audio}/PlaybackStreamPulseAudio.h | 4 +- .../Audio}/PulseAudioWrappers.cpp | 0 .../Audio}/PulseAudioWrappers.h | 6 +-- .../Audio}/QOALoader.cpp | 0 .../{LibAudio => LibMedia/Audio}/QOALoader.h | 6 +-- .../{LibAudio => LibMedia/Audio}/QOATypes.cpp | 0 .../{LibAudio => LibMedia/Audio}/QOATypes.h | 0 .../{LibAudio => LibMedia/Audio}/Queue.h | 2 +- .../{LibAudio => LibMedia/Audio}/Resampler.h | 0 .../{LibAudio => LibMedia/Audio}/Sample.h | 0 .../Audio}/SampleFormats.cpp | 0 .../Audio}/SampleFormats.h | 0 .../Audio}/UserSampleQueue.cpp | 0 .../Audio}/UserSampleQueue.h | 2 +- .../Audio}/VorbisComment.cpp | 0 .../Audio}/VorbisComment.h | 4 +- .../Audio}/WavLoader.cpp | 0 .../{LibAudio => LibMedia/Audio}/WavLoader.h | 2 +- .../{LibAudio => LibMedia/Audio}/WavTypes.h | 0 .../Audio}/WavWriter.cpp | 6 +-- .../{LibAudio => LibMedia/Audio}/WavWriter.h | 6 +-- Userland/Libraries/LibMedia/CMakeLists.txt | 41 +++++++++++++++- Userland/Libraries/LibWeb/CMakeLists.txt | 2 +- Userland/Libraries/LibWeb/HTML/AudioTrack.cpp | 2 +- Userland/Libraries/LibWeb/HTML/AudioTrack.h | 2 +- .../LibWeb/HTML/HTMLMediaElement.cpp | 2 +- .../LibWeb/Platform/AudioCodecPlugin.cpp | 6 +-- .../LibWeb/Platform/AudioCodecPlugin.h | 2 +- .../Platform/AudioCodecPluginAgnostic.cpp | 2 +- .../Platform/AudioCodecPluginAgnostic.h | 2 +- Userland/Services/WebContent/CMakeLists.txt | 2 +- Userland/Services/WebContent/main.cpp | 2 +- Userland/Utilities/abench.cpp | 2 +- Userland/Utilities/aconv.cpp | 8 ++-- 101 files changed, 195 insertions(+), 211 deletions(-) delete mode 100644 Meta/gn/secondary/Userland/Libraries/LibAudio/BUILD.gn create mode 100644 Meta/gn/secondary/Userland/Libraries/LibMedia/BUILD.gn delete mode 100644 Tests/LibAudio/CMakeLists.txt rename Tests/{LibAudio => LibMedia}/TestFLACSpec.cpp (98%) rename Tests/{LibAudio => LibMedia}/TestPlaybackStream.cpp (94%) rename Tests/{LibAudio => LibMedia}/TestWav.cpp (97%) rename Tests/{LibAudio => LibMedia}/WAV/tone_11025_mono.wav (100%) rename Tests/{LibAudio => LibMedia}/WAV/tone_11025_stereo.wav (100%) rename Tests/{LibAudio => LibMedia}/WAV/tone_16000_mono.wav (100%) rename Tests/{LibAudio => LibMedia}/WAV/tone_16000_stereo.wav (100%) rename Tests/{LibAudio => LibMedia}/WAV/tone_22050_mono.wav (100%) rename Tests/{LibAudio => LibMedia}/WAV/tone_22050_stereo.wav (100%) rename Tests/{LibAudio => LibMedia}/WAV/tone_44100_mono.wav (100%) rename Tests/{LibAudio => LibMedia}/WAV/tone_44100_stereo.wav (100%) rename Tests/{LibAudio => LibMedia}/WAV/tone_8000_mono.wav (100%) rename Tests/{LibAudio => LibMedia}/WAV/tone_8000_stereo.wav (100%) delete mode 100644 Userland/Libraries/LibAudio/CMakeLists.txt rename Userland/Libraries/{LibAudio => LibMedia/Audio}/Encoder.h (96%) rename Userland/Libraries/{LibAudio => LibMedia/Audio}/FlacLoader.cpp (99%) rename Userland/Libraries/{LibAudio => LibMedia/Audio}/FlacLoader.h (100%) rename Userland/Libraries/{LibAudio => LibMedia/Audio}/FlacTypes.h (100%) rename Userland/Libraries/{LibAudio => LibMedia/Audio}/FlacWriter.cpp (99%) rename Userland/Libraries/{LibAudio => LibMedia/Audio}/FlacWriter.h (97%) rename Userland/Libraries/{LibAudio => LibMedia/Audio}/Forward.h (100%) rename Userland/Libraries/{LibAudio => LibMedia/Audio}/GenericTypes.cpp (100%) rename Userland/Libraries/{LibAudio => LibMedia/Audio}/GenericTypes.h (100%) rename Userland/Libraries/{LibAudio => LibMedia/Audio}/Loader.cpp (96%) rename Userland/Libraries/{LibAudio => LibMedia/Audio}/Loader.h (96%) rename Userland/Libraries/{LibAudio => LibMedia/Audio}/LoaderError.h (100%) rename Userland/Libraries/{LibAudio => LibMedia/Audio}/MDCT.h (100%) rename Userland/Libraries/{LibAudio => LibMedia/Audio}/MP3HuffmanTables.h (100%) rename Userland/Libraries/{LibAudio => LibMedia/Audio}/MP3Loader.cpp (100%) rename Userland/Libraries/{LibAudio => LibMedia/Audio}/MP3Loader.h (99%) rename Userland/Libraries/{LibAudio => LibMedia/Audio}/MP3Tables.h (100%) rename Userland/Libraries/{LibAudio => LibMedia/Audio}/MP3Types.h (100%) rename Userland/Libraries/{LibAudio => LibMedia/Audio}/Metadata.cpp (97%) rename Userland/Libraries/{LibAudio => LibMedia/Audio}/Metadata.h (100%) rename Userland/Libraries/{LibAudio => LibMedia/Audio}/MultiChannel.h (99%) rename Userland/Libraries/{LibAudio => LibMedia/Audio}/PlaybackStream.cpp (90%) rename Userland/Libraries/{LibAudio => LibMedia/Audio}/PlaybackStream.h (98%) rename Userland/Libraries/{LibAudio => LibMedia/Audio}/PlaybackStreamAudioUnit.cpp (99%) rename Userland/Libraries/{LibAudio => LibMedia/Audio}/PlaybackStreamAudioUnit.h (96%) rename Userland/Libraries/{LibAudio => LibMedia/Audio}/PlaybackStreamOboe.cpp (99%) rename Userland/Libraries/{LibAudio => LibMedia/Audio}/PlaybackStreamOboe.h (96%) rename Userland/Libraries/{LibAudio => LibMedia/Audio}/PlaybackStreamPulseAudio.cpp (100%) rename Userland/Libraries/{LibAudio => LibMedia/Audio}/PlaybackStreamPulseAudio.h (95%) rename Userland/Libraries/{LibAudio => LibMedia/Audio}/PulseAudioWrappers.cpp (100%) rename Userland/Libraries/{LibAudio => LibMedia/Audio}/PulseAudioWrappers.h (98%) rename Userland/Libraries/{LibAudio => LibMedia/Audio}/QOALoader.cpp (100%) rename Userland/Libraries/{LibAudio => LibMedia/Audio}/QOALoader.h (96%) rename Userland/Libraries/{LibAudio => LibMedia/Audio}/QOATypes.cpp (100%) rename Userland/Libraries/{LibAudio => LibMedia/Audio}/QOATypes.h (100%) rename Userland/Libraries/{LibAudio => LibMedia/Audio}/Queue.h (95%) rename Userland/Libraries/{LibAudio => LibMedia/Audio}/Resampler.h (100%) rename Userland/Libraries/{LibAudio => LibMedia/Audio}/Sample.h (100%) rename Userland/Libraries/{LibAudio => LibMedia/Audio}/SampleFormats.cpp (100%) rename Userland/Libraries/{LibAudio => LibMedia/Audio}/SampleFormats.h (100%) rename Userland/Libraries/{LibAudio => LibMedia/Audio}/UserSampleQueue.cpp (100%) rename Userland/Libraries/{LibAudio => LibMedia/Audio}/UserSampleQueue.h (97%) rename Userland/Libraries/{LibAudio => LibMedia/Audio}/VorbisComment.cpp (100%) rename Userland/Libraries/{LibAudio => LibMedia/Audio}/VorbisComment.h (86%) rename Userland/Libraries/{LibAudio => LibMedia/Audio}/WavLoader.cpp (100%) rename Userland/Libraries/{LibAudio => LibMedia/Audio}/WavLoader.h (98%) rename Userland/Libraries/{LibAudio => LibMedia/Audio}/WavTypes.h (100%) rename Userland/Libraries/{LibAudio => LibMedia/Audio}/WavWriter.cpp (97%) rename Userland/Libraries/{LibAudio => LibMedia/Audio}/WavWriter.h (92%) diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index f86ba86b7bf..c26e33277b2 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -69,7 +69,7 @@ Nobody is perfect, and sometimes we mess things up. That said, here are some goo * Make sure your commits are rebased on the master branch. * Wrap your commit messages at 72 characters. * The first line of the commit message is the subject line, and must have the format "Category: Brief description of what's being changed". The category should be the name of a library, application, service, utility, etc. - * Examples: `LibAudio`, `WebContent`, `CI`, `AK`, `RequestServer`, `js` + * Examples: `LibMedia`, `WebContent`, `CI`, `AK`, `RequestServer`, `js` * Don't use a category like "`Userland`" or "`Utilities`", except for generic changes that affect a large portion of code within these directories. * Don't use specific component names, e.g. C++ class names, as the category either - mention them in the summary instead. E.g. `LibGUI: Brief description of what's being changed in FooWidget` rather than `FooWidget: Brief description of what's being changed` * Several categories may be combined with `+`, e.g. `LibJS+LibWeb+Browser: ...` diff --git a/Ladybird/Android/src/main/cpp/WebContentService.cpp b/Ladybird/Android/src/main/cpp/WebContentService.cpp index 3af131daa3c..d15ee31defe 100644 --- a/Ladybird/Android/src/main/cpp/WebContentService.cpp +++ b/Ladybird/Android/src/main/cpp/WebContentService.cpp @@ -11,7 +11,6 @@ #include #include #include -#include #include #include #include @@ -19,6 +18,7 @@ #include #include #include +#include #include #include #include diff --git a/Ladybird/Qt/AudioCodecPluginQt.cpp b/Ladybird/Qt/AudioCodecPluginQt.cpp index 40df3ffe50e..eb95a570cb7 100644 --- a/Ladybird/Qt/AudioCodecPluginQt.cpp +++ b/Ladybird/Qt/AudioCodecPluginQt.cpp @@ -6,7 +6,7 @@ #include "AudioCodecPluginQt.h" #include "AudioThread.h" -#include +#include namespace Ladybird { diff --git a/Ladybird/Qt/AudioCodecPluginQt.h b/Ladybird/Qt/AudioCodecPluginQt.h index c26eefb8cd3..352ab839dab 100644 --- a/Ladybird/Qt/AudioCodecPluginQt.h +++ b/Ladybird/Qt/AudioCodecPluginQt.h @@ -9,7 +9,7 @@ #include #include #include -#include +#include #include #include diff --git a/Ladybird/Qt/AudioThread.h b/Ladybird/Qt/AudioThread.h index 87a50fd9885..3bf53aa8646 100644 --- a/Ladybird/Qt/AudioThread.h +++ b/Ladybird/Qt/AudioThread.h @@ -11,9 +11,9 @@ #include #include #include -#include -#include #include +#include +#include #include #include #include diff --git a/Ladybird/WebContent/CMakeLists.txt b/Ladybird/WebContent/CMakeLists.txt index bfc01d31f98..fdffcc567d2 100644 --- a/Ladybird/WebContent/CMakeLists.txt +++ b/Ladybird/WebContent/CMakeLists.txt @@ -34,7 +34,7 @@ target_include_directories(webcontent PUBLIC $) target_include_directories(webcontent PUBLIC $) -target_link_libraries(webcontent PUBLIC LibAudio LibCore LibFileSystem LibGfx LibIPC LibJS LibMain LibWeb LibWebSocket LibRequests LibWebView LibImageDecoderClient) +target_link_libraries(webcontent PUBLIC LibCore LibFileSystem LibGfx LibIPC LibJS LibMain LibMedia LibWeb LibWebSocket LibRequests LibWebView LibImageDecoderClient) if (HAVE_PULSEAUDIO) target_compile_definitions(webcontent PUBLIC HAVE_PULSEAUDIO=1) diff --git a/Ladybird/WebContent/main.cpp b/Ladybird/WebContent/main.cpp index 4084e88f8b4..4f4d7540d82 100644 --- a/Ladybird/WebContent/main.cpp +++ b/Ladybird/WebContent/main.cpp @@ -8,7 +8,6 @@ #include #include #include -#include #include #include #include @@ -19,6 +18,7 @@ #include #include #include +#include #include #include #include diff --git a/Meta/CMake/flac_spec_tests.cmake b/Meta/CMake/flac_spec_tests.cmake index ca86ba7bf09..b36a9f14f13 100644 --- a/Meta/CMake/flac_spec_tests.cmake +++ b/Meta/CMake/flac_spec_tests.cmake @@ -8,7 +8,7 @@ if(INCLUDE_FLAC_SPEC_TESTS) endif() set(FLAC_SPEC_TEST_GZ_URL https://github.com/ietf-wg-cellar/flac-test-files/archive/refs/heads/main.tar.gz) - set(FLAC_TEST_PATH ${CMAKE_BINARY_DIR}/Tests/LibAudio/FLAC CACHE PATH "Location of FLAC tests") + set(FLAC_TEST_PATH ${CMAKE_BINARY_DIR}/Tests/LibMedia/FLAC CACHE PATH "Location of FLAC tests") set(FLAC_SPEC_TEST_GZ_PATH ${FLAC_TEST_PATH}/flac-spec-testsuite.tar.gz) set(FLAC_SPEC_TEST_PATH ${FLAC_TEST_PATH}/SpecTests) diff --git a/Meta/Lagom/CMakeLists.txt b/Meta/Lagom/CMakeLists.txt index 1cd1b660932..98073c363bd 100644 --- a/Meta/Lagom/CMakeLists.txt +++ b/Meta/Lagom/CMakeLists.txt @@ -382,7 +382,6 @@ endif() # Lagom Libraries set(lagom_standard_libraries Archive - Audio Compress Crypto Diff @@ -449,8 +448,8 @@ if (ENABLE_FUZZERS OR ENABLE_COMPILER_EXPLORER_BUILD OR ANDROID OR IOS) endif() # Lagom Utilities -lagom_utility(abench SOURCES ../../Userland/Utilities/abench.cpp LIBS LibMain LibFileSystem LibAudio) -lagom_utility(aconv SOURCES ../../Userland/Utilities/aconv.cpp LIBS LibMain LibFileSystem LibAudio) +lagom_utility(abench SOURCES ../../Userland/Utilities/abench.cpp LIBS LibMain LibFileSystem LibMedia) +lagom_utility(aconv SOURCES ../../Userland/Utilities/aconv.cpp LIBS LibMain LibFileSystem LibMedia) if (ENABLE_GUI_TARGETS) lagom_utility(animation SOURCES ../../Userland/Utilities/animation.cpp LIBS LibGfx LibMain) @@ -540,14 +539,6 @@ if (BUILD_TESTING) lagom_test(../../Tests/LibTLS/TestTLSHandshake.cpp LibTLS LIBS LibTLS LibCrypto) lagom_test(../../Tests/LibTLS/TestTLSCertificateParser.cpp LibTLS LIBS LibTLS LibCrypto) - # The FLAC tests need a special working directory to find the test files - lagom_test(../../Tests/LibAudio/TestFLACSpec.cpp LIBS LibAudio WORKING_DIRECTORY "${FLAC_TEST_PATH}/..") - - lagom_test(../../Tests/LibAudio/TestPlaybackStream.cpp LIBS LibAudio) - if (HAVE_PULSEAUDIO) - target_compile_definitions(TestPlaybackStream PRIVATE HAVE_PULSEAUDIO=1) - endif() - # LibCore lagom_test(../../Tests/LibCore/TestLibCoreArgsParser.cpp) diff --git a/Meta/Lagom/Fuzzers/AudioFuzzerCommon.h b/Meta/Lagom/Fuzzers/AudioFuzzerCommon.h index b06a1377db0..b85461ae40a 100644 --- a/Meta/Lagom/Fuzzers/AudioFuzzerCommon.h +++ b/Meta/Lagom/Fuzzers/AudioFuzzerCommon.h @@ -10,7 +10,7 @@ #include #include -#include +#include #include #include diff --git a/Meta/Lagom/Fuzzers/FuzzFlacLoader.cpp b/Meta/Lagom/Fuzzers/FuzzFlacLoader.cpp index c1fd54c77bd..3f1fe5737fa 100644 --- a/Meta/Lagom/Fuzzers/FuzzFlacLoader.cpp +++ b/Meta/Lagom/Fuzzers/FuzzFlacLoader.cpp @@ -5,7 +5,7 @@ */ #include "AudioFuzzerCommon.h" -#include +#include extern "C" int LLVMFuzzerTestOneInput(uint8_t const* data, size_t size) { diff --git a/Meta/Lagom/Fuzzers/FuzzMP3Loader.cpp b/Meta/Lagom/Fuzzers/FuzzMP3Loader.cpp index 3b3a1a6f470..f7ed72b4526 100644 --- a/Meta/Lagom/Fuzzers/FuzzMP3Loader.cpp +++ b/Meta/Lagom/Fuzzers/FuzzMP3Loader.cpp @@ -5,7 +5,7 @@ */ #include "AudioFuzzerCommon.h" -#include +#include extern "C" int LLVMFuzzerTestOneInput(uint8_t const* data, size_t size) { diff --git a/Meta/Lagom/Fuzzers/FuzzQOALoader.cpp b/Meta/Lagom/Fuzzers/FuzzQOALoader.cpp index aa81593dfba..6ae5f6817f4 100644 --- a/Meta/Lagom/Fuzzers/FuzzQOALoader.cpp +++ b/Meta/Lagom/Fuzzers/FuzzQOALoader.cpp @@ -5,7 +5,7 @@ */ #include "AudioFuzzerCommon.h" -#include +#include extern "C" int LLVMFuzzerTestOneInput(uint8_t const* data, size_t size) { diff --git a/Meta/Lagom/Fuzzers/FuzzWAVLoader.cpp b/Meta/Lagom/Fuzzers/FuzzWAVLoader.cpp index cc2fa072f9f..5377da9acd3 100644 --- a/Meta/Lagom/Fuzzers/FuzzWAVLoader.cpp +++ b/Meta/Lagom/Fuzzers/FuzzWAVLoader.cpp @@ -5,7 +5,7 @@ */ #include "AudioFuzzerCommon.h" -#include +#include extern "C" int LLVMFuzzerTestOneInput(uint8_t const* data, size_t size) { diff --git a/Meta/Lagom/Fuzzers/fuzzers.cmake b/Meta/Lagom/Fuzzers/fuzzers.cmake index 39aae6ec975..3334e3219de 100644 --- a/Meta/Lagom/Fuzzers/fuzzers.cmake +++ b/Meta/Lagom/Fuzzers/fuzzers.cmake @@ -60,7 +60,7 @@ set(FUZZER_DEPENDENCIES_CSSParser LibWeb) set(FUZZER_DEPENDENCIES_DeflateCompression LibCompress) set(FUZZER_DEPENDENCIES_DeflateDecompression LibCompress) set(FUZZER_DEPENDENCIES_ELF LibELF) -set(FUZZER_DEPENDENCIES_FlacLoader LibAudio) +set(FUZZER_DEPENDENCIES_FlacLoader LibMedia) set(FUZZER_DEPENDENCIES_GIFLoader LibGfx) set(FUZZER_DEPENDENCIES_GzipDecompression LibCompress) set(FUZZER_DEPENDENCIES_GzipRoundtrip LibCompress) @@ -73,11 +73,11 @@ set(FUZZER_DEPENDENCIES_LzmaDecompression LibArchive LibCompress) set(FUZZER_DEPENDENCIES_LzmaRoundtrip LibCompress) set(FUZZER_DEPENDENCIES_MatroskaReader LibMedia) set(FUZZER_DEPENDENCIES_MD5 LibCrypto) -set(FUZZER_DEPENDENCIES_MP3Loader LibAudio) +set(FUZZER_DEPENDENCIES_MP3Loader LibMedia) set(FUZZER_DEPENDENCIES_PEM LibCrypto) set(FUZZER_DEPENDENCIES_PNGLoader LibGfx) set(FUZZER_DEPENDENCIES_Poly1305 LibCrypto) -set(FUZZER_DEPENDENCIES_QOALoader LibAudio) +set(FUZZER_DEPENDENCIES_QOALoader LibMedia) set(FUZZER_DEPENDENCIES_RegexECMA262 LibRegex) set(FUZZER_DEPENDENCIES_RegexPosixBasic LibRegex) set(FUZZER_DEPENDENCIES_RegexPosixExtended LibRegex) @@ -93,7 +93,7 @@ set(FUZZER_DEPENDENCIES_TTF LibGfx) set(FUZZER_DEPENDENCIES_TinyVGLoader LibGfx) set(FUZZER_DEPENDENCIES_URL LibURL) set(FUZZER_DEPENDENCIES_WasmParser LibWasm) -set(FUZZER_DEPENDENCIES_WAVLoader LibAudio) +set(FUZZER_DEPENDENCIES_WAVLoader LibMedia) set(FUZZER_DEPENDENCIES_WebPLoader LibGfx) set(FUZZER_DEPENDENCIES_WOFF LibGfx) set(FUZZER_DEPENDENCIES_WOFF2 LibGfx) diff --git a/Meta/gn/build/libs/pulse/enable.gni b/Meta/gn/build/libs/pulse/enable.gni index fb0aee18417..bd3dd1d4785 100644 --- a/Meta/gn/build/libs/pulse/enable.gni +++ b/Meta/gn/build/libs/pulse/enable.gni @@ -1,4 +1,4 @@ declare_args() { - # Select whether to build with PulseAudio support in LibAudio + # Select whether to build with PulseAudio support in LibMedia enable_pulseaudio = current_os == "linux" } diff --git a/Meta/gn/secondary/Ladybird/BUILD.gn b/Meta/gn/secondary/Ladybird/BUILD.gn index b9d5653891f..bdf955051c9 100644 --- a/Meta/gn/secondary/Ladybird/BUILD.gn +++ b/Meta/gn/secondary/Ladybird/BUILD.gn @@ -384,7 +384,6 @@ if (current_os != "mac") { bundle_data("ladybird_bundle_libs") { public_deps = [ "//AK", - "//Userland/Libraries/LibAudio", "//Userland/Libraries/LibCompress", "//Userland/Libraries/LibCore", "//Userland/Libraries/LibCrypto", @@ -397,6 +396,7 @@ if (current_os != "mac") { "//Userland/Libraries/LibImageDecoderClient", "//Userland/Libraries/LibJS", "//Userland/Libraries/LibLine", + "//Userland/Libraries/LibMedia", "//Userland/Libraries/LibProtocol", "//Userland/Libraries/LibRIFF", "//Userland/Libraries/LibRegex", @@ -414,7 +414,6 @@ if (current_os != "mac") { ] sources = [ "$root_out_dir/lib/liblagom-ak.dylib", - "$root_out_dir/lib/liblagom-audio.dylib", "$root_out_dir/lib/liblagom-compress.dylib", "$root_out_dir/lib/liblagom-core-minimal.dylib", "$root_out_dir/lib/liblagom-core.dylib", @@ -428,6 +427,7 @@ if (current_os != "mac") { "$root_out_dir/lib/liblagom-ipc.dylib", "$root_out_dir/lib/liblagom-js.dylib", "$root_out_dir/lib/liblagom-line.dylib", + "$root_out_dir/lib/liblagom-media.dylib", "$root_out_dir/lib/liblagom-protocol.dylib", "$root_out_dir/lib/liblagom-regex.dylib", "$root_out_dir/lib/liblagom-riff.dylib", diff --git a/Meta/gn/secondary/Userland/Libraries/LibAudio/BUILD.gn b/Meta/gn/secondary/Userland/Libraries/LibAudio/BUILD.gn deleted file mode 100644 index c080c86fb00..00000000000 --- a/Meta/gn/secondary/Userland/Libraries/LibAudio/BUILD.gn +++ /dev/null @@ -1,41 +0,0 @@ -import("//Meta/gn/build/libs/pulse/enable.gni") - -shared_library("LibAudio") { - include_dirs = [ "//Userland/Libraries" ] - sources = [ - "FlacLoader.cpp", - "GenericTypes.cpp", - "Loader.cpp", - "MP3Loader.cpp", - "Metadata.cpp", - "PlaybackStream.cpp", - "QOALoader.cpp", - "QOATypes.cpp", - "SampleFormats.cpp", - "UserSampleQueue.cpp", - "VorbisComment.cpp", - "WavLoader.cpp", - "WavWriter.cpp", - ] - if (enable_pulseaudio) { - sources += [ - "PlaybackStreamPulseAudio.cpp", - "PulseAudioWrappers.cpp", - ] - } - if (current_os == "mac") { - sources += [ "PlaybackStreamAudioUnit.cpp" ] - frameworks = [ "AudioUnit.framework" ] - } - deps = [ - "//AK", - "//Meta/gn/build/libs/pulse", - "//Userland/Libraries/LibCore", - "//Userland/Libraries/LibCrypto", - "//Userland/Libraries/LibIPC", - "//Userland/Libraries/LibRIFF", - "//Userland/Libraries/LibThreading", - "//Userland/Libraries/LibUnicode", - ] - output_name = "audio" -} diff --git a/Meta/gn/secondary/Userland/Libraries/LibMedia/BUILD.gn b/Meta/gn/secondary/Userland/Libraries/LibMedia/BUILD.gn new file mode 100644 index 00000000000..d5bac29d7ed --- /dev/null +++ b/Meta/gn/secondary/Userland/Libraries/LibMedia/BUILD.gn @@ -0,0 +1,40 @@ +import("//Meta/gn/build/libs/pulse/enable.gni") + +shared_library("LibMedia") { + include_dirs = [ "//Userland/Libraries" ] + sources = [ + "Audio/FlacLoader.cpp", + "Audio/GenericTypes.cpp", + "Audio/Loader.cpp", + "Audio/MP3Loader.cpp", + "Audio/Metadata.cpp", + "Audio/PlaybackStream.cpp", + "Audio/QOALoader.cpp", + "Audio/QOATypes.cpp", + "Audio/SampleFormats.cpp", + "Audio/UserSampleQueue.cpp", + "Audio/VorbisComment.cpp", + "Audio/WavLoader.cpp", + "Audio/WavWriter.cpp", + ] + if (enable_pulseaudio) { + sources += [ + "Audio/PlaybackStreamPulseAudio.cpp", + "Audio/PulseAudioWrappers.cpp", + ] + } + if (current_os == "mac") { + sources += [ "Audio/PlaybackStreamAudioUnit.cpp" ] + frameworks = [ "AudioUnit.framework" ] + } + deps = [ + "//AK", + "//Meta/gn/build/libs/pulse", + "//Userland/Libraries/LibCore", + "//Userland/Libraries/LibCrypto", + "//Userland/Libraries/LibIPC", + "//Userland/Libraries/LibRIFF", + "//Userland/Libraries/LibThreading", + ] + output_name = "media" +} diff --git a/Meta/gn/secondary/Userland/Libraries/LibVideo/BUILD.gn b/Meta/gn/secondary/Userland/Libraries/LibVideo/BUILD.gn index 68f7a65babc..6b458a07d7c 100644 --- a/Meta/gn/secondary/Userland/Libraries/LibVideo/BUILD.gn +++ b/Meta/gn/secondary/Userland/Libraries/LibVideo/BUILD.gn @@ -4,10 +4,10 @@ shared_library("LibVideo") { deps = [ "//AK", - "//Userland/Libraries/LibAudio", "//Userland/Libraries/LibCore", "//Userland/Libraries/LibGfx", "//Userland/Libraries/LibIPC", + "//Userland/Libraries/LibMedia", "//Userland/Libraries/LibThreading", ] sources = [ diff --git a/Meta/gn/secondary/Userland/Libraries/LibWeb/BUILD.gn b/Meta/gn/secondary/Userland/Libraries/LibWeb/BUILD.gn index c3a80b1fd6c..3682db1b668 100644 --- a/Meta/gn/secondary/Userland/Libraries/LibWeb/BUILD.gn +++ b/Meta/gn/secondary/Userland/Libraries/LibWeb/BUILD.gn @@ -344,7 +344,6 @@ shared_library("LibWeb") { "XLink", "XML", "//AK", - "//Userland/Libraries/LibAudio", "//Userland/Libraries/LibCore", "//Userland/Libraries/LibCrypto", "//Userland/Libraries/LibGfx", @@ -353,6 +352,7 @@ shared_library("LibWeb") { "//Userland/Libraries/LibIPC", "//Userland/Libraries/LibJS", "//Userland/Libraries/LibLocale", + "//Userland/Libraries/LibMedia", "//Userland/Libraries/LibRegex", "//Userland/Libraries/LibSyntax", "//Userland/Libraries/LibTLS", diff --git a/README.md b/README.md index ce2860e3aa3..282f4715641 100644 --- a/README.md +++ b/README.md @@ -26,7 +26,7 @@ At the moment, many core library support components are inherited from SerenityO - LibGfx: 2D Graphics Library, Image Decoding and Rendering - LibArchive: Archive file format support - LibUnicode: Unicode and locale support -- LibAudio, LibMedia: Audio and video playback +- LibMedia: Audio and video playback - LibCore: Event loop, OS abstraction layer - LibIPC: Inter-process communication diff --git a/Tests/CMakeLists.txt b/Tests/CMakeLists.txt index 67a6c3f78f1..e3619abe14c 100644 --- a/Tests/CMakeLists.txt +++ b/Tests/CMakeLists.txt @@ -1,5 +1,4 @@ add_subdirectory(AK) -add_subdirectory(LibAudio) add_subdirectory(LibCompress) add_subdirectory(LibCore) add_subdirectory(LibDiff) diff --git a/Tests/LibAudio/CMakeLists.txt b/Tests/LibAudio/CMakeLists.txt deleted file mode 100644 index 98574e2abce..00000000000 --- a/Tests/LibAudio/CMakeLists.txt +++ /dev/null @@ -1,9 +0,0 @@ -set(TEST_SOURCES - TestWav.cpp - TestFLACSpec.cpp - TestPlaybackStream.cpp -) - -foreach(source IN LISTS TEST_SOURCES) - serenity_test("${source}" LibAudio LIBS LibAudio LibFileSystem) -endforeach() diff --git a/Tests/LibMedia/CMakeLists.txt b/Tests/LibMedia/CMakeLists.txt index 13714389a5c..5d2d070b146 100644 --- a/Tests/LibMedia/CMakeLists.txt +++ b/Tests/LibMedia/CMakeLists.txt @@ -1,9 +1,18 @@ set(TEST_SOURCES TestH264Decode.cpp TestParseMatroska.cpp + TestPlaybackStream.cpp TestVP9Decode.cpp + TestWav.cpp ) foreach(source IN LISTS TEST_SOURCES) - serenity_test("${source}" LibMedia LIBS LibMedia) + lagom_test("${source}" LibMedia LIBS LibMedia LibFileSystem WORKING_DIRECTORY "${CMAKE_CURRENT_SOURCE_DIR}") endforeach() + +# The FLAC tests need a special working directory to find the test files +lagom_test(TestFLACSpec.cpp LIBS LibMedia WORKING_DIRECTORY "${FLAC_TEST_PATH}/..") + +if (HAVE_PULSEAUDIO) + target_compile_definitions(TestPlaybackStream PRIVATE HAVE_PULSEAUDIO=1) +endif() diff --git a/Tests/LibAudio/TestFLACSpec.cpp b/Tests/LibMedia/TestFLACSpec.cpp similarity index 98% rename from Tests/LibAudio/TestFLACSpec.cpp rename to Tests/LibMedia/TestFLACSpec.cpp index 6192064c1e6..f1034efaa3e 100644 --- a/Tests/LibAudio/TestFLACSpec.cpp +++ b/Tests/LibMedia/TestFLACSpec.cpp @@ -5,8 +5,8 @@ */ #include -#include #include +#include #include struct DiscoverFLACTestsHack { diff --git a/Tests/LibAudio/TestPlaybackStream.cpp b/Tests/LibMedia/TestPlaybackStream.cpp similarity index 94% rename from Tests/LibAudio/TestPlaybackStream.cpp rename to Tests/LibMedia/TestPlaybackStream.cpp index 6988ea2db64..43874df1e20 100644 --- a/Tests/LibAudio/TestPlaybackStream.cpp +++ b/Tests/LibMedia/TestPlaybackStream.cpp @@ -7,13 +7,13 @@ #include #include #include -#include #include +#include #include #include #if defined(HAVE_PULSEAUDIO) -# include +# include #endif // FIXME: CI doesn't run an AudioServer currently. Creating one in /etc/SystemServer.ini does not diff --git a/Tests/LibAudio/TestWav.cpp b/Tests/LibMedia/TestWav.cpp similarity index 97% rename from Tests/LibAudio/TestWav.cpp rename to Tests/LibMedia/TestWav.cpp index 14ce45e731f..cb8ab5fc65c 100644 --- a/Tests/LibAudio/TestWav.cpp +++ b/Tests/LibMedia/TestWav.cpp @@ -6,12 +6,12 @@ #include #include -#include -#include #include #include #include #include +#include +#include #include static void compare_files(StringView const& in_path, StringView const& out_path) diff --git a/Tests/LibAudio/WAV/tone_11025_mono.wav b/Tests/LibMedia/WAV/tone_11025_mono.wav similarity index 100% rename from Tests/LibAudio/WAV/tone_11025_mono.wav rename to Tests/LibMedia/WAV/tone_11025_mono.wav diff --git a/Tests/LibAudio/WAV/tone_11025_stereo.wav b/Tests/LibMedia/WAV/tone_11025_stereo.wav similarity index 100% rename from Tests/LibAudio/WAV/tone_11025_stereo.wav rename to Tests/LibMedia/WAV/tone_11025_stereo.wav diff --git a/Tests/LibAudio/WAV/tone_16000_mono.wav b/Tests/LibMedia/WAV/tone_16000_mono.wav similarity index 100% rename from Tests/LibAudio/WAV/tone_16000_mono.wav rename to Tests/LibMedia/WAV/tone_16000_mono.wav diff --git a/Tests/LibAudio/WAV/tone_16000_stereo.wav b/Tests/LibMedia/WAV/tone_16000_stereo.wav similarity index 100% rename from Tests/LibAudio/WAV/tone_16000_stereo.wav rename to Tests/LibMedia/WAV/tone_16000_stereo.wav diff --git a/Tests/LibAudio/WAV/tone_22050_mono.wav b/Tests/LibMedia/WAV/tone_22050_mono.wav similarity index 100% rename from Tests/LibAudio/WAV/tone_22050_mono.wav rename to Tests/LibMedia/WAV/tone_22050_mono.wav diff --git a/Tests/LibAudio/WAV/tone_22050_stereo.wav b/Tests/LibMedia/WAV/tone_22050_stereo.wav similarity index 100% rename from Tests/LibAudio/WAV/tone_22050_stereo.wav rename to Tests/LibMedia/WAV/tone_22050_stereo.wav diff --git a/Tests/LibAudio/WAV/tone_44100_mono.wav b/Tests/LibMedia/WAV/tone_44100_mono.wav similarity index 100% rename from Tests/LibAudio/WAV/tone_44100_mono.wav rename to Tests/LibMedia/WAV/tone_44100_mono.wav diff --git a/Tests/LibAudio/WAV/tone_44100_stereo.wav b/Tests/LibMedia/WAV/tone_44100_stereo.wav similarity index 100% rename from Tests/LibAudio/WAV/tone_44100_stereo.wav rename to Tests/LibMedia/WAV/tone_44100_stereo.wav diff --git a/Tests/LibAudio/WAV/tone_8000_mono.wav b/Tests/LibMedia/WAV/tone_8000_mono.wav similarity index 100% rename from Tests/LibAudio/WAV/tone_8000_mono.wav rename to Tests/LibMedia/WAV/tone_8000_mono.wav diff --git a/Tests/LibAudio/WAV/tone_8000_stereo.wav b/Tests/LibMedia/WAV/tone_8000_stereo.wav similarity index 100% rename from Tests/LibAudio/WAV/tone_8000_stereo.wav rename to Tests/LibMedia/WAV/tone_8000_stereo.wav diff --git a/Userland/Libraries/LibAudio/CMakeLists.txt b/Userland/Libraries/LibAudio/CMakeLists.txt deleted file mode 100644 index 0081052f1d0..00000000000 --- a/Userland/Libraries/LibAudio/CMakeLists.txt +++ /dev/null @@ -1,44 +0,0 @@ -set(SOURCES - GenericTypes.cpp - SampleFormats.cpp - Loader.cpp - WavLoader.cpp - FlacLoader.cpp - FlacWriter.cpp - WavWriter.cpp - Metadata.cpp - MP3Loader.cpp - PlaybackStream.cpp - QOALoader.cpp - QOATypes.cpp - UserSampleQueue.cpp - VorbisComment.cpp -) - -if (HAVE_PULSEAUDIO) - list(APPEND SOURCES - PlaybackStreamPulseAudio.cpp - PulseAudioWrappers.cpp - ) -endif() - -serenity_lib(LibAudio audio) -target_link_libraries(LibAudio PRIVATE LibCore LibRIFF LibIPC LibThreading LibUnicode LibCrypto) - -if (HAVE_PULSEAUDIO) - target_link_libraries(LibAudio PRIVATE pulse) - target_compile_definitions(LibAudio PRIVATE HAVE_PULSEAUDIO=1) -endif() - -if (APPLE AND NOT IOS) - target_sources(LibAudio PRIVATE PlaybackStreamAudioUnit.cpp) - - find_library(AUDIO_UNIT AudioUnit REQUIRED) - target_link_libraries(LibAudio PRIVATE ${AUDIO_UNIT}) -endif() - -if (ANDROID) - target_sources(LibAudio PRIVATE PlaybackStreamOboe.cpp) - find_package(oboe REQUIRED CONFIG) - target_link_libraries(LibAudio PRIVATE log oboe::oboe) -endif() diff --git a/Userland/Libraries/LibAudio/Encoder.h b/Userland/Libraries/LibMedia/Audio/Encoder.h similarity index 96% rename from Userland/Libraries/LibAudio/Encoder.h rename to Userland/Libraries/LibMedia/Audio/Encoder.h index 324e0905364..aab62be8c8e 100644 --- a/Userland/Libraries/LibAudio/Encoder.h +++ b/Userland/Libraries/LibMedia/Audio/Encoder.h @@ -6,10 +6,10 @@ #pragma once +#include "Forward.h" +#include "Sample.h" #include #include -#include -#include namespace Audio { diff --git a/Userland/Libraries/LibAudio/FlacLoader.cpp b/Userland/Libraries/LibMedia/Audio/FlacLoader.cpp similarity index 99% rename from Userland/Libraries/LibAudio/FlacLoader.cpp rename to Userland/Libraries/LibMedia/Audio/FlacLoader.cpp index 6d809d65284..1077ab6fc44 100644 --- a/Userland/Libraries/LibAudio/FlacLoader.cpp +++ b/Userland/Libraries/LibMedia/Audio/FlacLoader.cpp @@ -4,6 +4,13 @@ * SPDX-License-Identifier: BSD-2-Clause */ +#include "FlacLoader.h" +#include "FlacTypes.h" +#include "GenericTypes.h" +#include "LoaderError.h" +#include "MultiChannel.h" +#include "Resampler.h" +#include "VorbisComment.h" #include #include #include @@ -18,13 +25,6 @@ #include #include #include -#include -#include -#include -#include -#include -#include -#include #include #include #include diff --git a/Userland/Libraries/LibAudio/FlacLoader.h b/Userland/Libraries/LibMedia/Audio/FlacLoader.h similarity index 100% rename from Userland/Libraries/LibAudio/FlacLoader.h rename to Userland/Libraries/LibMedia/Audio/FlacLoader.h diff --git a/Userland/Libraries/LibAudio/FlacTypes.h b/Userland/Libraries/LibMedia/Audio/FlacTypes.h similarity index 100% rename from Userland/Libraries/LibAudio/FlacTypes.h rename to Userland/Libraries/LibMedia/Audio/FlacTypes.h diff --git a/Userland/Libraries/LibAudio/FlacWriter.cpp b/Userland/Libraries/LibMedia/Audio/FlacWriter.cpp similarity index 99% rename from Userland/Libraries/LibAudio/FlacWriter.cpp rename to Userland/Libraries/LibMedia/Audio/FlacWriter.cpp index 434e6411d14..a361c4f877a 100644 --- a/Userland/Libraries/LibAudio/FlacWriter.cpp +++ b/Userland/Libraries/LibMedia/Audio/FlacWriter.cpp @@ -5,14 +5,14 @@ */ #include "FlacWriter.h" +#include "Metadata.h" +#include "VorbisComment.h" #include #include #include #include #include #include -#include -#include #include namespace Audio { diff --git a/Userland/Libraries/LibAudio/FlacWriter.h b/Userland/Libraries/LibMedia/Audio/FlacWriter.h similarity index 97% rename from Userland/Libraries/LibAudio/FlacWriter.h rename to Userland/Libraries/LibMedia/Audio/FlacWriter.h index 21e2631dd93..fcb8758c6de 100644 --- a/Userland/Libraries/LibAudio/FlacWriter.h +++ b/Userland/Libraries/LibMedia/Audio/FlacWriter.h @@ -6,17 +6,17 @@ #pragma once +#include "Encoder.h" +#include "FlacTypes.h" +#include "Forward.h" +#include "GenericTypes.h" +#include "Sample.h" +#include "SampleFormats.h" #include #include #include #include #include -#include -#include -#include -#include -#include -#include #include namespace Audio { diff --git a/Userland/Libraries/LibAudio/Forward.h b/Userland/Libraries/LibMedia/Audio/Forward.h similarity index 100% rename from Userland/Libraries/LibAudio/Forward.h rename to Userland/Libraries/LibMedia/Audio/Forward.h diff --git a/Userland/Libraries/LibAudio/GenericTypes.cpp b/Userland/Libraries/LibMedia/Audio/GenericTypes.cpp similarity index 100% rename from Userland/Libraries/LibAudio/GenericTypes.cpp rename to Userland/Libraries/LibMedia/Audio/GenericTypes.cpp diff --git a/Userland/Libraries/LibAudio/GenericTypes.h b/Userland/Libraries/LibMedia/Audio/GenericTypes.h similarity index 100% rename from Userland/Libraries/LibAudio/GenericTypes.h rename to Userland/Libraries/LibMedia/Audio/GenericTypes.h diff --git a/Userland/Libraries/LibAudio/Loader.cpp b/Userland/Libraries/LibMedia/Audio/Loader.cpp similarity index 96% rename from Userland/Libraries/LibAudio/Loader.cpp rename to Userland/Libraries/LibMedia/Audio/Loader.cpp index 47cb71c0361..67e1f46fe88 100644 --- a/Userland/Libraries/LibAudio/Loader.cpp +++ b/Userland/Libraries/LibMedia/Audio/Loader.cpp @@ -4,12 +4,12 @@ * SPDX-License-Identifier: BSD-2-Clause */ +#include "FlacLoader.h" +#include "Loader.h" +#include "MP3Loader.h" +#include "QOALoader.h" +#include "WavLoader.h" #include -#include -#include -#include -#include -#include #include namespace Audio { diff --git a/Userland/Libraries/LibAudio/Loader.h b/Userland/Libraries/LibMedia/Audio/Loader.h similarity index 96% rename from Userland/Libraries/LibAudio/Loader.h rename to Userland/Libraries/LibMedia/Audio/Loader.h index ba7cc4a5409..7aceafd05cf 100644 --- a/Userland/Libraries/LibAudio/Loader.h +++ b/Userland/Libraries/LibMedia/Audio/Loader.h @@ -6,6 +6,11 @@ #pragma once +#include "GenericTypes.h" +#include "LoaderError.h" +#include "Metadata.h" +#include "Sample.h" +#include "SampleFormats.h" #include #include #include @@ -16,11 +21,6 @@ #include #include #include -#include -#include -#include -#include -#include namespace Audio { diff --git a/Userland/Libraries/LibAudio/LoaderError.h b/Userland/Libraries/LibMedia/Audio/LoaderError.h similarity index 100% rename from Userland/Libraries/LibAudio/LoaderError.h rename to Userland/Libraries/LibMedia/Audio/LoaderError.h diff --git a/Userland/Libraries/LibAudio/MDCT.h b/Userland/Libraries/LibMedia/Audio/MDCT.h similarity index 100% rename from Userland/Libraries/LibAudio/MDCT.h rename to Userland/Libraries/LibMedia/Audio/MDCT.h diff --git a/Userland/Libraries/LibAudio/MP3HuffmanTables.h b/Userland/Libraries/LibMedia/Audio/MP3HuffmanTables.h similarity index 100% rename from Userland/Libraries/LibAudio/MP3HuffmanTables.h rename to Userland/Libraries/LibMedia/Audio/MP3HuffmanTables.h diff --git a/Userland/Libraries/LibAudio/MP3Loader.cpp b/Userland/Libraries/LibMedia/Audio/MP3Loader.cpp similarity index 100% rename from Userland/Libraries/LibAudio/MP3Loader.cpp rename to Userland/Libraries/LibMedia/Audio/MP3Loader.cpp diff --git a/Userland/Libraries/LibAudio/MP3Loader.h b/Userland/Libraries/LibMedia/Audio/MP3Loader.h similarity index 99% rename from Userland/Libraries/LibAudio/MP3Loader.h rename to Userland/Libraries/LibMedia/Audio/MP3Loader.h index 153a0893484..5e7b88c94cb 100644 --- a/Userland/Libraries/LibAudio/MP3Loader.h +++ b/Userland/Libraries/LibMedia/Audio/MP3Loader.h @@ -7,10 +7,10 @@ #pragma once #include "Loader.h" +#include "MDCT.h" #include "MP3Types.h" #include #include -#include namespace Audio { diff --git a/Userland/Libraries/LibAudio/MP3Tables.h b/Userland/Libraries/LibMedia/Audio/MP3Tables.h similarity index 100% rename from Userland/Libraries/LibAudio/MP3Tables.h rename to Userland/Libraries/LibMedia/Audio/MP3Tables.h diff --git a/Userland/Libraries/LibAudio/MP3Types.h b/Userland/Libraries/LibMedia/Audio/MP3Types.h similarity index 100% rename from Userland/Libraries/LibAudio/MP3Types.h rename to Userland/Libraries/LibMedia/Audio/MP3Types.h diff --git a/Userland/Libraries/LibAudio/Metadata.cpp b/Userland/Libraries/LibMedia/Audio/Metadata.cpp similarity index 97% rename from Userland/Libraries/LibAudio/Metadata.cpp rename to Userland/Libraries/LibMedia/Audio/Metadata.cpp index 394760a4d26..1c9084171c1 100644 --- a/Userland/Libraries/LibAudio/Metadata.cpp +++ b/Userland/Libraries/LibMedia/Audio/Metadata.cpp @@ -45,7 +45,7 @@ void Metadata::replace_encoder_with_serenity() // Unset the encoder field in this case; we definitely want to replace the existing encoder field. if (version_or_error.is_error()) encoder = {}; - auto encoder_string = String::formatted("SerenityOS LibAudio {}", version_or_error.release_value()); + auto encoder_string = String::formatted("SerenityOS LibMedia {}", version_or_error.release_value()); if (encoder_string.is_error()) encoder = {}; encoder = encoder_string.release_value(); diff --git a/Userland/Libraries/LibAudio/Metadata.h b/Userland/Libraries/LibMedia/Audio/Metadata.h similarity index 100% rename from Userland/Libraries/LibAudio/Metadata.h rename to Userland/Libraries/LibMedia/Audio/Metadata.h diff --git a/Userland/Libraries/LibAudio/MultiChannel.h b/Userland/Libraries/LibMedia/Audio/MultiChannel.h similarity index 99% rename from Userland/Libraries/LibAudio/MultiChannel.h rename to Userland/Libraries/LibMedia/Audio/MultiChannel.h index d88873acf2d..fdcb4d889d4 100644 --- a/Userland/Libraries/LibAudio/MultiChannel.h +++ b/Userland/Libraries/LibMedia/Audio/MultiChannel.h @@ -6,9 +6,9 @@ #pragma once +#include "Sample.h" #include #include -#include namespace Audio { diff --git a/Userland/Libraries/LibAudio/PlaybackStream.cpp b/Userland/Libraries/LibMedia/Audio/PlaybackStream.cpp similarity index 90% rename from Userland/Libraries/LibAudio/PlaybackStream.cpp rename to Userland/Libraries/LibMedia/Audio/PlaybackStream.cpp index 94e7e625b09..1e4cf7ac568 100644 --- a/Userland/Libraries/LibAudio/PlaybackStream.cpp +++ b/Userland/Libraries/LibMedia/Audio/PlaybackStream.cpp @@ -10,11 +10,11 @@ #include #if defined(HAVE_PULSEAUDIO) -# include +# include "PlaybackStreamPulseAudio.h" #elif defined(AK_OS_MACOS) -# include +# include "PlaybackStreamAudioUnit.h" #elif defined(AK_OS_ANDROID) -# include +# include "PlaybackStreamOboe.h" #endif namespace Audio { diff --git a/Userland/Libraries/LibAudio/PlaybackStream.h b/Userland/Libraries/LibMedia/Audio/PlaybackStream.h similarity index 98% rename from Userland/Libraries/LibAudio/PlaybackStream.h rename to Userland/Libraries/LibMedia/Audio/PlaybackStream.h index 847859ee03c..464a842aa96 100644 --- a/Userland/Libraries/LibAudio/PlaybackStream.h +++ b/Userland/Libraries/LibMedia/Audio/PlaybackStream.h @@ -6,11 +6,11 @@ #pragma once +#include "SampleFormats.h" #include #include #include #include -#include #include #include #include diff --git a/Userland/Libraries/LibAudio/PlaybackStreamAudioUnit.cpp b/Userland/Libraries/LibMedia/Audio/PlaybackStreamAudioUnit.cpp similarity index 99% rename from Userland/Libraries/LibAudio/PlaybackStreamAudioUnit.cpp rename to Userland/Libraries/LibMedia/Audio/PlaybackStreamAudioUnit.cpp index abc3a61b36a..f6e6d946c03 100644 --- a/Userland/Libraries/LibAudio/PlaybackStreamAudioUnit.cpp +++ b/Userland/Libraries/LibMedia/Audio/PlaybackStreamAudioUnit.cpp @@ -5,9 +5,9 @@ * SPDX-License-Identifier: BSD-2-Clause */ +#include "PlaybackStreamAudioUnit.h" #include #include -#include #include #include diff --git a/Userland/Libraries/LibAudio/PlaybackStreamAudioUnit.h b/Userland/Libraries/LibMedia/Audio/PlaybackStreamAudioUnit.h similarity index 96% rename from Userland/Libraries/LibAudio/PlaybackStreamAudioUnit.h rename to Userland/Libraries/LibMedia/Audio/PlaybackStreamAudioUnit.h index c4650147ba8..96650787289 100644 --- a/Userland/Libraries/LibAudio/PlaybackStreamAudioUnit.h +++ b/Userland/Libraries/LibMedia/Audio/PlaybackStreamAudioUnit.h @@ -7,9 +7,9 @@ #pragma once +#include "PlaybackStream.h" #include #include -#include namespace Audio { diff --git a/Userland/Libraries/LibAudio/PlaybackStreamOboe.cpp b/Userland/Libraries/LibMedia/Audio/PlaybackStreamOboe.cpp similarity index 99% rename from Userland/Libraries/LibAudio/PlaybackStreamOboe.cpp rename to Userland/Libraries/LibMedia/Audio/PlaybackStreamOboe.cpp index 59e837dc625..34ff8e19e02 100644 --- a/Userland/Libraries/LibAudio/PlaybackStreamOboe.cpp +++ b/Userland/Libraries/LibMedia/Audio/PlaybackStreamOboe.cpp @@ -4,9 +4,9 @@ * SPDX-License-Identifier: BSD-2-Clause */ +#include "PlaybackStreamOboe.h" #include #include -#include #include #include #include diff --git a/Userland/Libraries/LibAudio/PlaybackStreamOboe.h b/Userland/Libraries/LibMedia/Audio/PlaybackStreamOboe.h similarity index 96% rename from Userland/Libraries/LibAudio/PlaybackStreamOboe.h rename to Userland/Libraries/LibMedia/Audio/PlaybackStreamOboe.h index f988537284e..697ad417316 100644 --- a/Userland/Libraries/LibAudio/PlaybackStreamOboe.h +++ b/Userland/Libraries/LibMedia/Audio/PlaybackStreamOboe.h @@ -6,9 +6,9 @@ #pragma once +#include "PlaybackStream.h" #include #include -#include namespace Audio { diff --git a/Userland/Libraries/LibAudio/PlaybackStreamPulseAudio.cpp b/Userland/Libraries/LibMedia/Audio/PlaybackStreamPulseAudio.cpp similarity index 100% rename from Userland/Libraries/LibAudio/PlaybackStreamPulseAudio.cpp rename to Userland/Libraries/LibMedia/Audio/PlaybackStreamPulseAudio.cpp diff --git a/Userland/Libraries/LibAudio/PlaybackStreamPulseAudio.h b/Userland/Libraries/LibMedia/Audio/PlaybackStreamPulseAudio.h similarity index 95% rename from Userland/Libraries/LibAudio/PlaybackStreamPulseAudio.h rename to Userland/Libraries/LibMedia/Audio/PlaybackStreamPulseAudio.h index 7b6dcc20a82..f9d7ceff0a8 100644 --- a/Userland/Libraries/LibAudio/PlaybackStreamPulseAudio.h +++ b/Userland/Libraries/LibMedia/Audio/PlaybackStreamPulseAudio.h @@ -6,8 +6,8 @@ #pragma once -#include -#include +#include "PlaybackStream.h" +#include "PulseAudioWrappers.h" namespace Audio { diff --git a/Userland/Libraries/LibAudio/PulseAudioWrappers.cpp b/Userland/Libraries/LibMedia/Audio/PulseAudioWrappers.cpp similarity index 100% rename from Userland/Libraries/LibAudio/PulseAudioWrappers.cpp rename to Userland/Libraries/LibMedia/Audio/PulseAudioWrappers.cpp diff --git a/Userland/Libraries/LibAudio/PulseAudioWrappers.h b/Userland/Libraries/LibMedia/Audio/PulseAudioWrappers.h similarity index 98% rename from Userland/Libraries/LibAudio/PulseAudioWrappers.h rename to Userland/Libraries/LibMedia/Audio/PulseAudioWrappers.h index ed445c89df6..4bf0f43912a 100644 --- a/Userland/Libraries/LibAudio/PulseAudioWrappers.h +++ b/Userland/Libraries/LibMedia/Audio/PulseAudioWrappers.h @@ -6,13 +6,13 @@ #pragma once +#include "Forward.h" +#include "PlaybackStream.h" +#include "SampleFormats.h" #include #include #include #include -#include -#include -#include #include #include diff --git a/Userland/Libraries/LibAudio/QOALoader.cpp b/Userland/Libraries/LibMedia/Audio/QOALoader.cpp similarity index 100% rename from Userland/Libraries/LibAudio/QOALoader.cpp rename to Userland/Libraries/LibMedia/Audio/QOALoader.cpp diff --git a/Userland/Libraries/LibAudio/QOALoader.h b/Userland/Libraries/LibMedia/Audio/QOALoader.h similarity index 96% rename from Userland/Libraries/LibAudio/QOALoader.h rename to Userland/Libraries/LibMedia/Audio/QOALoader.h index 753ffe29e50..772ba9c5922 100644 --- a/Userland/Libraries/LibAudio/QOALoader.h +++ b/Userland/Libraries/LibMedia/Audio/QOALoader.h @@ -6,13 +6,13 @@ #pragma once +#include "Loader.h" +#include "QOATypes.h" +#include "SampleFormats.h" #include #include #include #include -#include -#include -#include namespace Audio { diff --git a/Userland/Libraries/LibAudio/QOATypes.cpp b/Userland/Libraries/LibMedia/Audio/QOATypes.cpp similarity index 100% rename from Userland/Libraries/LibAudio/QOATypes.cpp rename to Userland/Libraries/LibMedia/Audio/QOATypes.cpp diff --git a/Userland/Libraries/LibAudio/QOATypes.h b/Userland/Libraries/LibMedia/Audio/QOATypes.h similarity index 100% rename from Userland/Libraries/LibAudio/QOATypes.h rename to Userland/Libraries/LibMedia/Audio/QOATypes.h diff --git a/Userland/Libraries/LibAudio/Queue.h b/Userland/Libraries/LibMedia/Audio/Queue.h similarity index 95% rename from Userland/Libraries/LibAudio/Queue.h rename to Userland/Libraries/LibMedia/Audio/Queue.h index fd103819b32..6b8f2793d63 100644 --- a/Userland/Libraries/LibAudio/Queue.h +++ b/Userland/Libraries/LibMedia/Audio/Queue.h @@ -6,7 +6,7 @@ #pragma once -#include +#include "Sample.h" #include namespace Audio { diff --git a/Userland/Libraries/LibAudio/Resampler.h b/Userland/Libraries/LibMedia/Audio/Resampler.h similarity index 100% rename from Userland/Libraries/LibAudio/Resampler.h rename to Userland/Libraries/LibMedia/Audio/Resampler.h diff --git a/Userland/Libraries/LibAudio/Sample.h b/Userland/Libraries/LibMedia/Audio/Sample.h similarity index 100% rename from Userland/Libraries/LibAudio/Sample.h rename to Userland/Libraries/LibMedia/Audio/Sample.h diff --git a/Userland/Libraries/LibAudio/SampleFormats.cpp b/Userland/Libraries/LibMedia/Audio/SampleFormats.cpp similarity index 100% rename from Userland/Libraries/LibAudio/SampleFormats.cpp rename to Userland/Libraries/LibMedia/Audio/SampleFormats.cpp diff --git a/Userland/Libraries/LibAudio/SampleFormats.h b/Userland/Libraries/LibMedia/Audio/SampleFormats.h similarity index 100% rename from Userland/Libraries/LibAudio/SampleFormats.h rename to Userland/Libraries/LibMedia/Audio/SampleFormats.h diff --git a/Userland/Libraries/LibAudio/UserSampleQueue.cpp b/Userland/Libraries/LibMedia/Audio/UserSampleQueue.cpp similarity index 100% rename from Userland/Libraries/LibAudio/UserSampleQueue.cpp rename to Userland/Libraries/LibMedia/Audio/UserSampleQueue.cpp diff --git a/Userland/Libraries/LibAudio/UserSampleQueue.h b/Userland/Libraries/LibMedia/Audio/UserSampleQueue.h similarity index 97% rename from Userland/Libraries/LibAudio/UserSampleQueue.h rename to Userland/Libraries/LibMedia/Audio/UserSampleQueue.h index f7c2303775e..9d14222473a 100644 --- a/Userland/Libraries/LibAudio/UserSampleQueue.h +++ b/Userland/Libraries/LibMedia/Audio/UserSampleQueue.h @@ -6,11 +6,11 @@ #pragma once +#include "Sample.h" #include #include #include #include -#include #include namespace Audio { diff --git a/Userland/Libraries/LibAudio/VorbisComment.cpp b/Userland/Libraries/LibMedia/Audio/VorbisComment.cpp similarity index 100% rename from Userland/Libraries/LibAudio/VorbisComment.cpp rename to Userland/Libraries/LibMedia/Audio/VorbisComment.cpp diff --git a/Userland/Libraries/LibAudio/VorbisComment.h b/Userland/Libraries/LibMedia/Audio/VorbisComment.h similarity index 86% rename from Userland/Libraries/LibAudio/VorbisComment.h rename to Userland/Libraries/LibMedia/Audio/VorbisComment.h index e7917c3b99f..d4ac57b63e2 100644 --- a/Userland/Libraries/LibAudio/VorbisComment.h +++ b/Userland/Libraries/LibMedia/Audio/VorbisComment.h @@ -6,9 +6,9 @@ #pragma once +#include "LoaderError.h" +#include "Metadata.h" #include -#include -#include namespace Audio { diff --git a/Userland/Libraries/LibAudio/WavLoader.cpp b/Userland/Libraries/LibMedia/Audio/WavLoader.cpp similarity index 100% rename from Userland/Libraries/LibAudio/WavLoader.cpp rename to Userland/Libraries/LibMedia/Audio/WavLoader.cpp diff --git a/Userland/Libraries/LibAudio/WavLoader.h b/Userland/Libraries/LibMedia/Audio/WavLoader.h similarity index 98% rename from Userland/Libraries/LibAudio/WavLoader.h rename to Userland/Libraries/LibMedia/Audio/WavLoader.h index 9e6f6919de8..08e4afcb397 100644 --- a/Userland/Libraries/LibAudio/WavLoader.h +++ b/Userland/Libraries/LibMedia/Audio/WavLoader.h @@ -7,13 +7,13 @@ #pragma once +#include "Loader.h" #include #include #include #include #include #include -#include #include namespace Audio { diff --git a/Userland/Libraries/LibAudio/WavTypes.h b/Userland/Libraries/LibMedia/Audio/WavTypes.h similarity index 100% rename from Userland/Libraries/LibAudio/WavTypes.h rename to Userland/Libraries/LibMedia/Audio/WavTypes.h diff --git a/Userland/Libraries/LibAudio/WavWriter.cpp b/Userland/Libraries/LibMedia/Audio/WavWriter.cpp similarity index 97% rename from Userland/Libraries/LibAudio/WavWriter.cpp rename to Userland/Libraries/LibMedia/Audio/WavWriter.cpp index d49545bb340..3c8ab5bc4a5 100644 --- a/Userland/Libraries/LibAudio/WavWriter.cpp +++ b/Userland/Libraries/LibMedia/Audio/WavWriter.cpp @@ -5,10 +5,10 @@ * SPDX-License-Identifier: BSD-2-Clause */ +#include "WavLoader.h" +#include "WavTypes.h" +#include "WavWriter.h" #include -#include -#include -#include namespace Audio { diff --git a/Userland/Libraries/LibAudio/WavWriter.h b/Userland/Libraries/LibMedia/Audio/WavWriter.h similarity index 92% rename from Userland/Libraries/LibAudio/WavWriter.h rename to Userland/Libraries/LibMedia/Audio/WavWriter.h index ca778ab68ad..5ba0bcd2e3f 100644 --- a/Userland/Libraries/LibAudio/WavWriter.h +++ b/Userland/Libraries/LibMedia/Audio/WavWriter.h @@ -6,13 +6,13 @@ #pragma once +#include "Encoder.h" +#include "Sample.h" +#include "SampleFormats.h" #include #include #include #include -#include -#include -#include #include #include diff --git a/Userland/Libraries/LibMedia/CMakeLists.txt b/Userland/Libraries/LibMedia/CMakeLists.txt index 26d8f4263a0..ee79124ab2c 100644 --- a/Userland/Libraries/LibMedia/CMakeLists.txt +++ b/Userland/Libraries/LibMedia/CMakeLists.txt @@ -1,4 +1,18 @@ set(SOURCES + Audio/GenericTypes.cpp + Audio/SampleFormats.cpp + Audio/Loader.cpp + Audio/WavLoader.cpp + Audio/FlacLoader.cpp + Audio/FlacWriter.cpp + Audio/WavWriter.cpp + Audio/Metadata.cpp + Audio/MP3Loader.cpp + Audio/PlaybackStream.cpp + Audio/QOALoader.cpp + Audio/QOATypes.cpp + Audio/UserSampleQueue.cpp + Audio/VorbisComment.cpp Color/ColorConverter.cpp Color/ColorPrimaries.cpp Color/TransferCharacteristics.cpp @@ -8,6 +22,13 @@ set(SOURCES VideoFrame.cpp ) +if (HAVE_PULSEAUDIO) + list(APPEND SOURCES + Audio/PlaybackStreamPulseAudio.cpp + Audio/PulseAudioWrappers.cpp + ) +endif() + if (NOT ANDROID) list(APPEND SOURCES FFmpeg/FFmpegVideoDecoder.cpp) else() @@ -15,7 +36,7 @@ else() endif() serenity_lib(LibMedia media) -target_link_libraries(LibMedia PRIVATE LibCore LibIPC LibGfx LibThreading) +target_link_libraries(LibMedia PRIVATE LibCore LibCrypto LibRIFF LibIPC LibGfx LibThreading LibUnicode) if (NOT ANDROID) # Third-party @@ -23,3 +44,21 @@ if (NOT ANDROID) pkg_check_modules(AVCODEC REQUIRED IMPORTED_TARGET libavcodec) target_link_libraries(LibMedia PRIVATE PkgConfig::AVCODEC) endif() + +if (HAVE_PULSEAUDIO) + target_link_libraries(LibMedia PRIVATE pulse) + target_compile_definitions(LibMedia PRIVATE HAVE_PULSEAUDIO=1) +endif() + +if (APPLE AND NOT IOS) + target_sources(LibMedia PRIVATE Audio/PlaybackStreamAudioUnit.cpp) + + find_library(AUDIO_UNIT AudioUnit REQUIRED) + target_link_libraries(LibMedia PRIVATE ${AUDIO_UNIT}) +endif() + +if (ANDROID) + target_sources(LibMedia PRIVATE Audio/PlaybackStreamOboe.cpp) + find_package(oboe REQUIRED CONFIG) + target_link_libraries(LibMedia PRIVATE log oboe::oboe) +endif() diff --git a/Userland/Libraries/LibWeb/CMakeLists.txt b/Userland/Libraries/LibWeb/CMakeLists.txt index 883138bba27..f08e762687f 100644 --- a/Userland/Libraries/LibWeb/CMakeLists.txt +++ b/Userland/Libraries/LibWeb/CMakeLists.txt @@ -794,7 +794,7 @@ set(GENERATED_SOURCES serenity_lib(LibWeb web) -target_link_libraries(LibWeb PRIVATE LibCore LibCrypto LibJS LibHTTP LibGfx LibIPC LibRegex LibSyntax LibTextCodec LibUnicode LibAudio LibMedia LibWasm LibXML LibIDL LibURL LibTLS LibRequests skia) +target_link_libraries(LibWeb PRIVATE LibCore LibCrypto LibJS LibHTTP LibGfx LibIPC LibRegex LibSyntax LibTextCodec LibUnicode LibMedia LibWasm LibXML LibIDL LibURL LibTLS LibRequests skia) generate_js_bindings(LibWeb) diff --git a/Userland/Libraries/LibWeb/HTML/AudioTrack.cpp b/Userland/Libraries/LibWeb/HTML/AudioTrack.cpp index 72dd57d543f..a6bd4bbb3cd 100644 --- a/Userland/Libraries/LibWeb/HTML/AudioTrack.cpp +++ b/Userland/Libraries/LibWeb/HTML/AudioTrack.cpp @@ -5,9 +5,9 @@ */ #include -#include #include #include +#include #include #include #include diff --git a/Userland/Libraries/LibWeb/HTML/AudioTrack.h b/Userland/Libraries/LibWeb/HTML/AudioTrack.h index 76f6f1c3af7..a98eb1a2423 100644 --- a/Userland/Libraries/LibWeb/HTML/AudioTrack.h +++ b/Userland/Libraries/LibWeb/HTML/AudioTrack.h @@ -8,7 +8,7 @@ #include #include -#include +#include #include namespace Web::HTML { diff --git a/Userland/Libraries/LibWeb/HTML/HTMLMediaElement.cpp b/Userland/Libraries/LibWeb/HTML/HTMLMediaElement.cpp index bc8f4f3971a..f0352d8645e 100644 --- a/Userland/Libraries/LibWeb/HTML/HTMLMediaElement.cpp +++ b/Userland/Libraries/LibWeb/HTML/HTMLMediaElement.cpp @@ -5,8 +5,8 @@ * SPDX-License-Identifier: BSD-2-Clause */ -#include #include +#include #include #include #include diff --git a/Userland/Libraries/LibWeb/Platform/AudioCodecPlugin.cpp b/Userland/Libraries/LibWeb/Platform/AudioCodecPlugin.cpp index e27672cd6f3..9e300a87672 100644 --- a/Userland/Libraries/LibWeb/Platform/AudioCodecPlugin.cpp +++ b/Userland/Libraries/LibWeb/Platform/AudioCodecPlugin.cpp @@ -4,9 +4,9 @@ * SPDX-License-Identifier: BSD-2-Clause */ -#include -#include -#include +#include +#include +#include #include namespace Web::Platform { diff --git a/Userland/Libraries/LibWeb/Platform/AudioCodecPlugin.h b/Userland/Libraries/LibWeb/Platform/AudioCodecPlugin.h index 6b53f401b39..23f44942bb2 100644 --- a/Userland/Libraries/LibWeb/Platform/AudioCodecPlugin.h +++ b/Userland/Libraries/LibWeb/Platform/AudioCodecPlugin.h @@ -10,7 +10,7 @@ #include #include #include -#include +#include namespace Web::Platform { diff --git a/Userland/Libraries/LibWeb/Platform/AudioCodecPluginAgnostic.cpp b/Userland/Libraries/LibWeb/Platform/AudioCodecPluginAgnostic.cpp index aa4a4b01923..dc06e831837 100644 --- a/Userland/Libraries/LibWeb/Platform/AudioCodecPluginAgnostic.cpp +++ b/Userland/Libraries/LibWeb/Platform/AudioCodecPluginAgnostic.cpp @@ -6,10 +6,10 @@ #include #include -#include #include #include #include +#include #include "AudioCodecPluginAgnostic.h" diff --git a/Userland/Libraries/LibWeb/Platform/AudioCodecPluginAgnostic.h b/Userland/Libraries/LibWeb/Platform/AudioCodecPluginAgnostic.h index eda9b51977e..5b596c254b3 100644 --- a/Userland/Libraries/LibWeb/Platform/AudioCodecPluginAgnostic.h +++ b/Userland/Libraries/LibWeb/Platform/AudioCodecPluginAgnostic.h @@ -6,7 +6,7 @@ #pragma once -#include +#include #include namespace Web::Platform { diff --git a/Userland/Services/WebContent/CMakeLists.txt b/Userland/Services/WebContent/CMakeLists.txt index 529e0d4cb30..87b603f688d 100644 --- a/Userland/Services/WebContent/CMakeLists.txt +++ b/Userland/Services/WebContent/CMakeLists.txt @@ -23,4 +23,4 @@ set(GENERATED_SOURCES ) serenity_bin(WebContent) -target_link_libraries(WebContent PRIVATE LibCore LibFileSystem LibIPC LibGfx LibAudio LibImageDecoderClient LibJS LibWebView LibWeb LibUnicode LibMain LibURL) +target_link_libraries(WebContent PRIVATE LibCore LibFileSystem LibIPC LibGfx LibImageDecoderClient LibJS LibWebView LibWeb LibUnicode LibMain LibMedia LibURL) diff --git a/Userland/Services/WebContent/main.cpp b/Userland/Services/WebContent/main.cpp index 4e49e8c064e..e079499003e 100644 --- a/Userland/Services/WebContent/main.cpp +++ b/Userland/Services/WebContent/main.cpp @@ -5,7 +5,6 @@ */ #include "ImageCodecPluginSerenity.h" -#include #include #include #include @@ -13,6 +12,7 @@ #include #include #include +#include #include #include #include diff --git a/Userland/Utilities/abench.cpp b/Userland/Utilities/abench.cpp index 52ba06d77cc..10798827fa6 100644 --- a/Userland/Utilities/abench.cpp +++ b/Userland/Utilities/abench.cpp @@ -6,12 +6,12 @@ #include #include -#include #include #include #include #include #include +#include #include // The Kernel has problems with large anonymous buffers, so let's limit sample reads ourselves. diff --git a/Userland/Utilities/aconv.cpp b/Userland/Utilities/aconv.cpp index 000e193cb4b..b1ffb2cad7d 100644 --- a/Userland/Utilities/aconv.cpp +++ b/Userland/Utilities/aconv.cpp @@ -6,14 +6,14 @@ #include #include -#include -#include -#include -#include #include #include #include #include +#include +#include +#include +#include #include static ErrorOr guess_format_from_extension(StringView path)