How to enable Overlay features in Android

by waterblood » Thu, 19 Mar 2009 05:52:45 GMT

Sponsored Links
 Hi All,

   Below is my understanding about how to enable the Overlay in a new
hardware platform. Correct me if I am wrong.

1.  Implement the stub funtions in hardware\libhardware\modules\overlay
\overlay.cpp, this will generate a share library

2. In SurfaceFlinger, it will create a DisplayHardware instance, and
call DisplayHardware::init() which will create an overlay engine from

3. When we want a OverlayRef from ISurface, we call
ISurface::createOverlay() which will take use of the overlay engine
creat in step 2.

4. Create a Overlay from OverlayRef as it in frameworks\base\libs

    sp<OverlayRef> ref = isurface->createOverlay(320, 240,
    sp<Overlay> overlay = new Overlay(ref);

     * here we can use the overlay API

    overlay_buffer_t buffer;
    printf("buffer = %p\n", buffer);

    void* address = overlay->getBufferAddress(buffer);
    printf("address = %p\n", address);


My questions are:
a. In step 4, as we want paint something in the overlay, should we
just put the image data to the buffer return by  overlay->dequeueBuffer
(), and call queueBuffer() to show the buffer?

b. I dont see any update in android_surface_output to take use of
overlay interface, will it be updated to use overlay interface if
overlay is exit in the hardware? I suggest the surface output may try
to create OverlayRef from surface interface, if it fail, surface
output take the display mechanism as before(post buffer), otherwise it
use this overlay to display video frame.

Guoyin Chen

How to enable Overlay features in Android

by AJAY » Tue, 24 Mar 2009 04:33:45 GMT

 You are correct. The current android_surface_output.cpp doesnt have
any Overlay implementation . However you can check the TI
implementation at omap-zoom site

Here is the link : ;a=tree;f=libopencorehw;h=4b843e240897931c150f1a0cb25b1785c9e8dab2;hb=HEAD



Sponsored Links

How to enable Overlay features in Android

by Jill.Zhou » Wed, 29 Apr 2009 02:15:33 GMT

 Hi, Ajay

But how to set position of overlay with current overlay interface.



Other Threads

1. Online order now open for business

Hit it 

Have a pre droid order ;)

Sent by Google & INDOSAT
~Orang Sabar Layarnya LEBAR~

"Indonesian Android Community [id-android]" 

2. Is there a way to call Android Scripting Environment from Java Code

I am trying to implement a Java Interface with key functionality
provided by a script read in at run time -
Android Scripting Environment  would be great if there were a way to
create an Interpreter and pass it text to eval

ASE looks great but I see no samples of how to call it from Java code


3. Ask: Provider GSM utk Android.

4. Berhasil

5. ToggleButton image

6. Hide address bar while launching native browser

7. Is the and javax security available