1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-05-30 22:48:11 +00:00
serenity/Userland/Libraries/LibVideo/VideoDecoder.h
Zaggy1024 2b4b6c5613 LibVideo: Make VP9::Decoder a subclass of a new abstract VideoDecoder
This will allow other decoders to be used in place of VP9::Decoder when
new video decoders are implemented, such as AV1.
2022-10-31 14:47:13 +01:00

26 lines
588 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 "DecoderError.h"
#include "VideoFrame.h"
namespace Video {
class VideoDecoder {
public:
virtual ~VideoDecoder() {};
virtual DecoderErrorOr<void> receive_sample(Span<u8 const> sample) = 0;
DecoderErrorOr<void> receive_sample(ByteBuffer const& sample) { return receive_sample(sample.span()); }
virtual DecoderErrorOr<NonnullOwnPtr<VideoFrame>> get_decoded_frame() = 0;
};
}