[vbox-dev] IFramebuffer - requestResize vram question
howard0su at gmail.com
Tue May 1 22:57:32 PDT 2012
On Fri, Apr 27, 2012 at 9:12 PM, Ivo Smits <Ivo at ufo-net.nl> wrote:
> Op 27-4-2012 14:48, Klaus Espenlaub schreef:
> > On 27.04.2012 08:56, Jaikumar G wrote:
> >> On Thu, Apr 26, 2012 at 10:48 PM, Klaus Espenlaub
> >> <klaus.espenlaub at oracle.com<mailto:klaus.espenlaub at oracle.com>> wrote:
> >> On 27.04.2012 02<tel:27.04.2012%2002>:43, Jaikumar G wrote:
> >> > Is my understanding of the API incorrect ? If I want to have
> >> display
> >> > in another process - can I access the vram pointer directly -
> >> instead of
> >> > creating a shared buffer and passing it in the IFramebuffer
> >> implementation ?
> >> This interface method isn't directly intended for using shared
> >> (but it might work if the VM frontend knows how to handle it), and
> >> can only be used by the VM frontend itself, as pointers make no
> >> across processes.
> >> So whats the recommended way of sharing the display buffer if the
> >> frontend is running in another process ?
> > There is no recommended way so far - we didn't have the need for moving
> > the display buffer into another process, and others didn't need it
> > either. Heard of several people who rolled their own VM frontend (some
> > even in VisualBasic), keeping the display buffer local. It's the most
> > efficient solution, as it keeps the screen updates (which need a very
> > high bandwidth with a low latency to give a good interactive
> > performance) withing the process.
> > If you really want to go there you're the pioneer.
> No, he's not. I have an IFramebuffer implementation that uses shared
> memory (a sufficiently large memory mapped file, on Windows) and passes
> this pointer to VirtualBox as the framebuffer address. The shared memory
> is then displayed/read in another process (update/resize events are
> passed using the standard input/output pipes). This works quite well. A
> funny side effect is that you can actually read the file as a (raw
> bitmap) image file.
> One important thing: memory pointers are in the context of the process.
> If you want to share memory between processes, you will somehow have to
> obtain a pointer to the actual region in memory, in both processes. A
> common and convenient way to do so is by mapping a file into memory, in
> both processes.
> vbox-dev mailing list
> vbox-dev at virtualbox.org
I experienced cross-process sharing a framebuffer. I used a Linux(Unix) SHM
to share the memory. as far as you handle the update carefully, like using
a semaphore to sync between processes, it works well.
Have to mention, my experiment is using VRDP interface instead of
IFramebuffer. But i believe it should be same, since VRDP expose
framebuffer's pointer anyhow.
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the vbox-dev