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. best layout for app, dynamic set of 2 rows which consist of icons and text

I am developing simple web app, It gets data from url, then parses it with
htmlcleaner + xpath. That was easy part.
Now I am trying to present data and populate my RelativeLayout with data and
icons(I store icons in local resources)

I am trying to populate my Activity with multiple sets, every set consist of
2 rows:
1st row imageview(icon) -> listview(text)->imageview(icon)
2nd row listview(text)
1st row imageview(icon) -> listview(text)->imageview(icon)
2nd row listview(text)
... and so on

the question is: am I going in the right direction? is there any
other(simpler) way to accomplish what I need?
I am also not sure whether I can or can't do it all in main.xml, main.xml
feels like describing static things to me
Thank you all.


2. graphics calculator

ada yang tau link
buat code graphics calculator
kemarin pernah liat di tapi lupa haha


3. [ASK] Upgrade Motorola Backflip Singtel ke Eclair?

4. VOOT: Gadgets di Film

5. [WTA] Mau dowload pocket legends failed

6. am profile command error "Process not debuggable"

7. Unexpected extra byte occurring in binary logcat entry stream