Hi, I would appreciate someone could provide some hints on this.
Warm Regards, Anil On Wed, Sep 29, 2010 at 10:32 AM, Anil Sasidharan <anil...@gmail.com> wrote: > Hi Deva, > > For one of our ongoing projects, I've been trying to get alpha > blending work in Android on OMAP3EVM. For this we have implemented a simple > Activity in Android that plays a video (on the video1 plane) and displays an > image on the GFX plane. The image is rendered using drawable with some > specific alpha value (to control transparency) . When this app is tested on > the emulator as well as G1 phone (running Android Eclair), we were to see > the expected output (video is viewable through transparent image). > > However while testing the same app on OMAP3EVM running Android > (Eclair), the alpha blending never works. We are not able to see the > underlying video plane at all (only the image gets displayed). Based on the > discussion on this thread, I've looked at the liboverlay implementation in > "hardware/ti/omap3/" folder. Apparently by default, LOCAL_ALPHA is disabled > and the GLOBAL_ALPHA value is set to 255 (opaque ??). I've modified the code > to enable LOCAL_ALPHA as well as GLOBAL_ALPHA with some lesser value (100) > and executed the Android activity, but the result is the same. > > Since I was not able to do this programmatically, I've tried the > omapdss sysfs entries to manipulate alpha values. The following commands are > issued: > > echo "1" > /sys/devices/platform/omapdss/manager0/alpha_blending_enabled > echo "100" > /sys/devices/platform/omapdss/overlay0/global_alpha > > Now the applications shows transparent image and video playback underneath. > > Some quetsions based on these observations: > 1. Is the liboverlay implementation incomplete as far as "color-keying" and > "alpha-blending" are concerned? > 2. When I went through the v4l2 code for omap-vout, I do see a comment that > the "global_alpha" is always 255 and cannot be changed. Is this > understanding correct? If so "how did it work when I've set the global_alpha > value using sysfs entry? > 3. Do you any specific technical input on "how to get this working with > Android" > 4. Is local alpha tested on OMAP3530? Any clues? > > I know I'm firing a lot questions. It would be great if we could have some > discussions on these points as well. > > Warm Regards, > Anil > > > On Mon, May 10, 2010 at 4:52 PM, Deva R <r.deva...@gmail.com> wrote: > >> hi, >> >> i havent tried per fb or video device level., but should be possible.. >> >> can you check with local alpha flags, local to framebuffer and overlay >> devices? >> V4L2_FBUF_FLAG_LOCAL_ALPHA, V4L2_FBUF_FLAG_LOCAL_INV_ALPHA >> >> >> On Mon, May 10, 2010 at 12:37 PM, Svetozar Miuchin >> <svetozar.miuc...@gmail.com> wrote: >> > Yes, but what I need to do is make all of the Android's surfaces >> > beneath (and including) the video surface transparent, but leave the >> > global alpha as is for the possible player's media controls. Any >> > ideas? >> > >> > On May 6, 5:20 pm, Deva R <r.deva...@gmail.com> wrote: >> >> you can chose the transparency level by tuning alpha blend.. >> >> >> >> on enabling global alpha blending, the final ouptput pixel will be >> arrived as, >> >> output = (framebuffer pixel * alpha + video pixel * (255 - alpha)) >> / 255 >> >> >> >> you need to set this alpha field with below ioctl commands.. >> >> >> >> ret = v4l2_ioctl(fd, VIDIOC_G_FMT, &fmt); >> >> fmt.fmt.win.global_alpha = alpha & 0xFF; >> >> ret = v4l2_overlay_ioctl(fd, VIDIOC_S_FMT, &fmt); >> >> >> >> you can check complete source in our tree - >> http://git.omapzoom.org/?p=platform/hardware/ti/omap3.git;a=blob;f=li... >> >> >> >> On Thu, May 6, 2010 at 7:55 PM, Svetozar Miuchin >> >> >> >> >> >> >> >> <svetozar.miuc...@gmail.com> wrote: >> >> > You mean setting the global alpha to fully transparent? If so, I've >> >> > thought about that, but that destroys the possibility of having on- >> >> > screen media controls.. Right? >> >> >> >> > On May 6, 4:18 pm, Deva R <r.deva...@gmail.com> wrote: >> >> >> You can enable alpha blending in your display driver, so both >> graphics >> >> >> and video overlay blend.. >> >> >> >> >> my call sequence for this are like (get fb handle, toggle alpha >> >> >> blending, set the fb options) >> >> >> >> >> v4l2_ioctl(fd, VIDIOC_G_FBUF, &fbuf); >> >> >> fbuf.flags |= V4L2_FBUF_FLAG_GLOBAL_ALPHA; >> >> >> v4l2_ioctl(fd, VIDIOC_S_FBUF, &fbuf); >> >> >> >> >> more info:http://v4l2spec.bytesex.org/spec/r10595.htm-> framebuffer >> flags -> >> >> >> V4L2_FBUF_FLAG_GLOBAL_ALPHA >> >> >> >> >> On Thu, May 6, 2010 at 7:20 PM, Svetozar Miuchin >> >> >> >> >> <svetozar.miuc...@gmail.com> wrote: >> >> >> > Hi, >> >> >> > I'm porting Android to a board with hardware video decoding >> support. >> >> >> > The board hardware draws the video into a video layer beneath the >> >> >> > graphic layer. I've implemented a custom media player that passes >> the >> >> >> > calls to the hardware decoders, but I need to make Android's >> surfaces >> >> >> > transparent. Is there any way this is possible with the current >> >> >> > Android architecture? I'm using the Eclair version for MIPS >> >> >> > architectures. >> >> >> > Thanks in advance, >> >> >> > Svetozar >> >> >> >> >> > -- >> >> >> > unsubscribe: >> >> >> > android-porting+unsubscr...@googlegroups.com<android-porting%2bunsubscr...@googlegroups.com> >> >> >> > website:http://groups.google.com/group/android-porting >> >> >> >> >> -- >> >> >> unsubscribe: >> >> >> android-porting+unsubscr...@googlegroups.com<android-porting%2bunsubscr...@googlegroups.com> >> >> >> website:http://groups.google.com/group/android-porting >> >> >> >> > -- >> >> > unsubscribe: >> >> > android-porting+unsubscr...@googlegroups.com<android-porting%2bunsubscr...@googlegroups.com> >> >> > website:http://groups.google.com/group/android-porting >> >> >> >> -- >> >> unsubscribe: >> >> android-porting+unsubscr...@googlegroups.com<android-porting%2bunsubscr...@googlegroups.com> >> >> website:http://groups.google.com/group/android-porting >> > >> > -- >> > unsubscribe: >> > android-porting+unsubscr...@googlegroups.com<android-porting%2bunsubscr...@googlegroups.com> >> > website: http://groups.google.com/group/android-porting >> > >> >> -- >> unsubscribe: >> android-porting+unsubscr...@googlegroups.com<android-porting%2bunsubscr...@googlegroups.com> >> website: http://groups.google.com/group/android-porting >> > > -- unsubscribe: android-porting+unsubscr...@googlegroups.com website: http://groups.google.com/group/android-porting