mirror of
https://github.com/LadybirdBrowser/ladybird
synced 2026-04-28 02:27:19 +02:00
This is used by FFmpeg's H.264 decoder to determine when to output any buffered frames after data runs out.
30 lines
743 B
C++
30 lines
743 B
C++
/*
|
|
* Copyright (c) 2022, Gregory Bertilson <zaggy1024@gmail.com>
|
|
*
|
|
* SPDX-License-Identifier: BSD-2-Clause
|
|
*/
|
|
|
|
#pragma once
|
|
|
|
#include <AK/ByteBuffer.h>
|
|
#include <AK/NonnullOwnPtr.h>
|
|
#include <AK/Time.h>
|
|
|
|
#include "DecoderError.h"
|
|
|
|
namespace Media {
|
|
|
|
class VideoDecoder {
|
|
public:
|
|
virtual ~VideoDecoder() { }
|
|
|
|
virtual DecoderErrorOr<void> receive_coded_data(AK::Duration timestamp, ReadonlyBytes coded_data) = 0;
|
|
DecoderErrorOr<void> receive_coded_data(AK::Duration timestamp, ByteBuffer const& coded_data) { return receive_coded_data(timestamp, coded_data.span()); }
|
|
virtual void signal_end_of_stream() = 0;
|
|
virtual DecoderErrorOr<NonnullOwnPtr<VideoFrame>> get_decoded_frame() = 0;
|
|
|
|
virtual void flush() = 0;
|
|
};
|
|
|
|
}
|