FhGAACEncoder.h 915 B

1234567891011121314151617181920212223242526272829
  1. #pragma once
  2. #include "MP4Writer.h"
  3. #include "mp4FastAAClib.h"
  4. #include "config.h"
  5. #include "encoder_common.h"
  6. class FhGAACEncoder : public EncoderCommon
  7. {
  8. public:
  9. static FhGAACEncoder *CreateDecoder(const AACConfiguration *cfg, int nch, int srate, int bps);
  10. FhGAACEncoder(HANDLE_MPEG4ENC_ENCODER encoder, const MPEG4ENC_SETUP *setup, int nch, int srate, int bps, float *sample_buffer, unsigned int next_samples);
  11. ~FhGAACEncoder();
  12. int Encode(int framepos, void *in, int in_avail, int *in_used, void *out, int out_avail);
  13. void PrepareToFinish();
  14. void Finish(const wchar_t *filename);
  15. private:
  16. HANDLE_MPEG4ENC_ENCODER encoder;
  17. unsigned int channels;
  18. unsigned int sample_rate;
  19. unsigned int bits_per_sample;
  20. unsigned int next_samples;
  21. unsigned int samples_per_frame;
  22. float *sample_buffer;
  23. MP4Writer mp4_writer;
  24. uint64_t total_samples;
  25. uint64_t decodable_samples;
  26. bool finishing;
  27. bool resampling;
  28. };