aboutsummaryrefslogtreecommitdiff
path: root/Src/aacdec/NSVAACDecoder.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/aacdec/NSVAACDecoder.h
parent4bde6044fddf053f31795b9eaccdd2a5a527d21f (diff)
parent20d28e80a5c861a9d5f449ea911ab75b4f37ad0d (diff)
downloadwinamp-bab614c421ed7ae329d26bf028c4a3b1d2450f5a.tar.gz
Merge pull request #5 from WinampDesktop/community
Merge to main
Diffstat (limited to 'Src/aacdec/NSVAACDecoder.h')
-rw-r--r--Src/aacdec/NSVAACDecoder.h52
1 files changed, 52 insertions, 0 deletions
diff --git a/Src/aacdec/NSVAACDecoder.h b/Src/aacdec/NSVAACDecoder.h
new file mode 100644
index 00000000..56b7bf25
--- /dev/null
+++ b/Src/aacdec/NSVAACDecoder.h
@@ -0,0 +1,52 @@
+#pragma once
+#include "../nsv/dec_if.h"
+#include "incs/mp4AudioDecIfc.h"
+#include <bfc/platform/types.h>
+#include "ADTSHeader.h"
+#include "../nsv/svc_nsvFactory.h"
+
+// {55632E28-8171-4670-AE5D-CF714900C62E}
+static const GUID NSV_AAC_GUID =
+{ 0x55632e28, 0x8171, 0x4670, { 0xae, 0x5d, 0xcf, 0x71, 0x49, 0x0, 0xc6, 0x2e } };
+
+class NSVDecoder : public svc_nsvFactory
+{
+public:
+ static const char *getServiceName() { return "AAC NSV Decoder"; }
+ static GUID getServiceGuid() { return NSV_AAC_GUID; }
+ IAudioDecoder *CreateAudioDecoder(FOURCC format, IAudioOutput **output);
+
+protected:
+ RECVS_DISPATCH;
+};
+
+class NSVAACDecoder : public IAudioDecoder
+{
+public:
+ static NSVAACDecoder *CreateDecoder();
+ NSVAACDecoder();
+ ~NSVAACDecoder();
+ void Initialize(CAccessUnitPtr access_unit);
+ int decode(void *in, int in_len, void *out, int *out_len, unsigned int out_fmt[8]);
+ void flush();
+ bool OK();
+
+private:
+ void FillOutputFormat(unsigned int out_fmt[8]);
+ void CopyToOutput(void *out, int *out_len);
+
+private:
+ /* data */
+ mp4AudioDecoderHandle decoder;
+ CCompositionUnitPtr composition_unit; /* output */
+ CAccessUnitPtr access_unit; /* input */
+
+ int in_position;
+ int out_left;
+ size_t source_position;
+// unsigned char pcm_buf[65536*2];
+// int pcm_buf_used;
+// int readpos;
+// unsigned int cbvalid;
+};
+