aboutsummaryrefslogtreecommitdiff
path: root/Src/bmp/avi_decoder.cpp
diff options
context:
space:
mode:
authorJef <jef@targetspot.com>2024-09-24 08:54:57 -0400
committerJef <jef@targetspot.com>2024-09-24 08:54:57 -0400
commit20d28e80a5c861a9d5f449ea911ab75b4f37ad0d (patch)
tree12f17f78986871dd2cfb0a56e5e93b545c1ae0d0 /Src/bmp/avi_decoder.cpp
parent537bcbc86291b32fc04ae4133ce4d7cac8ebe9a7 (diff)
downloadwinamp-20d28e80a5c861a9d5f449ea911ab75b4f37ad0d.tar.gz
Initial community commit
Diffstat (limited to 'Src/bmp/avi_decoder.cpp')
-rw-r--r--Src/bmp/avi_decoder.cpp54
1 files changed, 54 insertions, 0 deletions
diff --git a/Src/bmp/avi_decoder.cpp b/Src/bmp/avi_decoder.cpp
new file mode 100644
index 00000000..b133d8fd
--- /dev/null
+++ b/Src/bmp/avi_decoder.cpp
@@ -0,0 +1,54 @@
+#include "avi_decoder.h"
+#include "avi_tscc_decoder.h"
+#include "avi_rle_decoder.h"
+#include "avi_yuv_decoder.h"
+#include "avi_rgb_decoder.h"
+
+int AVIDecoderCreator::CreateVideoDecoder(const nsavi::AVIH *avi_header, const nsavi::STRH *stream_header, const nsavi::STRF *stream_format, const nsavi::STRD *stream_data, ifc_avivideodecoder **decoder)
+{
+ nsavi::video_format *format = (nsavi::video_format *)stream_format;
+ if (format)
+ {
+ if (format->compression == 'ccst') // tscc
+ {
+ *decoder = AVITSCC::CreateDecoder(format);
+ if (*decoder)
+ return CREATEDECODER_SUCCESS;
+ else
+ return CREATEDECODER_FAILURE;
+ }
+ else if (format->compression == nsavi::video_format_rle8) // 8bit RLE
+ {
+ *decoder = AVIRLE::CreateDecoder(format);
+ if (*decoder)
+ return CREATEDECODER_SUCCESS;
+ else
+ return CREATEDECODER_FAILURE;
+ }
+ else if (format->compression == 'YVYU') // YUV
+ {
+ *decoder = AVIYUV::CreateDecoder(format);
+ if (*decoder)
+ return CREATEDECODER_SUCCESS;
+ else
+ return CREATEDECODER_FAILURE;
+ }
+ else if (format->compression == nsavi::video_format_rgb)
+ {
+ *decoder = AVIRGB::CreateDecoder(format);
+ if (*decoder)
+ return CREATEDECODER_SUCCESS;
+ else
+ return CREATEDECODER_FAILURE;
+ }
+ }
+
+ return CREATEDECODER_NOT_MINE;
+}
+
+
+#define CBCLASS AVIDecoderCreator
+START_DISPATCH;
+CB(CREATE_VIDEO_DECODER, CreateVideoDecoder)
+END_DISPATCH;
+#undef CBCLASS