Questions about tegra_multimedia_api / sample / 07_video_convert

When the dqBuffer of the output plane is called, how is the data passed to the capture plane?

// Read video frame from file till EOS is reached and queue buffer on conv0 output plane
    while (!ctx.got_error && !ctx.conv0->isInError() &&
            (!ctx.conv1 || !ctx.conv1->isInError()) && !eos)
    {
        struct v4l2_buffer v4l2_buf;
        struct v4l2_plane planes[MAX_PLANES];
        NvBuffer *buffer;

        memset(&v4l2_buf, 0, sizeof(v4l2_buf));
        memset(planes, 0, sizeof(planes));

        v4l2_buf.m.planes = planes;

        if (ctx.conv0-><b>output_plane.dqBuffer</b>(v4l2_buf, &buffer, NULL, 100) < 0)
        {
            cerr << "ERROR while DQing buffer at conv0 output plane" << endl;
            abort(&ctx);
            goto cleanup;
        }

        if (read_video_frame(ctx.in_file, *buffer) < 0)
        {
            cerr << "Could not read complete frame from input file" << endl;
            cerr << "File read complete." << endl;
            v4l2_buf.m.planes[0].bytesused = 0;
            eos = true;
        }

        ret = ctx.conv0->output_plane.qBuffer(v4l2_buf, NULL);
        if (ret < 0)
        {
            cerr << "Error while queueing buffer at conv0 output plane" << endl;
            abort(&ctx);
            goto cleanup;
        }
    }

Thanks!

Hi,
The conversion is done on hardware VIC engine. For understanding hardware blocks on Jetson TX2. Please check Technical Reference Manual:
https://developer.nvidia.com/embedded/downloads#?search=trm

We also have NvBuffer APIs in nvbuf_utils.h. You can simply call

/**
 * Transforms one DMA buffer to another DMA buffer.
 * This function can support transforms for copying, scaling, fliping, rotating, and cropping.
 * @param[in] src_dmabuf_fd DMABUF FD of source buffer
 * @param[in] dst_dmabuf_fd DMABUF FD of destination buffer
 * @param[in] transform_params transform parameters
 *
 * @return 0 for sucess, -1 for failure.
 */
int NvBufferTransform (int src_dmabuf_fd, int dst_dmabuf_fd, NvBufferTransformParams *transform_params);

I got it,NvbufferTransForm is more efficient for me.
Thanks!