Nvosd_draw_lines not work

jp5.1.1

        param[0].line_color.red = 1.0;
        param[0].line_color.green = 0;
        param[0].line_color.blue = 0;
        param[0].line_color.alpha = 1.0;
        param[0].line_width = 5;
        param[0].x1 = 400;
        param[0].y1 = 400;
        param[0].x2 = 800;
        param[0].y2 = 800;
        nvosd_draw_lines(osdCtx, MODE_GPU, fd, 1, param);

fd is NV12,pitch
if I use MODE_HW ,it will show libnvosd (2389):(ERROR) : ERROR: HW based functionality yet to be ready
If I use MODE_GPU, no message to be showed and return 0,
But the picture has no lines.
nvosd_draw_rectangles(osdCtx, MODE_HW, fd, size, rects); works well. fd is nv12 pitch too

Hi,
The function supports only MODE_CPU. Other modes are not supported.

That means draw line put text just support CPU.
draw rectagle can use the HW?
What about MODE_GPU?

if I want to save a nv12 with a line to jpeg. The pipeline is nv12->RGBA->draw lines->NV12->jpeg?

Hi,
Yes, please convert to RGBA for calling nvosd functions. And then convert back to NV12/pitch linear for encoding to JPEG. nvosd_draw_lines(MODE_GPU) should work with NvBufSurface in RGBA.

nvosd_draw_rectangles() shall support MODE_GPU, MODE_HW and MODE_CPU. Please try with the sample:

/usr/src/jetson_multimedia_api/samples/11_video_osd

I know the samples. But they don’t show me which the mode the function support clearly. I just want to use the acceleration function as much as possible.~_~ I need to draw line draw rectangle and put text. Any suggestions?Thanks!