| | |
| | | #include <memory> |
| | | #include <list> |
| | | #include <mutex> |
| | | #include <thread> |
| | | #include <atomic> |
| | | #include <condition_variable> |
| | | |
| | | #include "../common.hpp" |
| | | |
| | | struct AVFrame; |
| | | |
| | | namespace ffwrapper |
| | | { |
| | | class FormatIn; |
| | | class cvbridge; |
| | | class CodedData; |
| | | |
| | | } // namespace ffwrapper |
| | | |
| | | namespace cffmpeg_wrap |
| | |
| | | std::list<BGR24> list_pic_; |
| | | std::mutex mutex_pic_; |
| | | |
| | | std::unique_ptr<std::thread> thread_; |
| | | std::atomic_bool stop_; |
| | | |
| | | std::list<CPacket> list_pkt_; |
| | | std::mutex mutex_pkt_; |
| | | std::condition_variable cv_; |
| | | private: |
| | | int initDecoder(); |
| | | int saveFrame(AVFrame *frame, int64_t &id); |
| | | public: |
| | | void Start(); |
| | | int SetFrame(std::shared_ptr<ffwrapper::CodedData> data, int64_t &id); |
| | | void GetFrame(unsigned char **data, int *w, int *h, int64_t *id); |
| | | public: |