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.

PROCESSOR-SDK-DRA8X-TDA4X: What's the difference between out_capture_frames and obj->capt_frames[0] in program app_multi_cam ?

Part Number: PROCESSOR-SDK-DRA8X-TDA4X


Hi,

In app_multi_cam, out_capture_frames use for enqueue and dequeue in function app_run_graph

                vxGraphParameterDequeueDoneRef(
                                    obj->graph,
                                    obj->cap_gp_index,
                                    (vx_reference*)&out_capture_frames,
                                    1,
                                    &num_refs);

                appPerfPointEnd(&obj->total_perf);

                status = vxGraphParameterEnqueueReadyRef(
                                    obj->graph,
                                    obj->cap_gp_index,
                                    (vx_reference*)&out_capture_frames,
                                    1);

obj->capt_frames[0] use for capture buffer.

obj->captureNode = tivxCaptureNode(obj->graph, obj->capture_param_obj, obj->capt_frames[0]);

So What's the difference between out_capture_frames and obj->capt_frames[0] ? If I want to save or display the camera data, which should I use ?

And other question,what means obj->capt_frames[1] or obj->capt_frames[2]......? Why tivxCaptureNode only use obj->capt_frames[0] but not obj->capt_frames ?

Regards

  • Hello,

    I will start with your second question as it provides further context for the first question.  The capture node has multiple buffers at the output so that the capture driver can write to the output while the downstream OpenVX nodes can read from the previous output.  As per the official OpenVX pipelining extension spec linked to below, this can be accomplished through the use of the OpenVX graph parameter concept.  With the output of the capture node created as a graph parameter, the output buffers of the node are created as a C array within the application, with the depth of the array equal to the number of buffers used at the output of the capture node.  In this application, the C array that is used as the capture node output is obj->capt_frames[NUM_BUF].  When this parameter is declared as a graph parameter and passed to the vxSetGraphScheduleConfig, the buffer depth is specified so that the framework knows the depth of this array.  Therefore, when the tivxCaptureNode is declared, only the first element of that array must be passed at the node output.  The framework will then understand by way of the vxSetGraphScheduleConfig call how many elements are within this array and use the next element of the array in subsequent graph executions.  I have also linked to an additional document within the TIOVX user guide to provide further details on this beyond the OpenVX spec.

    https://www.khronos.org/registry/OpenVX/extensions/vx_khr_pipelining/1.0/html/

    https://software-dl.ti.com/jacinto7/esd/processor-sdk-rtos-jacinto7/latest/exports/docs/tiovx/docs/user_guide/TIOVX_USAGE_REC.html#TIOVX_USAGE_REC_PIPELINING

    Regarding your initial question, during the initial enqueue of the buffers to the capture node output, the application will enqueue the full buffer depth of the capture output so that the capture node has all buffers available to write to.  Once a buffer has been written to and can then be released to the application, the dequeue call will return a buffer.  However, the application does not know which specific buffer within the obj->capt_frames[] array is returned and thus we dequeue the frame into a new temporary buffer.  This buffer can then be mapped within the application, written to file, etc.  After the application has operated on this buffer, the buffer can then be enqueued back to the framework so that the capture node can process on this frame.

    Please let me know if you have any further questions.  The OpenVX pipelining spec and the TIOVX user guide have some helpful information on this topic and similar topics related to pipelining as well.

    Regards,

    Lucas