#include "header.h" #include "acl/acl.h" #include "acl/ops/acl_dvpp.h" #include "task_param_manager.h" #include "../ai_engine_module/VPTProcess.h" #include "../reprocessing_module/snapshot_reprocessing.h" #include "../reprocessing_module/save_snapshot_reprocessing.h" #include #include #include #include #include #include using namespace std; class DeviceMemory; class CMultiSourceProcess { public: CMultiSourceProcess(); ~CMultiSourceProcess(); int InitAlgorthim(tsl_aiplatform_param vptParam); bool AddTask(task_param _cur_task_param); bool PauseTask(const string taskID); bool RestartTask(const string taskID); bool FinishTask(const string taskID); void CloseAllTask(); int SnapShot(task_param param); #ifdef POST_USE_RABBITMQ int AddMqConn(mq_type_t mq_type, rabbitmq_conn_params_t mq_conn_param); int GetTaskStatus(const string taskID); #endif public: int algorthim_process_thread(); // 算法处理线程 void task_finished(const string task_id); void decoded_cbk(DeviceMemory* devFrame); private: // 算法相关 int algorthim_vpt(vector vec_gpuMem); private: // 工具处理函数 bool task_has_vpt_algor(const std::string &task_id); void clear_finished_task(); bool finish_task(const string taskID, const bool delete_snapshot); int algorithm_vehicle_relult(vector vec_devMem, vector& vptResult, vector>& delete_object_id); void send_locus_finished_msg(vector& vpt_interest_task_id, vector> deleteObjectID); private: int m_devId; snapshot_reprocessing *m_snapshot_reprocessing{nullptr}; task_param_manager *m_task_param_manager{nullptr}; save_snapshot_reprocessing *m_save_snapshot_reprocessing{nullptr}; VPTProcess vpt_process; int skip_frame_ = 5; // 控制跳帧参数 deque m_RgbDataList; mutex m_DataListMtx; mutex m_FinishedTaskMtx; map m_FinishedTaskMap; thread* m_pAlgorthimThread; bool m_bfinish{false}; int m_batch_size{1}; #ifdef POST_USE_RABBITMQ mq::Manager *mq_manager_{nullptr}; #endif };