mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-09-03 16:16:43 +00:00
LibAudio: Allow the MP3 plugin to be constructed from a byte buffer
This commit is contained in:
parent
bb17ee8397
commit
754b129f4a
Notes:
sideshowbarker
2024-07-17 05:47:17 +09:00
Author: https://github.com/LucasChollet
Commit: 754b129f4a
Pull-request: https://github.com/SerenityOS/serenity/pull/15568
Reviewed-by: https://github.com/linusg ✅
Reviewed-by: https://github.com/sin-ack ✅
3 changed files with 14 additions and 2 deletions
|
@ -11,6 +11,7 @@
|
|||
#include <AK/MemoryStream.h>
|
||||
#include <AK/Tuple.h>
|
||||
#include <LibCore/InputBitStream.h>
|
||||
#include <LibCore/MemoryStream.h>
|
||||
#include <LibCore/Stream.h>
|
||||
#include <LibDSP/MDCT.h>
|
||||
|
||||
|
@ -23,6 +24,7 @@ struct ScaleFactorBand;
|
|||
class MP3LoaderPlugin : public LoaderPlugin {
|
||||
public:
|
||||
explicit MP3LoaderPlugin(StringView path);
|
||||
explicit MP3LoaderPlugin(Bytes buffer);
|
||||
virtual ~MP3LoaderPlugin() = default;
|
||||
|
||||
virtual MaybeLoaderError initialize() override;
|
||||
|
@ -72,6 +74,7 @@ private:
|
|||
u32 m_current_frame_read;
|
||||
StringView m_path;
|
||||
OwnPtr<Core::Stream::SeekableStream> m_stream;
|
||||
Optional<Bytes const&> m_backing_memory;
|
||||
OwnPtr<Core::Stream::BigEndianInputBitStream> m_bitstream;
|
||||
DuplexMemoryStream m_bit_reservoir;
|
||||
};
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue