| | |
| | | struct AVFrame; |
| | | struct AVCodecContext; |
| | | |
| | | class CPacket; |
| | | |
| | | namespace ffwrapper |
| | | { |
| | | class FormatIn; |
| | |
| | | |
| | | namespace cffmpeg_wrap |
| | | { |
| | | typedef struct _frm{ |
| | | AVFrame *frm; |
| | | int64_t id; |
| | | }FRM; |
| | | |
| | | class decoder |
| | | { |
| | | private: |
| | | |
| | | ffwrapper::FormatIn *decRef_; |
| | | |
| | | std::list<FRM> list_frm_; |
| | | std::mutex mutex_frm_; |
| | | |
| | | std::list<CPacket> list_pkt_; |
| | | std::mutex mutex_pkt_; |
| | | |
| | | int64_t next_idx_; |
| | | |
| | | private: |
| | | int initDecoder(); |
| | | int saveFrame(AVFrame *frame, int64_t &id); |
| | | public: |
| | | void Start(); |
| | | int SetFrame(std::shared_ptr<ffwrapper::CodedData> data, int64_t &id); |
| | | int SetFrame(const CPacket &pkt); |
| | | void GetFrame(unsigned char **data, int *w, int *h, int *format, int *length, int64_t *id); |
| | | |
| | | public: |