#ifndef _cffmpeg_decoder_hpp_ #define _cffmpeg_decoder_hpp_ #include #include #include #include #include #include #include struct AVFrame; struct AVCodecContext; namespace ffwrapper { class FormatIn; class CodedData; } // namespace ffwrapper namespace cffmpeg_wrap { typedef struct _frm{ AVFrame *frm; int64_t id; }FRM; class decoder { private: ffwrapper::FormatIn *decRef_; std::list list_frm_; std::mutex mutex_frm_; private: int initDecoder(); int saveFrame(AVFrame *frame, int64_t &id); public: void Start(); int SetFrame(std::shared_ptr data, int64_t &id); 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