How to draw graphic over video IMX8MQ

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

How to draw graphic over video IMX8MQ

1,409 Views
vovandolzhenkov
Contributor II

IMX8MQ - It is necessary to implement a simple task. Draw cursor from wayland(weston) over video plane. On imx8m mini this work good (use 1-primary plane and graphics,video draw to this plane without any problems). Imx8mq dcss use 3 plane - 1 - primary(graphics with alpha) and 2,3 - video overlay plane. How to draw a cursor, windows, etc. from weston over video's plane? When i use alpha blending on primary layer, all layers draw dim. 

4 Replies

1,089 Views
Bio_TICFSL
NXP TechSupport
NXP TechSupport

Hello,

I did some tests here using the i.MX 8MQ EVK + L4.14.98_2.0.0ga + HDMI 4K driven by dcss and I could reproduce the customer request just by using gstreamer pipeline as example:

gst-launch-1.0 filesrc location=<file>.mp4 ! decodebin ! waylandsink window-width=640 window-height=480

 

I tested it by changing the BSP to L4.9.51_1.0.0ga, by using the OLED MIPI display instead of HDMI, and by changing the sink to glimagesink and kmssink. In all the tests, excepting the kmssink (this plugin is not supported in the L4.14.98_2.0.0ga anymore), I am able to see the mouse cursor over the video, as you can see in the image below:

weston_cursor_test.jpg

 

So please, can you confirm which kernel version are using? are there any change on it?

Regards

1,089 Views
vovandolzhenkov
Contributor II

Thanks for the answer. I already figured out the problem - everything works.

0 Kudos

1,089 Views
Bio_TICFSL
NXP TechSupport
NXP TechSupport

Hello Vladimir,

Can you share the i.MX 8MM solution to be used as a comparison point?

Regards

0 Kudos

1,089 Views
vovandolzhenkov
Contributor II

test.jpg

I want to get the result, as in the picture. Weston background, video not fullscreen and weston cursor over the video plane. This case work good on imx8mm, but don't work with imx8mq. Imx8mm use g2d with 1 drm primary plane,  imx8mq use dcss with 3 drm planes(1-primary (gpu with alpha), 2-overlay(vpu without alpha)). I need to draw an alpha cursor over the video plane on imx8mq board.

On imx8mq I try change code in kernel:

Change function dcss_dtg_plane_alpha_set for always set flag CH1_ALPHA_SEL. 

if (0)//(dcss_dtg_global_alpha_needed(pix_format) || use_global_alpha)
{
dtg->control_status &= ~(CH1_ALPHA_SEL | DEFAULT_FG_ALPHA_MASK);
dtg->control_status |= alpha_val;
} else {
dtg->control_status |= CH1_ALPHA_SEL;
}

I try draw transparent fullscreen png picture over video playback with drmModeSetPlane function without wayland - this work good.(video plane visible)

I try draw my cursor with alpha over video playback  without wayland - this work good too.(cursor from gpu plane over video plane)

But when i set transparent background for weston and start video playback over weston - video plane is not visible. 

I need the Weston cursor to draw over the video plane and video plane was visible, when move cursor and repaint gpu layer.

Hardware allow this case, because i try draw fullscreen transparent gpu layer over video plane and video was visible. But Weston does not pass alpha channel to the kernel.

0 Kudos