2022-10-29 21:53:24 -03:00
|
|
|
/*
|
|
|
|
|
* Copyright (c) 2022, Gregory Bertilson <zaggy1024@gmail.com>
|
|
|
|
|
*
|
|
|
|
|
* SPDX-License-Identifier: BSD-2-Clause
|
|
|
|
|
*/
|
|
|
|
|
|
|
|
|
|
#pragma once
|
|
|
|
|
|
|
|
|
|
#include <AK/ByteBuffer.h>
|
|
|
|
|
#include <AK/NonnullOwnPtr.h>
|
2026-05-05 06:29:14 -03:00
|
|
|
#include <AK/NonnullRefPtr.h>
|
2024-06-19 20:29:12 -03:00
|
|
|
#include <AK/Time.h>
|
2026-01-20 23:10:33 -03:00
|
|
|
#include <LibMedia/Color/CodingIndependentCodePoints.h>
|
2022-10-29 21:53:24 -03:00
|
|
|
|
|
|
|
|
#include "DecoderError.h"
|
|
|
|
|
|
2024-06-10 17:04:03 -03:00
|
|
|
namespace Media {
|
2022-10-29 21:53:24 -03:00
|
|
|
|
|
|
|
|
class VideoDecoder {
|
|
|
|
|
public:
|
2024-12-27 20:47:33 -03:00
|
|
|
virtual ~VideoDecoder() { }
|
2022-10-29 21:53:24 -03:00
|
|
|
|
2025-11-26 20:29:28 -03:00
|
|
|
virtual DecoderErrorOr<void> receive_coded_data(AK::Duration timestamp, AK::Duration duration, ReadonlyBytes coded_data) = 0;
|
|
|
|
|
DecoderErrorOr<void> receive_coded_data(AK::Duration timestamp, AK::Duration duration, ByteBuffer const& coded_data) { return receive_coded_data(timestamp, duration, coded_data.span()); }
|
2025-11-03 21:37:54 -03:00
|
|
|
virtual void signal_end_of_stream() = 0;
|
2026-05-05 06:29:14 -03:00
|
|
|
virtual DecoderErrorOr<NonnullRefPtr<VideoFrame>> get_decoded_frame(CodingIndependentCodePoints const& container_cicp) = 0;
|
2024-06-20 00:36:27 -03:00
|
|
|
|
2024-06-20 00:26:23 -03:00
|
|
|
virtual void flush() = 0;
|
2022-10-29 21:53:24 -03:00
|
|
|
};
|
|
|
|
|
|
|
|
|
|
}
|