#ifndef VIDEORECORDER_H #define VIDEORECORDER_H #include #include #include "CommonFFmpegFunc.hpp" #include "../VideoServer/QiaoJia/DB/LDBTool.h" struct AVStream; struct AVDictionary; struct AVFormatContext; struct AVPacket; void ffmpegInit(); class VideoRecorder { public: VideoRecorder(const std::string& fullPath,const std::string &uuid, const std::string &strRtsp, const int mseconds,LDBTool* db); virtual ~VideoRecorder(); private: AVFormatContext *m_pInFmtCtx; AVStream *m_pInVideoStream; AVFormatContext *m_pOutFmtCtx; AVStream *m_pOutVideo_stream; AVDictionary *m_pDict; bool m_bStatus; bool m_bStart; std::thread *m_thd; CommonFFmpeg m_CommonFFmpeg; int m_mseconds; std::string m_strfileName; std::string m_uuid; std::string m_fullPath; LDBTool* db_c; bool m_bSave; private: void thisRecodeFunc(); long getCurrentUs(); long getCurrentUs(std::string &strDateTime); void GetFileName(std::string &fileName); static void recodeFunc(void *); }; #endif