/* * Copyright (c) 2023, Tim Flynn * * SPDX-License-Identifier: BSD-2-Clause */ #pragma once #include #include #include #include class QAudioSink; class QIODevice; class QMediaDevices; namespace Ladybird { class AudioCodecPluginLadybird final : public Web::Platform::AudioCodecPlugin { public: static ErrorOr> create(); virtual ~AudioCodecPluginLadybird() override; virtual size_t device_sample_rate() override; virtual void enqueue_samples(FixedArray) override; virtual size_t remaining_samples() const override; virtual void resume_playback() override; virtual void pause_playback() override; virtual void playback_ended() override; private: AudioCodecPluginLadybird(NonnullOwnPtr, NonnullOwnPtr); NonnullOwnPtr m_devices; NonnullOwnPtr m_audio_output; QIODevice* m_io_device { nullptr }; }; }