ladybird/Tests
kleines Filmröllchen 264cc76ab4 LibAudio: Move audio stream buffering into the loader
Before, some loader plugins implemented their own buffering (FLAC&MP3),
some didn't require any (WAV), and some didn't buffer at all (QOA). This
meant that in practice, while you could load arbitrary amounts of
samples from some loader plugins, you couldn't do that with some others.
Also, it was ill-defined how many samples you would actually get back
from a get_more_samples call.

This commit fixes that by introducing a layer of abstraction between the
loader and its plugins (because that's the whole point of having the
extra class!). The plugins now only implement a load_chunks() function,
which is much simpler to implement and allows plugins to play fast and
loose with what they actually return. Basically, they can return many
chunks of samples, where one chunk is simply a convenient block of
samples to load. In fact, some loaders such as FLAC and QOA have
separate internal functions for loading exactly one chunk. The loaders
*should* load as many chunks as necessary for the sample count to be
reached or surpassed (the latter simplifies loading loops in the
implementations, since you don't need to know how large your next chunk
is going to be; a problem for e.g. FLAC). If a plugin has no problems
returning data of arbitrary size (currently WAV), it can return a single
chunk that exactly (or roughly) matches the requested sample count. If a
plugin is at the stream end, it can also return less samples than was
requested! The loader can handle all of these cases and may call into
load_chunk multiple times. If the plugin returns an empty chunk list (or
only empty chunks; again, they can play fast and loose), the loader
takes that as a stream end signal. Otherwise, the loader will always
return exactly as many samples as the user requested. Buffering is
handled by the loader, allowing any underlying plugin to deal with any
weird sample count requirement the user throws at it (looking at you,
SoundPlayer!).

This (not accidentally!) makes QOA work in SoundPlayer.
2023-03-13 13:25:42 +01:00
..
AK AK+LibUnicode: Implement String::equals_ignoring_case without allocating 2023-03-08 18:57:53 +00:00
Kernel LibCore+Everywhere: Remove ArgsParser::add*(char const*&) 2023-03-01 10:47:19 +01:00
LibAudio LibAudio: Move audio stream buffering into the loader 2023-03-13 13:25:42 +01:00
LibC LibCore: Rename File to DeprecatedFile 2023-02-13 00:50:07 +00:00
LibCompress LibCore: Remove Stream.h 2023-02-13 00:50:07 +00:00
LibCore Userland+AK: Stop using getopt() for ArgsParser 2023-02-28 15:52:24 +03:30
LibCpp Tests: Migrate to Directory::for_each_entry() 2023-03-05 20:23:42 +01:00
LibCrypto LibCrypto: Define *BigInteger::to_base to convert big integers to String 2023-01-15 01:00:20 +00:00
LibEDID AK: Make FixedPoint(FloatingPoint) ctor round instead of truncating 2023-03-03 09:23:02 +00:00
LibELF LibCore: Rename File to DeprecatedFile 2023-02-13 00:50:07 +00:00
LibGfx Tests: Add a test for JPEGs with RGB components 2023-03-10 22:22:36 +01:00
LibGL LibGfx: Make QOIWriter use ErrorOr 2023-03-12 13:23:34 +00:00
LibIMAP LibIMAP: Propagate OOM errors from decode_quoted_printable() 2023-03-09 14:47:45 +00:00
LibJS LibCore+Everywhere: Remove ArgsParser::add*(char const*&) 2023-03-01 10:47:19 +01:00
LibLocale LibJS+LibLocale: Port Intl.DateTimeFormat to String 2023-01-27 18:00:17 +00:00
LibMarkdown LibCore: Remove Stream.h 2023-02-13 00:50:07 +00:00
LibPDF Tests: Move test PDF files into Tests/LibPDF 2023-01-19 11:50:10 +00:00
LibRegex LibRegex: Bail out of atomic rewrite if a block doesn't contain compares 2023-02-15 10:14:26 +01:00
LibSQL Everywhere: Stop using NonnullRefPtrVector 2023-03-06 23:46:35 +01:00
LibTest LibTest: Add EXPECT_NO_CRASH 2021-12-19 14:22:06 -08:00
LibTextCodec LibTextCodec+Everywhere: Port Decoders to new Strings 2023-02-19 17:15:47 +01:00
LibThreading Tests: Update thread tests and make them pass 2022-12-11 19:07:20 -07:00
LibTimeZone Tests: Add missing library dependency for LibTimeZone tests 2023-01-19 11:50:10 +00:00
LibTLS LibCore: Rename File to DeprecatedFile 2023-02-13 00:50:07 +00:00
LibTTF Tests: Correct serenity_test() invocation for LibTTF 2023-01-19 11:50:10 +00:00
LibUnicode LibUnicode: Detect ZWJ sequences when filtering by emoji presentation 2023-03-05 20:21:57 +01:00
LibVideo Tests/LibVideo: Test to ensure that VP9 reference vector clamping works 2023-02-08 18:56:42 +00:00
LibWasm Tests: Implement multi-value returns in test-wasm 2023-02-26 10:54:23 +03:30
LibWeb LibWeb: Resolve percentage line-height values before CSS inheritance 2023-03-12 18:10:32 +01:00
LibXML Everywhere: Add sv suffix to strings relying on StringView(char const*) 2022-07-12 23:11:35 +02:00
Spreadsheet Everywhere: Rename to_{string => deprecated_string}() where applicable 2022-12-06 08:54:33 +01:00
UserspaceEmulator Everywhere: Remove unused includes of LibC/stdlib.h 2023-01-02 20:27:20 -05:00
CMakeLists.txt Tests: Remove i686 support 2022-12-28 11:53:41 +01:00