Anybody has the surface Flinger high level doc?

Discussion in 'Android Media' started by yige, Feb 11, 2009.

  1. yige

    yige New Member
    5

    Feb 9, 2009
    4
    0
    5
    Where can I find the surface Flinger high level doc? I only saw the code there. Without doc, it is hard to understand

    Thanks
     

    Advertisement
  2. sunita.n

    sunita.n New Member
    5

    Mar 24, 2010
    4
    0
    5
    hi
    im also looking for some high level doc/diagram for surface flinger class interactions. so wondering, if you manage to get one, can you share with me.

    anyway i started going through the code, will share my understanding soon..
     
  3. sunita.n

    sunita.n New Member
    5

    Mar 24, 2010
    4
    0
    5
    hi,

    i'm testing my overlay library, implemented to support multiple overlay instances.

    so, i'm implementing the class "Test", defined in android (/surfaceflinger/tests/overlays/overlays.cpp).

    ///////////////////////////////////CODE Begins////////////////////////

    // create a client to surfaceflinger
    sp<SurfaceComposerClient> client = new SurfaceComposerClient();

    // create pushbuffer surface
    sp<Surface> surface = client->createSurface(getpid(), 0, 320, 240,
    PIXEL_FORMAT_UNKNOWN, ISurfaceComposer::ePushBuffers);

    // get to the isurface
    sp<ISurface> isurface = Test::getISurface(surface);
    printf("isurface = %p\n", isurface.get());

    // now request an overlay
    sp<OverlayRef> ref = isurface->createOverlay(320, 240, PIXEL_FORMAT_RGB_565);
    sp<Overlay> overlay = new Overlay(ref);
    /////////////////////////////////////code ENDS///////////////////////

    till the "ISurface" creation, everything is fine.
    but when i try to create the overlay, as
    sp<OverlayRef> ovlyRef = mSurface->createOverlay(320, 240, PIXEL_FORMAT_RGB_565)

    i'm getting the NULL ovlyRef.

    further debugging revealed that, the failure is that i'm getting owner = 0.
    hence no Overlay is getting created.

    sp<OverlayRef> LayerBuffer::SurfaceLayerBuffer::createOverlay(
    uint32_t w, uint32_t h, int32_t format) {

    sp<OverlayRef> result = NULL;
    sp<LayerBuffer> owner(getOwner());
    if (owner != 0)
    result = owner->createOverlay(w, h, format);
    else
    LOGE("Sorry No OWNER");
    return result;
    }


    so my doubt is:
    (1) Can i create the Surface directly via SufaceComposer?
    (2) or should i go through the window manager / jni etc to create the surface.

    I'm not an application developer, my intention is to test my overlay library with this test case.

    Please suggest me what could have gone wrong.


    Thanks,
    sunita.
     
  4. sunita.n

    sunita.n New Member
    5

    Mar 24, 2010
    4
    0
    5
    hi,

    i'm testing my overlay library, implemented to support multiple overlay instances.

    so, i'm implementing the class "Test", defined in android (/surfaceflinger/tests/overlays/overlays.cpp).

    ///////////////////////////////////CODE Begins////////////////////////

    // create a client to surfaceflinger
    sp<SurfaceComposerClient> client = new SurfaceComposerClient();

    // create pushbuffer surface
    sp<Surface> surface = client->createSurface(getpid(), 0, 320, 240,
    PIXEL_FORMAT_UNKNOWN, ISurfaceComposer::ePushBuffers);

    // get to the isurface
    sp<ISurface> isurface = Test::getISurface(surface);
    printf("isurface = %p\n", isurface.get());

    // now request an overlay
    sp<OverlayRef> ref = isurface->createOverlay(320, 240, PIXEL_FORMAT_RGB_565);
    sp<Overlay> overlay = new Overlay(ref);
    /////////////////////////////////////code ENDS///////////////////////

    till the "ISurface" creation, everything is fine.
    but when i try to create the overlay, as
    sp<OverlayRef> ovlyRef = mSurface->createOverlay(320, 240, PIXEL_FORMAT_RGB_565)

    i'm getting the NULL ovlyRef.

    further debugging revealed that, the failure is that i'm getting owner = 0.
    hence no Overlay is getting created.

    sp<OverlayRef> LayerBuffer::SurfaceLayerBuffer::createOverlay(
    uint32_t w, uint32_t h, int32_t format) {

    sp<OverlayRef> result = NULL;
    sp<LayerBuffer> owner(getOwner());
    if (owner != 0)
    result = owner->createOverlay(w, h, format);
    else
    LOGE("Sorry No OWNER");
    return result;
    }


    so my doubt is:
    (1) Can i create the Surface directly via SufaceComposer?
    (2) or should i go through the window manager / jni etc to create the surface.

    I'm not an application developer, my intention is to test my overlay library with this test case.

    Please suggest me what could have gone wrong.


    Thanks,
    sunita.
     

Share This Page

Loading...