派生自 development/c++

pansen
2019-03-15 d883ec2891210b7e9361557b11e435c892528901
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
#ifndef VIDEORECORDER_H
#define VIDEORECORDER_H
 
#include<thread>
#include <basic/util/app/AppPreference.hpp>
#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