This thread has been locked.
If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.
您好!
我在调试"app_srv_camera"时遇到一些困惑。
我在代码中看到"app_run_graph"函数包含一个 for 循环和两个 while 循环。 我应该如何理解这里的环路? 这里实现了哪些循环?
您能帮助我理解吗?
非常感谢!
for(buf_id=0; buf_id<NUM_BUFS; buf_id++) { graph_parameter_num = 0; printf("test_b3________________vxGraphParameterEnqueueReadyRef status = %d\n", status); if(status == VX_SUCCESS) { status = vxGraphParameterEnqueueReadyRef(obj->graph, graph_parameter_num, (vx_reference*)&obj->capt_frames[buf_id], 1); } graph_parameter_num++; }
while(status == VX_SUCCESS) { vx_object_array out_capture_frames; vx_image test_image; graph_parameter_num = 0; appPerfPointBegin(&obj->total_perf); printf("test_b5________________vxGraphParameterDequeueDoneRef status = %d\n", status); if(status == VX_SUCCESS) { printf("start Strange mistake ___________________EGL\n"); status = vxGraphParameterDequeueDoneRef(obj->graph, graph_parameter_num, (vx_reference*)&out_capture_frames, 1, &num_refs); printf("end Strange mistake ___________________EGL\n"); } graph_parameter_num++; printf("test_b6________________vxGraphParameterDequeueDoneRef status = %d\n", status); printf("test_b7________________vxGraphParameterEnqueueReadyRef status = %d\n", status); graph_parameter_num = 0; if(status == VX_SUCCESS) { status = vxGraphParameterEnqueueReadyRef(obj->graph, graph_parameter_num, (vx_reference*)&out_capture_frames, 1); } graph_parameter_num++; printf("test_b8________________vxGraphParameterEnqueueReadyRef status = %d\n", status); appPerfPointEnd(&obj->total_perf); if(iteration==100) { /* after first 'n' iteration reset performance stats */ appPerfStatsResetAll(); } iteration++; if((obj->stop_task) || (status != VX_SUCCESS)) { break; } } /* ensure all graph processing is complete */ vxWaitGraph(obj->graph); printf("test_b9________________vxWaitGraph status = %d\n", status); /* Dequeue buf for pipe down */ num_refs = 0xFF; graph_parameter_num = 0; while((num_refs > 0) && (status == VX_SUCCESS)) { printf("test_b10________________vxGraphParameterCheckDoneRef status = %d\n", status); vx_object_array out_capture_frames; if(status == VX_SUCCESS) { status = vxGraphParameterCheckDoneRef(obj->graph, graph_parameter_num, &num_refs); } if(num_refs > 0) { printf("test_b11________________vxGraphParameterDequeueDoneRef status = %d\n", status); APP_PRINTF("Dequeue capture\n"); if(status == VX_SUCCESS) { status = vxGraphParameterDequeueDoneRef( obj->graph, graph_parameter_num, (vx_reference*)&out_capture_frames, 1, &num_refs); } printf("test_b12________________vxGraphParameterDequeueDoneRef status = %d\n", status); } } num_refs = 0xFF;
此致、
跃迁市
尊敬的 Yueqian:
第一个循环是图中的管道。 即、您必须将缓冲区排队以绘制图形来触发它。
因此、第一个循环根据缓冲区深度将初始数量的缓冲区排队。
第二个循环是过程循环、在这个循环中、您可以从框架中进行排队、在应用程序中使用它(如果需要)、然后将它重新排队到框架中
最后一个循环(即 :对于 pipe down、为 dequeue buf)用于图形完成后或用户请求停止图形时的 pipe down (即取消所有最初排队以顺利退出的剩余缓冲区的队列)。
我希望这可以解答您的疑问。
此致、
尼基尔