派生自 development/c++

pansen
2019-02-25 8d1ead663449e6bf508d4d703b6d56381141daeb
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
#ifndef HCANALYSVIDEO_H_XZL_201808131611
#define HCANALYSVIDEO_H_XZL_201808131611
 
#include "myThread.h"
#include "AppController.h"
#include <vector>
#include <basic/io/io.h>
#include "dispathdatatype.hpp"
 
//struct AnalysSrcInfo {
//    std::string strPath;
//};
 
class HcAnalysVideo : public mythread<getCutFileManage> {
    using TASK_FUNCTION = std::function<void(std::shared_ptr<finishCutFileManage> &)>;
public:
    HcAnalysVideo(TASK_FUNCTION task_f = nullptr) : m_task_function(task_f) {}
 
    ~HcAnalysVideo() {
 
    }
 
private:
    virtual void doFunc(std::shared_ptr<getCutFileManage> spPacket) {
        AppController _AppController(spPacket->src_path, 5000);
        auto str_Path = _AppController.startController();
        if (m_task_function != nullptr) {
            auto fp_task(
                std::make_shared<finishCutFileManage>(
                    finishCutFileManage{spPacket->src_path, str_Path,
                                        IOOperate::GetFileNum(str_Path.c_str(), ".mp4")}));
            m_task_function(fp_task);
        } else {
            ERR("m_task_function == nullptr");
            return;
        }
    }
 
private:
    TASK_FUNCTION m_task_function;
};
 
#endif