Thanks for the response. I'm still interested in using a surface between two processes, A and B. specifically, A is a Dalvik Java application (an Activity with a View), and B is a native process.
I'd like to be able to manipulate A's display from B, but can't seem to get it right: As I mentioned, it works fine in the emulator, but fails on the device. Currently, I'm looking into the way CameraService does a similar thing - It seems to use ISurface in order to registerBuffers(). Is this the correct approach? Am I going wrong about it? Any help would be most appreciated Thanks, Mick Halsband On May 26, 3:13 am, Dianne Hackborn <[email protected]> wrote: > This isn't really supported -- with a SurfaceView, the creator/manager of > the surface is the window manager, and the app is the one drawing into the > surface. When you hand that surface to another process, you end up with two > drawing clients, which may or may not work as luck may have it, but is not > something that we will guarantee to work at this point and so is best > avoided. > > Fwiw, processes in the emulator are not fake, it is emulating a real device > with a real linux kernel with real processes. For purposes here, the big > difference between them is that the emulator doesn't have any graphics > hardware acceleration so all drawing is done in software, while the G1 does > have an accelerator. This may be what is causing the difference, though I > don't know enough about this area of the system to say. > > > > On Mon, May 25, 2009 at 1:54 AM, Mick <[email protected]> wrote: > > > Hello everyone, > > > I'm researching into the Android graphics and am having problems with > > the following scenario: > > 1. In process A I inherit /SurfaceView/, implement / > > SurfaceHolder.Callback/ and override its surfaceCreated() method. > > 2. Meanwhile I have another process B registering as a binder service > > 3. When /surfaceCreated(SurfaceHolder holder)/ gets called I extract > > the surface from the SurfaceHolder, and pass it to the binder service, > > in the remote process. > > 4. I read the process using /surface->readFromParcel()/ > > > At this point, *in the emulator*, the surface I get in process B is > > valid, and I manage to write to the screen just fine. > > However, when running this on the device I still get that /surface- > > >isValid() == true/, but cannot get a /surface->lock()/. Instead, when > > attempting to lock(), Iogcat/ddms shows a "cannot map BpMemoryHeap" > > error with EINVAL, and some fd value. > > > I'm guessing that somehow an fd mapped by the surface's heap is > > invalidated when passing the surface via binder, > > and that this somehow works in the emulator, since it works with > > threads, and not real processes. > > > Any help would be most appreciated > > Thanks, > > Mick Halsband > > -- > Dianne Hackborn > Android framework engineer > [email protected] > > Note: please don't send private questions to me, as I don't have time to > provide private support, and so won't reply to such e-mails. All such > questions should be posted on public forums, where I and others can see and > answer them. --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Android Developers" group. To post to this group, send email to [email protected] To unsubscribe from this group, send email to [email protected] For more options, visit this group at http://groups.google.com/group/android-developers?hl=en -~----------~----~----~----~------~----~------~--~---

