mp3_in_mp4.h 1.3 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243
  1. #ifndef NULLSOFT_MP3_MPEG4_H
  2. #define NULLSOFT_MP3_MPEG4_H
  3. // used to decode an MPEG-1 audio object in an MPEG-4 ISO Media file
  4. #include "../Plugins/Input/in_mp4/mpeg4audio.h"
  5. #include <mpg123.h>
  6. class MPEG4_MP3 : public MP4AudioDecoder
  7. {
  8. public:
  9. MPEG4_MP3();
  10. ~MPEG4_MP3();
  11. int Open();
  12. int OpenEx(size_t bits, size_t maxChannels, bool useFloat);
  13. //int AudioSpecificConfiguration(void *buffer, size_t buffer_size); // reads ASC block from mp4 file
  14. int GetCurrentBitrate(unsigned int *bitrate);
  15. int OutputFrameSize(size_t *frameSize);
  16. int GetOutputProperties(unsigned int *sampleRate, unsigned int *channels, unsigned int *bitsPerSample);
  17. int GetOutputPropertiesEx(unsigned int *sampleRate, unsigned int *channels, unsigned int *bitsPerSample, bool *isFloat);
  18. int DecodeSample(void *inputBuffer, size_t inputBufferBytes, void *outputBuffer, size_t *outputBufferBytes);
  19. void Flush();
  20. void Close();
  21. const char *GetCodecInfoString();
  22. int CanHandleCodec(const char *codecName);
  23. int CanHandleType(unsigned __int8 type);
  24. int CanHandleMPEG4Type(unsigned __int8 type);
  25. int SetGain(float gain);
  26. private:
  27. bool _UpdateProperties();
  28. mpg123_handle *decoder;
  29. int bits;
  30. int channels;
  31. bool floatingPoint;
  32. int sample_rate;
  33. RECVS_DISPATCH;
  34. float gain;
  35. int pregap;
  36. };
  37. #endif