#ifndef _cffmpeg_decoder_hpp_ #define _cffmpeg_decoder_hpp_ #include #include #include #include #include #include #include struct AVFrame; struct AVCodecContext; class CPacket; namespace ffwrapper { class FormatIn; class CodedData; } // namespace ffwrapper namespace cffmpeg_wrap { class decoder { private: ffwrapper::FormatIn *decRef_; std::list list_pkt_; std::mutex mutex_pkt_; int64_t next_idx_; private: int initDecoder(); public: void Start(); int SetFrame(const CPacket &pkt); void GetFrame(unsigned char **data, int *w, int *h, int *format, int *length, int64_t *id); public: explicit decoder(ffwrapper::FormatIn *dec); ~decoder(); }; } // namespace cffmpeg_wrap #endif