12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273 |
- #ifndef CUMSGBUFFER_H
- #define CUMSGBUFFER_H
- #include <QDateTime>
- #include <QMutex>
- #include <string>
- #include <iostream>
- #include <vector>
- #include <memory>
- #include <picbuf.h>
- #include "clientime.h"
- #ifndef CAM_NUM
- #define CAM_NUM 4
- #endif
- namespace iv {
- struct cumsg
- {
- public:
- int id;
- qint64 ntime;
- std::string strVIN;
- std::string strqueryMD5;
- std::string strctrlMD5;
- std::vector<char> xdata;
- qint64 mlastuptime; //更新时间
- bool mbImportant = false;
- int mkeeptime;
- bool mbhavequery = false;
- PicBuf mpicbuf[CAM_NUM];
- };
- }
- class cumsgbuffer
- {
- public:
- cumsgbuffer();
- private:
- std::vector<iv::cumsg> mvectormsg;
- clientime mclienttime;
- QMutex mMutex;
- public:
- void addmsg(int id,qint64 ntime,std::string strVIN,std::string strqueryMD5,
- std::string strctrlMD5,std::vector<char> * pxdata,bool bImportant,int nkeeptime);
- //if no new msg return 0
- // -1 no this vin
- // -2 queryMD5 error
- int getmsg(std::string strVIN,std::string strqueryMD5,qint64 nlasttime, int & id,qint64 & ntime,
- std::vector<char> * pxdata);
- void addPicData(std::string strVIN,const char * strdata,const unsigned int ndatasize,qint64 npictime,int nCamPos,qint64 nLatency);
- int getPicData(std::string strVIN,std::string strqueryMD5,std::shared_ptr<char> & pdata_ptr,unsigned int & ndatasize,
- std::string strclientid,int nCamPos,qint64 & nPicTime,qint64 & nPicLatency,int & nFrameRate);
- };
- #endif // CUMSGBUFFER_H
|