47 lines
1.1 KiB
C++
47 lines
1.1 KiB
C++
/*
|
|
* @Date: 2024-09-04 14:51:33
|
|
* @LastEditors: Jacky
|
|
* @LastEditTime: 2024-09-13 11:01:41
|
|
* @FilePath: /GeneralTracker/Universal/CModuleVi.h
|
|
*/
|
|
#ifndef _MODULE_VI_HPP_
|
|
#define _MODULE_VI_HPP_
|
|
|
|
#include <mutex>
|
|
|
|
#include "DataProcessBase.h"
|
|
#include "InterfaceVi.h"
|
|
#include "ICaptureConfig.h"
|
|
/**
|
|
* 采集模块
|
|
* 通过读取通道配置文件来初始化各个VI通道
|
|
*
|
|
*/
|
|
|
|
class CModuleVi : public DataProcessBase
|
|
{
|
|
public:
|
|
int create(const char* name);
|
|
int destroy();
|
|
int set_data(const char* data, void* value = NULL);
|
|
char* get_data();
|
|
int start(const char* data);
|
|
int stop();
|
|
|
|
int suspend(); //挂起线程
|
|
int resume(); //恢复线程
|
|
void push_data(DataProcessBase *src, pool::IMemoryBlock* block);
|
|
private:
|
|
int moduleThread();
|
|
int getSplitData(GD_VIDEO_FRAME_S *src, GD_VIDEO_FRAME_S *dst);
|
|
private:
|
|
bool _thread_flag = false;
|
|
std::thread *_vi_thread = nullptr;
|
|
|
|
int _chn = 0;
|
|
ICaptureConfig::capture_config_t _capture_config;
|
|
std::mutex _mutex;
|
|
uint32_t _frame_index = 0;
|
|
};
|
|
|
|
#endif |