How to display the video stream in the OS task

Description

What MCU/Processor/Board and compiler are you using?

STM32H750

What LVGL version are you using?

lvgl 7.11

What do you want to achieve?

display

What have you tried so far?

video can be play in the task, but display conflict when press some control button

Code to reproduce

Add a code snippet which can run in the simulator. It should contain only the relevant code that compiles without errors when separated from your main code base.

The code block(s) should be formatted like:

/*You code here*/

Screenshot and/or video

If possible, add screenshots and/or videos about the current state.

Hi, Team,
I have tried a mjpeg video player with LVGL and the display is abnormal when press some control button like pause/next. I created a canvas object with the buffer for the decoded video frame and also created OS task(not lvgl task) for the video file open/decode and direct write to the buffer and then invalid the canvas in the task. The main lvgl gui is running in another OS task. I got know that LVGL is not thread-safe by default. But as the tough timing of the video frame , I have to direct write the buffer and invalid the canvas ,otherwise the frame will look like paused by some internel task of LVGL and crashed finally when changing the invalid of the canvas to the main task.
How to arrange the video task ? Would like to have your advice!
Best Regards,
James

Hi, Team,
How about the img instead of the canvas?

Best Regards,
James