ladybird/Libraries/LibMedia/Producers/VideoProducer.h
Zaggy1024 adb0754bc8 LibMedia: Signal downstream nodes whether to clear data after seeks
Seeks don't always move a decoded data producer's head, so we need to
make sure not to remove queued data downstream when that is the case.

To communicate this, the producers can now be queried before pulling
data, allowing them to have an in-band signal to clear the queued data
after a seek has moved the producer and broken monotonicity.

This fixes a flake in HTMLVideoElement-resize-event-during-playback.
2026-05-19 15:20:58 -05:00

30 lines
656 B
C++

/*
* Copyright (c) 2026-present, the Ladybird developers.
*
* SPDX-License-Identifier: BSD-2-Clause
*/
#pragma once
#include <AK/Time.h>
#include <LibMedia/Forward.h>
#include <LibMedia/MediaPipelineNode.h>
#include <LibMedia/PipelineStatus.h>
#include <LibMedia/SeekMode.h>
namespace Media {
class VideoProducer : public virtual MediaPipelineNode {
public:
virtual ~VideoProducer() = default;
virtual void start() = 0;
virtual PipelineStatus status() const = 0;
virtual void pull(RefPtr<VideoFrame>& into) = 0;
virtual void set_wake_handler(PipelineWakeHandler) = 0;
virtual void seek(AK::Duration timestamp) = 0;
};
}