There are some test cases used to show alpha effect in previous unit_tests, but it is not found in latest Linux BSP release. So I prepare a simple test code to perform colorkey, global alpha, local alpha or alpha in pixel option for video combining, it could be useful when customer wants to see the effect.
I have checked test code on MX6Q ARM2 board and Linux release package is L3.0.15_12.05.01_ER_source.tar.gz.
Test based on the following assumptions:
1. Video combining is performed by the DP, BG video --> /dev/fb0, FG UI --> /dev/fb1
2. Panel resolution is 1024x768
Here are test steps:
1. Play a video or a picture on /dev/fb0.
2. Use fb_setup to setup fb1.
It will fill pixel value in frame buffer and alpha value in alpha buffer as below.
Frame buffer in RGBA mode:
for (i = 0; i < fb_var.yres; i++)
for (j = 0; j < fb_var.xres; j++)
if (i < fb_var.yres / 4)
pbuf[i * screen_width + j] = 0xFF000080; //Red pixel with alpha value 0x80 in first region
else if (i < fb_var.yres / 2)
pbuf[i * screen_width + j] = 0x00FF00FF; //Green pixel opaque in second region
else if (i < fb_var.yres * 3 / 4)
pbuf[i * screen_width + j] = 0x0000FF00; //Blue pixel transparent in third region
pbuf[i * screen_width + j] = 0xFFFFFFFF; //White pixel opaque in fourth region
memset(alpbuf, 0xFF, alp_size/4); //Alpha value is 0xFF in first region
memset(alpbuf+alp_size/4, 0xAA, alp_size/4); //Alpha value is 0xAA in second region
memset(alpbuf+alp_size/2, 0x80, alp_size/4); //Alpha value is 0x80 in third region
memset(alpbuf+alp_size*3/4, 0x55, alp_size/4); //Alpha value is 0x55 in fourth region
3. Use alpha_test to check colorkey, global alpha, local alpha and alpha in pixel effect.
colorkey on: ./alpha_test colorkey_on <colorkey value> //colorkey value, such as 0xFF0000 for red
colorkey off: ./alpha_test colorkey_off
global alpha: ./alpha_test alpha_global <alpha value> //alpha value, such as 0x80
local alpha: ./alpha_test alpha_local //alpha effect is accordant with alpha buffer set in step 2
alpha in pixel: ./alpha_test alpha_pixel //alpha effect is accordant with alpha value in pixel set in step 2
alpha off: ./alpha_test alpha_off
Original Attachment has been moved to: fb_setup.zip
Original Attachment has been moved to: alpha_test.zip
I do some testing on the " buffer and alpha value in alpha buffer" feature. There is a strange behavior, it look like the content of the buffer is not a ALPHA coefficent, when we set all the content of the Alpha buffer to 0xff, it look like the background is merged with a blue color, when the alpha value is set to a value near of 0, I saw my backgorund, but it look like the background is modulated with a yellow color????
I also try the local alpha (alpha included in the frame buffer buffer image) everything work properly on this way.
Thanks for the source code. But this example is not using the IPU device /dev/mxc_ipu.
Can you please provide an example that uses the IPU overlay feature?
I need to do scaling and overlaying at the same time.
Yes, I've seen the example. when I enabled the overlay by setting overlay_en=1 in ipudev_config_file it doesn't work!
The IPU_CHECK_TASK returns IPU_CHECK_ERR_OV_OUT_NO_FIT !
In my application I need to control the BG and FG dimensions independently. For example I need to display video form 4 different cameras to the same screen at the same time each will be displayed in a separate window. In this situation the FG GUI dimensions shouldn't change.