aboutsummaryrefslogtreecommitdiff
path: root/Src/pcm/avi_pcm_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/pcm/avi_pcm_decoder.h
parent4bde6044fddf053f31795b9eaccdd2a5a527d21f (diff)
parent20d28e80a5c861a9d5f449ea911ab75b4f37ad0d (diff)
downloadwinamp-bab614c421ed7ae329d26bf028c4a3b1d2450f5a.tar.gz
Merge pull request #5 from WinampDesktop/community
Merge to main
Diffstat (limited to 'Src/pcm/avi_pcm_decoder.h')
-rw-r--r--Src/pcm/avi_pcm_decoder.h36
1 files changed, 36 insertions, 0 deletions
diff --git a/Src/pcm/avi_pcm_decoder.h b/Src/pcm/avi_pcm_decoder.h
new file mode 100644
index 00000000..3e598f07
--- /dev/null
+++ b/Src/pcm/avi_pcm_decoder.h
@@ -0,0 +1,36 @@
+#pragma once
+#include "../Plugins/Input/in_avi/svc_avidecoder.h"
+#include "../Plugins/Input/in_avi/ifc_aviaudiodecoder.h"
+
+// {739A9D4E-2235-4298-AA4F-2E9F1B5DE8EC}
+static const GUID avi_pcm_guid =
+{ 0x739a9d4e, 0x2235, 0x4298, { 0xaa, 0x4f, 0x2e, 0x9f, 0x1b, 0x5d, 0xe8, 0xec } };
+
+
+class AVIDecoder : public svc_avidecoder
+{
+public:
+ static const char *getServiceName() { return "PCM AVI Decoder"; }
+ static GUID getServiceGuid() { return avi_pcm_guid; }
+ int CreateAudioDecoder(const nsavi::AVIH *avi_header, const nsavi::STRH *stream_header, const nsavi::STRF *stream_format, const nsavi::STRD *stream_data, unsigned int preferred_bits, unsigned int max_channels, bool floating_point, ifc_aviaudiodecoder **decoder);
+protected:
+ RECVS_DISPATCH;
+};
+
+class AVIPCMDecoder : public ifc_aviaudiodecoder
+{
+public:
+ AVIPCMDecoder(const nsavi::audio_format *waveformat);
+
+protected:
+ RECVS_DISPATCH;
+private:
+ /* ifc_aviaudiodecoder implementation */
+ int OutputFrameSize(size_t *frame_size);
+ int GetOutputProperties(unsigned int *sampleRate, unsigned int *channels, unsigned int *bitsPerSample, bool *isFloat);
+ int DecodeChunk(uint16_t type, void **inputBuffer, size_t *inputBufferBytes, void *outputBuffer, size_t *outputBufferBytes);
+ void Close();
+
+private:
+ const nsavi::audio_format *waveformat;
+}; \ No newline at end of file