diff --git a/test/main.cpp b/test/main.cpp index 6f26584..77241e7 100644 --- a/test/main.cpp +++ b/test/main.cpp @@ -114,7 +114,9 @@ void init_mq_conn(void *handle) { } #endif -const char* ipc_url = "/data/cmhu/data2/duan1.avi"; +const char* ipc_url = "/无人机固定点位模拟卡口设备视频录像 (1)/G219起点/DJI_20250602103403_0005_S.MP4"; +// const char* ipc_url = "rtsp://admin:ad123456@192.168.10.166:554/cam/realmonitor?channel=1&subtype=0"; +// const char* ipc_url = "/data/cmhu/test_data/duan1.avi"; void set_ipc_url(task_param &tparam, const algorithm_type_t &algor_type) { @@ -300,31 +302,38 @@ int main(int argc, char *argv[]) { printf("Finish init mq\n"); srand(time(nullptr)); printf("begin add task\n"); + unsigned g_idx = 0; - for (int i = start_id; i < end_id; i++) { - for (int j = 0; j < repeat_num; ++j) { + string video_url[5]; + video_url[0] = "/无人机固定点位模拟卡口设备视频录像 (1)/G219起点/DJI_20250602103403_0005_S.MP4"; + video_url[1] = "/无人机固定点位模拟卡口设备视频录像 (1)/G219起点/DJI_20250602105037_0009_S.MP4"; + video_url[2] = "/无人机固定点位模拟卡口设备视频录像 (1)/G219起点/DJI_20250602103900_0006_S.MP4"; + video_url[3] = "/无人机固定点位模拟卡口设备视频录像 (1)/G219起点/DJI_20250602104540_0008_W.MP4"; + video_url[4] = "/无人机固定点位模拟卡口设备视频录像 (1)/G219起点/DJI_20250602104346_0007_S.MP4"; - task_param tparam; + std::vector algor_vec = {algorithm_type_t::FACE_SNAPSHOT, algorithm_type_t::HUMAN_SNAPSHOT,algorithm_type_t::VEHICLE_SNAPSHOT, algorithm_type_t::NONMOTOR_VEHICLE_SNAPSHOT}; - const auto algor_type = algor_index_to_algor_type(i); - set_ipc_url(tparam, algor_type); + for (int i = 0; i < 5; i++) + { - tparam.algor_counts = 1; + string path = "/data1/share/xjss_test_250612"+ video_url[0] ; + + task_param tparam; + tparam.ipc_url = path.c_str(); + tparam.algor_counts = algor_vec.size(); std::string task_id_str = "test_task_id_" + to_string(g_idx++); tparam.task_id = task_id_str.c_str(); tparam.algor_config_params = new algor_config_param[tparam.algor_counts]; - for (int idx = 0; idx < tparam.algor_counts; ++idx) { - set_task_params(tparam, idx, algor_type); - } + for (size_t idx = 0; idx < algor_vec.size(); ++idx) + set_task_params(tparam, idx, algor_vec.at(idx)); const int result_code = add_task(handle, tparam); if (result_code != 0) printf("[Error]: "); - printf("task_id: %s algort type %d result code: %d\n", tparam.task_id, int(algor_type), result_code); - } + printf("task_id: %s result code: %d\n", tparam.task_id, result_code); }