aboutsummaryrefslogtreecommitdiff
path: root/Src/jpeg/mp4_jpeg_decoder.h
diff options
context:
space:
mode:
authorJean-Francois Mauguit <jfmauguit@mac.com>2024-09-24 09:03:25 -0400
committerGitHub <noreply@github.com>2024-09-24 09:03:25 -0400
commitbab614c421ed7ae329d26bf028c4a3b1d2450f5a (patch)
tree12f17f78986871dd2cfb0a56e5e93b545c1ae0d0 /Src/jpeg/mp4_jpeg_decoder.h
parent4bde6044fddf053f31795b9eaccdd2a5a527d21f (diff)
parent20d28e80a5c861a9d5f449ea911ab75b4f37ad0d (diff)
downloadwinamp-bab614c421ed7ae329d26bf028c4a3b1d2450f5a.tar.gz
Merge pull request #5 from WinampDesktop/community
Merge to main
Diffstat (limited to 'Src/jpeg/mp4_jpeg_decoder.h')
-rw-r--r--Src/jpeg/mp4_jpeg_decoder.h29
1 files changed, 29 insertions, 0 deletions
diff --git a/Src/jpeg/mp4_jpeg_decoder.h b/Src/jpeg/mp4_jpeg_decoder.h
new file mode 100644
index 00000000..dcb70fc1
--- /dev/null
+++ b/Src/jpeg/mp4_jpeg_decoder.h
@@ -0,0 +1,29 @@
+#include "../Plugins/Input/in_mp4/mpeg4video.h"
+#include "loader_jpg.h"
+
+// {CFF4B746-8D98-48c1-BDDF-9AA750F51517}
+static const GUID mp4_jpeg_guid =
+{ 0xcff4b746, 0x8d98, 0x48c1, { 0xbd, 0xdf, 0x9a, 0xa7, 0x50, 0xf5, 0x15, 0x17 } };
+
+
+class MP4JPEGDecoder : public MP4VideoDecoder
+{
+public:
+ static const char *getServiceName() { return "JPEG MP4 Decoder"; }
+ static GUID getServiceGuid() { return mp4_jpeg_guid; }
+ MP4JPEGDecoder();
+ int Open(MP4FileHandle mp4_file, MP4TrackId mp4_track);
+ int GetOutputFormat(int *x, int *y, int *color_format, double *aspect_ratio);
+ int DecodeSample(const void *inputBuffer, size_t inputBufferBytes, MP4Timestamp timestamp);
+ void Close();
+ int CanHandleCodec(const char *codecName);
+ int GetPicture(void **data, void **decoder_data, MP4Timestamp *timestamp);
+ void FreePicture(void *data, void *decoder_data);
+protected:
+ RECVS_DISPATCH;
+private:
+ JpgLoad *jpegLoader; // new during Open(), since we might have been created just for CanHandleCodec
+ int width, height;
+ void *decoded_image; // ARGB32
+
+}; \ No newline at end of file