mirror of
https://github.com/LadybirdBrowser/ladybird
synced 2026-04-30 19:47:17 +02:00
This time provider can later be swapped out for the AudioMixingSink when it implements the MediaTimeProvider interface, so that frame timing can be driven by audio when it is present.
25 lines
491 B
C++
25 lines
491 B
C++
/*
|
|
* Copyright (c) 2025, Gregory Bertilson <gregory@ladybird.org>
|
|
*
|
|
* SPDX-License-Identifier: BSD-2-Clause
|
|
*/
|
|
|
|
#pragma once
|
|
|
|
#include <AK/AtomicRefCounted.h>
|
|
#include <AK/Time.h>
|
|
|
|
namespace Media {
|
|
|
|
class MediaTimeProvider : public AtomicRefCounted<MediaTimeProvider> {
|
|
public:
|
|
virtual ~MediaTimeProvider() = default;
|
|
|
|
virtual AK::Duration current_time() const = 0;
|
|
virtual void resume() = 0;
|
|
virtual void pause() = 0;
|
|
virtual void set_time(AK::Duration) = 0;
|
|
};
|
|
|
|
}
|