From 20d28e80a5c861a9d5f449ea911ab75b4f37ad0d Mon Sep 17 00:00:00 2001 From: Jef Date: Tue, 24 Sep 2024 14:54:57 +0200 Subject: Initial community commit --- Src/f263/lib.cpp | 27 +++++++++++++++++++++++++++ 1 file changed, 27 insertions(+) create mode 100644 Src/f263/lib.cpp (limited to 'Src/f263/lib.cpp') diff --git a/Src/f263/lib.cpp b/Src/f263/lib.cpp new file mode 100644 index 00000000..fc72fab4 --- /dev/null +++ b/Src/f263/lib.cpp @@ -0,0 +1,27 @@ +#include "Decoder.h" +#include "lib.h" + +void *F263_CreateDecoder() +{ + return new Decoder; +} + +int F263_DecodeFrame(void *context, void *frameData, size_t frameSize, YV12_PLANES *yv12, int *width, int *height, int *keyframe) +{ + if (frameSize > 0x1FFFFFFF) + return F263_ERROR_TOO_MUCH_DATA; + + if (!frameData) + return F263_ERROR_NO_DATA; + + Decoder *decoder = (Decoder *)context; + decoder->buffer.data = (uint8_t *)frameData; + decoder->buffer.numBits = (uint32_t)(frameSize*8); + return decoder->DecodeFrame(yv12, width, height, keyframe); +} + +void F263_DestroyDecoder(void *context) +{ + Decoder *decoder = (Decoder *)context; + delete decoder; +} -- cgit