[mmapi] How to make conv output YUV data for the entire frame of consecutive addresses

I modified the 00_video_decode sample.
I tried this change, but the program does not work properly

ret = ctx->conv->setCapturePlaneFormat( V4L2_PIX_FMT_YUV420,
                                         crop.c.width,
                                         crop.c.height,
                                         V4L2_NV_BUFFER_LAYOUT_BLOCKLINEAR);

Hi LI, we support V4L2_PIX_FMT_YUV420M only.

Hi DaneLLL:

Why in the 00_video_decode ,conv only support V4L2_NV_BUFFER_LAYOUT_PITCH, NV12M and YUV420M, but 07_video_convert can be converted to a variety of formats?

Hi Li, in 07_video_convert, YUY420M and NV12M are listed.

ubuntu@tegra-ubuntu:~/tegra_multimedia_api/samples/07_video_convert$ ./video_convert --help

video-convert <in-file> <in-width> <in-height> <in-format> <out-file> <out-width> <out-height> <out-format> [OPTIONS]

Supported formats:
        YUV420M
        YVU420M
        NV12M
        YUV444M
        YUV422M
        YUYV
        YVYU
        UYVY
        VYUY
        ABGR32
        XRGB32
        GREY

OPTIONS:
        -h,--help            Prints this text
        --dbg-level <level>  Sets the debug level [Values 0-3]

        --input-raw          Input will be raw buffer
        --input-nvpl         Input will be NV PL buffer [Default]
        --input-nvbl         Input will be NV BL buffer
        --output-raw         Output will be raw buffer
        --output-nvpl        Output will be NV PL buffer [Default]
        --output-nvbl        Output will be NV BL buffer

        -cr <left> <top> <width> <height> Set the cropping rectangle [Default = 0 0 0 0]
        -fm <method>         Flip method to use [Default = 0]
        -im <method>         Interpolation method to use [Default = 1]
        -tnr <algo>          TNR algorithm to use [Default = 0]

NOTE: TNR is supported for YUV420M, NV12M, YUYV and UYVY formats

Allowed values for flip method:
0 = Identity(no rotation)  1 = 90 degree counter-clockwise rotation
2 = 180 degree rotation    3 = 90 degree clockwise rotation
4 = Horizontal flip        5 = Flip across upper right/lower left diagonal
6 = Vertical flip          7 = Flip across upper left/lower right diagonal

Allowed values for interpolation method:
1 = nearest    2 = linear
3 = smart      4 = bilinear

Allowed values for tnr:
0 = Original               1 = Outdoor low light
2 = Outdoor medium light   3 = Outdoor high light
4 = Indoor low light       5 = Indoor medium light
6 = Indoor high light

Which format is supported in 07_video_convert but not supported in 00_video_decode?

Hi,DaneLLL,

07_video_convert can set conv’s captureplane output format to V4L2_NV_BUFFER_LAYOUT_BLOCKLINEAR
But 00_video_decode can not

Hi Li,
Please apply the following logic from 07_video_convert to 00_video_decode and give it a try

else if (ctx.in_buftype == BUF_TYPE_NVBL || ctx.out_buftype == BUF_TYPE_NVBL)
    {
    ret = ctx.conv0->capture_plane.setupPlane(V4L2_MEMORY_MMAP, 10, false, false);
    }