diff options
| author | Jean-Francois Mauguit <jfmauguit@mac.com> | 2024-09-24 09:03:25 -0400 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2024-09-24 09:03:25 -0400 |
| commit | bab614c421ed7ae329d26bf028c4a3b1d2450f5a (patch) | |
| tree | 12f17f78986871dd2cfb0a56e5e93b545c1ae0d0 /Src/mp3-mpg123/mp3_in_mp4.h | |
| parent | 4bde6044fddf053f31795b9eaccdd2a5a527d21f (diff) | |
| parent | 20d28e80a5c861a9d5f449ea911ab75b4f37ad0d (diff) | |
| download | winamp-bab614c421ed7ae329d26bf028c4a3b1d2450f5a.tar.gz | |
Merge pull request #5 from WinampDesktop/community
Merge to main
Diffstat (limited to 'Src/mp3-mpg123/mp3_in_mp4.h')
| -rw-r--r-- | Src/mp3-mpg123/mp3_in_mp4.h | 43 |
1 files changed, 43 insertions, 0 deletions
diff --git a/Src/mp3-mpg123/mp3_in_mp4.h b/Src/mp3-mpg123/mp3_in_mp4.h new file mode 100644 index 00000000..cdef0e84 --- /dev/null +++ b/Src/mp3-mpg123/mp3_in_mp4.h @@ -0,0 +1,43 @@ +#ifndef NULLSOFT_MP3_MPEG4_H +#define NULLSOFT_MP3_MPEG4_H + +// used to decode an MPEG-1 audio object in an MPEG-4 ISO Media file + +#include "../Plugins/Input/in_mp4/mpeg4audio.h" +#include <mpg123.h> + +class MPEG4_MP3 : public MP4AudioDecoder +{ +public: + MPEG4_MP3(); + ~MPEG4_MP3(); + int Open(); + int OpenEx(size_t bits, size_t maxChannels, bool useFloat); + //int AudioSpecificConfiguration(void *buffer, size_t buffer_size); // reads ASC block from mp4 file + int GetCurrentBitrate(unsigned int *bitrate); + int OutputFrameSize(size_t *frameSize); + int GetOutputProperties(unsigned int *sampleRate, unsigned int *channels, unsigned int *bitsPerSample); + int GetOutputPropertiesEx(unsigned int *sampleRate, unsigned int *channels, unsigned int *bitsPerSample, bool *isFloat); + int DecodeSample(void *inputBuffer, size_t inputBufferBytes, void *outputBuffer, size_t *outputBufferBytes); + void Flush(); + void Close(); + const char *GetCodecInfoString(); + int CanHandleCodec(const char *codecName); + int CanHandleType(unsigned __int8 type); + int CanHandleMPEG4Type(unsigned __int8 type); + int SetGain(float gain); + +private: + bool _UpdateProperties(); + mpg123_handle *decoder; + + int bits; + int channels; + bool floatingPoint; + int sample_rate; + RECVS_DISPATCH; + float gain; + int pregap; +}; + +#endif |
