Hi,

Transparency layer is in fact fb layer (it's already open and init once you 
start the system). In contrast, V4L2 layer is opened and initialized in 
your application.

In order for everything to work there are a few things you'd need to do 
(this is for fb0 - for fb1 everything is the same, just with /dev/fb1 and 
FBIOGET_LAYER_HDL_1):
1. You need to set the fex file not to use scaler - fb0_scaler_mode_enable 
= 0. Also set fb0_format = 10 (this is ARGB8888 format which you need for 
alpha blending to work).
2. The fb layer is using PIPE 0 by default, so for alpha blender to work 
properly, you need to set the V4L2 layer to use PIPE 1.
3. You need to set the global alpha enable for V4L2 layer to 1 and set the 
global alpha value to 0xff (I did all this with DISP_CMD_LAYER_SET_PARA 
when opening the layer).
4. Move the V4L2 layer to the top (DISP_CMD_LAYER_TOP).
5. Get the file descriptor for framebuffer (fb_fd = open("/dev/fb0", 
O_RDWR);) and fill the complete layer with zeros (malloc a WxHx4 memory 
chunk, memset it to 0x00 and write the chunk to file descriptor).
6. Get the fb layer handle (FBIOGET_LAYER_HDL_0) and move the fb layer to 
the top (DISP_CMD_LAYER_TOP). Now fb layer is on top with V4L2 layer just 
under it.
7. Turn off global alpha for fb layer (DISP_CMD_LAYER_ALPHA_OFF).
8. Set the global alpha value for fb layer to 0x00 
(DISP_CMD_LAYER_SET_ALPHA_VALUE).

This is basically all you need to do. If testing with Mali, you could run 
mali_drv/test/test and a triangle should appear just over the video. You 
can also edit test.c and put opacity to 0.5, making the triangle 50% 
transparent.
For testing without Mali, you can just allocate a memory chunk (fill it 
with let's say 0x80 - this is light gray, 50% transparent) and write it to 
fb layer file descriptor - you will get a light gray overlay over the video.

On Monday, June 23, 2014 8:43:32 AM UTC+2, [email protected] wrote:
>
> Hello Sir.
> I have a similar problem, but I'm using the A10 allwinner.
> Can you explain about how to get the transparency layer above video(v4l2) 
> layer?
>
> Kind Regards,
> Ryang.
>

-- 
You received this message because you are subscribed to the Google Groups 
"linux-sunxi" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
For more options, visit https://groups.google.com/d/optout.

Reply via email to