1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-28 16:17:47 +00:00

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.
This commit is contained in:
Zaggy1024 2022-10-29 19:53:24 -05:00 committed by Andreas Kling
parent 3720f66bb1
commit 2b4b6c5613
4 changed files with 34 additions and 12 deletions

View file

@ -42,11 +42,6 @@ DecoderErrorOr<void> Decoder::receive_sample(Span<u8 const> chunk_data)
return {};
}
DecoderErrorOr<void> Decoder::receive_sample(ByteBuffer const& chunk_data)
{
return receive_sample(chunk_data.span());
}
void Decoder::dump_frame_info()
{
m_parser->dump_info();

View file

@ -13,23 +13,24 @@
#include <AK/Span.h>
#include <LibVideo/Color/CodingIndependentCodePoints.h>
#include <LibVideo/DecoderError.h>
#include <LibVideo/VideoDecoder.h>
#include <LibVideo/VideoFrame.h>
#include "Parser.h"
namespace Video::VP9 {
class Decoder {
class Decoder : public VideoDecoder {
friend class Parser;
public:
Decoder();
~Decoder() override { }
/* (8.1) General */
DecoderErrorOr<void> receive_sample(Span<u8 const>);
DecoderErrorOr<void> receive_sample(ByteBuffer const&);
DecoderErrorOr<void> receive_sample(Span<u8 const>) override;
void dump_frame_info();
DecoderErrorOr<NonnullOwnPtr<VideoFrame>> get_decoded_frame();
DecoderErrorOr<NonnullOwnPtr<VideoFrame>> get_decoded_frame() override;
private:
typedef i32 Intermediate;