audio_encoder.h 512 B

123456789101112131415161718192021222324
  1. #ifndef __AUDIO_ENCODER_H__
  2. #define __AUDIO_ENCODER_H__
  3. #include "abstract_encoder.h"
  4. template<>
  5. class Encoder<MediaType::AUDIO> : public AbstractEncoder
  6. {
  7. public:
  8. struct Param
  9. {
  10. int bitRate;
  11. };
  12. ~Encoder() { Close(); }
  13. bool Open(const Param& audioParma, AVFormatContext* fmtCtx);
  14. virtual void Close() override;
  15. virtual bool PushFrame(AVFrame* frame, bool isEnd, uint64_t pts) override;
  16. private:
  17. bool _Init(const Param& audioParam, AVFormatContext* fmtCtx);
  18. };
  19. #endif