2022-10-29 19:53:24 -05: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>
|
2024-06-19 18:29:12 -05:00
|
|
|
#include <AK/Time.h>
|
2022-10-29 19:53:24 -05:00
|
|
|
|
|
|
|
|
#include "DecoderError.h"
|
|
|
|
|
|
2024-06-10 15:04:03 -05:00
|
|
|
namespace Media {
|
2022-10-29 19:53:24 -05:00
|
|
|
|
|
|
|
|
class VideoDecoder {
|
|
|
|
|
public:
|
2024-12-27 18:47:33 -05:00
|
|
|
virtual ~VideoDecoder() { }
|
2022-10-29 19:53:24 -05:00
|
|
|
|
2025-09-18 19:33:00 -05:00
|
|
|
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()); }
|
2022-10-29 19:53:24 -05:00
|
|
|
virtual DecoderErrorOr<NonnullOwnPtr<VideoFrame>> get_decoded_frame() = 0;
|
2024-06-19 22:36:27 -05:00
|
|
|
|
2024-06-19 22:26:23 -05:00
|
|
|
virtual void flush() = 0;
|
2022-10-29 19:53:24 -05:00
|
|
|
};
|
|
|
|
|
|
|
|
|
|
}
|