Commit 558455009bf411e15b7544e27e53079e4cdefccd
1 parent
97eeba5f
更新demo
Showing
1 changed file
with
21 additions
and
12 deletions
test/main.cpp
... | ... | @@ -114,7 +114,9 @@ void init_mq_conn(void *handle) { |
114 | 114 | } |
115 | 115 | #endif |
116 | 116 | |
117 | -const char* ipc_url = "/data/cmhu/data2/duan1.avi"; | |
117 | +const char* ipc_url = "/无人机固定点位模拟卡口设备视频录像 (1)/G219起点/DJI_20250602103403_0005_S.MP4"; | |
118 | +// const char* ipc_url = "rtsp://admin:ad123456@192.168.10.166:554/cam/realmonitor?channel=1&subtype=0"; | |
119 | +// const char* ipc_url = "/data/cmhu/test_data/duan1.avi"; | |
118 | 120 | |
119 | 121 | void set_ipc_url(task_param &tparam, const algorithm_type_t &algor_type) { |
120 | 122 | |
... | ... | @@ -300,31 +302,38 @@ int main(int argc, char *argv[]) { |
300 | 302 | printf("Finish init mq\n"); |
301 | 303 | srand(time(nullptr)); |
302 | 304 | printf("begin add task\n"); |
305 | + | |
303 | 306 | unsigned g_idx = 0; |
304 | 307 | |
305 | - for (int i = start_id; i < end_id; i++) { | |
306 | - for (int j = 0; j < repeat_num; ++j) { | |
308 | + string video_url[5]; | |
309 | + video_url[0] = "/无人机固定点位模拟卡口设备视频录像 (1)/G219起点/DJI_20250602103403_0005_S.MP4"; | |
310 | + video_url[1] = "/无人机固定点位模拟卡口设备视频录像 (1)/G219起点/DJI_20250602105037_0009_S.MP4"; | |
311 | + video_url[2] = "/无人机固定点位模拟卡口设备视频录像 (1)/G219起点/DJI_20250602103900_0006_S.MP4"; | |
312 | + video_url[3] = "/无人机固定点位模拟卡口设备视频录像 (1)/G219起点/DJI_20250602104540_0008_W.MP4"; | |
313 | + video_url[4] = "/无人机固定点位模拟卡口设备视频录像 (1)/G219起点/DJI_20250602104346_0007_S.MP4"; | |
307 | 314 | |
308 | - task_param tparam; | |
315 | + std::vector<algorithm_type_t> algor_vec = {algorithm_type_t::FACE_SNAPSHOT, algorithm_type_t::HUMAN_SNAPSHOT,algorithm_type_t::VEHICLE_SNAPSHOT, algorithm_type_t::NONMOTOR_VEHICLE_SNAPSHOT}; | |
309 | 316 | |
310 | - const auto algor_type = algor_index_to_algor_type(i); | |
311 | - set_ipc_url(tparam, algor_type); | |
317 | + for (int i = 0; i < 5; i++) | |
318 | + { | |
312 | 319 | |
313 | - tparam.algor_counts = 1; | |
320 | + string path = "/data1/share/xjss_test_250612"+ video_url[0] ; | |
321 | + | |
322 | + task_param tparam; | |
323 | + tparam.ipc_url = path.c_str(); | |
324 | + tparam.algor_counts = algor_vec.size(); | |
314 | 325 | |
315 | 326 | std::string task_id_str = "test_task_id_" + to_string(g_idx++); |
316 | 327 | tparam.task_id = task_id_str.c_str(); |
317 | 328 | tparam.algor_config_params = new algor_config_param[tparam.algor_counts]; |
318 | 329 | |
319 | - for (int idx = 0; idx < tparam.algor_counts; ++idx) { | |
320 | - set_task_params(tparam, idx, algor_type); | |
321 | - } | |
330 | + for (size_t idx = 0; idx < algor_vec.size(); ++idx) | |
331 | + set_task_params(tparam, idx, algor_vec.at(idx)); | |
322 | 332 | |
323 | 333 | const int result_code = add_task(handle, tparam); |
324 | 334 | if (result_code != 0) |
325 | 335 | printf("[Error]: "); |
326 | - printf("task_id: %s algort type %d result code: %d\n", tparam.task_id, int(algor_type), result_code); | |
327 | - } | |
336 | + printf("task_id: %s result code: %d\n", tparam.task_id, result_code); | |
328 | 337 | } |
329 | 338 | |
330 | 339 | ... | ... |