| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354 |
- #ifndef RTSPCLIENTDOWN_H
- #define RTSPCLIENTDOWN_H
- extern "C"
- {
- #include <libavcodec/avcodec.h>
- #include <libavutil/opt.h>
- #include <libavutil/imgutils.h>
- #include <libavutil/common.h>
- #include "libavutil/error.h"
- #include "libavutil/hwcontext.h"
- #include "libavformat/avformat.h"
- #include "libavformat/avio.h"
- }
- #include <mutex>
- #include <condition_variable>
- #include <thread>
- #include <vector>
- namespace iv {
- struct h264rawframedata
- {
- std::shared_ptr<char> mpstr_ptr;
- int mdatasize;
- };
- }
- class rtspclientdown
- {
- public:
- rtspclientdown(std::string strrtspserver);
- ~rtspclientdown();
- private:
- std::thread * mpthread;
- bool mbthreadrun = true;
- std::vector<iv::h264rawframedata> mvectorframe;
- std::mutex mmutexframe;
- std::mutex mmutexcv;
- std::condition_variable mcv;
- int mretrycount = 0;
- private:
- void threadrtspdown(std::string strrtspserver);
- public:
- int Getrtspframe(iv::h264rawframedata & xframe,int nwaitms);
- int Getretrycount();
- };
- #endif // RTSPCLIENTDOWN_H
|