diff options
author | Jef <jef@targetspot.com> | 2024-09-24 08:54:57 -0400 |
---|---|---|
committer | Jef <jef@targetspot.com> | 2024-09-24 08:54:57 -0400 |
commit | 20d28e80a5c861a9d5f449ea911ab75b4f37ad0d (patch) | |
tree | 12f17f78986871dd2cfb0a56e5e93b545c1ae0d0 /Src/aacdec-mft/MKVAACDecoder.h | |
parent | 537bcbc86291b32fc04ae4133ce4d7cac8ebe9a7 (diff) | |
download | winamp-20d28e80a5c861a9d5f449ea911ab75b4f37ad0d.tar.gz |
Initial community commit
Diffstat (limited to 'Src/aacdec-mft/MKVAACDecoder.h')
-rw-r--r-- | Src/aacdec-mft/MKVAACDecoder.h | 46 |
1 files changed, 46 insertions, 0 deletions
diff --git a/Src/aacdec-mft/MKVAACDecoder.h b/Src/aacdec-mft/MKVAACDecoder.h new file mode 100644 index 00000000..d4f6e73d --- /dev/null +++ b/Src/aacdec-mft/MKVAACDecoder.h @@ -0,0 +1,46 @@ +#pragma once +#include "../Plugins/Input/in_mkv/ifc_mkvaudiodecoder.h" +#include "MFTDecoder.h" +#include "../nsmkv/Tracks.h" +#include "../Plugins/Input/in_mkv/svc_mkvdecoder.h" + +// {437C68FA-2972-4ede-A157-CBD371E5E263} +static const GUID AACMKVGUID = +{ 0x437c68fa, 0x2972, 0x4ede, { 0xa1, 0x57, 0xcb, 0xd3, 0x71, 0xe5, 0xe2, 0x63 } }; + + +class MKVDecoder : public svc_mkvdecoder +{ +public: + static const char *getServiceName() { return "MFT AAC MKV Decoder"; } + static GUID getServiceGuid() { return AACMKVGUID; } + int CreateAudioDecoder(const char *codec_id, const nsmkv::TrackEntryData *track_entry_data, const nsmkv::AudioData *audio_data, unsigned int preferred_bits, unsigned int preferred_channels, bool floating_point, ifc_mkvaudiodecoder **decoder); +protected: + RECVS_DISPATCH; +}; + +class MKVAACDecoder : public ifc_mkvaudiodecoder +{ +public: + static MKVAACDecoder *Create(const nsmkv::TrackEntryData *track_entry_data, const nsmkv::AudioData *audio_data, unsigned int preferred_bits, unsigned int max_channels, bool floating_point); + +protected: + RECVS_DISPATCH; +private: + /* ifc_mkvaudiodecoder implementation */ + int OutputFrameSize(size_t *frame_size); + int GetOutputProperties(unsigned int *sampleRate, unsigned int *channels, unsigned int *bitsPerSample, bool *isFloat); + int DecodeBlock(void *inputBuffer, size_t inputBufferBytes, void *outputBuffer, size_t *outputBufferBytes); + void Flush(); + void Close(); + void EndOfStream(); // no more input, output anything you have buffered +private: + MKVAACDecoder(unsigned int bps, bool floating_point); + + /* internal implementation */ + + /* data */ + MFTDecoder decoder; + unsigned int bps; + bool floating_point; +};
\ No newline at end of file |