It's not a biggie.
You do a CreateSurface with DSCAPS_SHARED, and then the pointer that you
get is sharable among all running DirectFB processes, i.e. the exact
same address is mapped at the same location for all processes.
The catch is how to pass this pointer; DirectFB passes info
continuously, but these interfaces are not exposed in the DirectFB API.
You can either dig a bit and use e.g. fusion_arena_add_shared_field(
dfb_core_arena(NULL), "some name", pointer ) from arena.h (and the
corresponding get function), or use some standard linux methods like SETENV.
If you do not like a pointer you can also do CreateWindow and
window::GetID, and use this ID in your other process to do GetWindow and
window::GetSurface. Just make sure you do not show the window, it's off
by default.
hth
Niels
Robert Hildinger wrote:
In regards to DirectFB version 1.3.0...
I know that you can create surfaces using the DSCAPS_SHARED capability
flag to allocate the surface memory in the shared memory pool. What I
don’t know is how to access that shared surface memory from another
process. Is it possible for a use process to access the surface memory
of a shared surface in another user process?
The scenario that I currently face is that I have one user level
process “A” that needs to create a huge offscreen surface, and then
another process “B” that needs to take that surface data and perform
animation effects on it before copying it to a display window. Right
now I am using a Linux shared memory buffer to act as a conduit
between the two processes, but that’s a really inefficient way of
doing things. What I would like is for process “A” to be able to write
freely to it’s shared surface, and for process “B” to be able to read
freely from the same surface. Any pointers on how to accomplish this?
I’m probably missing something completely obvious...
Thanks,
-Robert Hildinger
------------------------------------------------------------------------
_______________________________________________
directfb-dev mailing list
directfb-dev@directfb.org
http://mail.directfb.org/cgi-bin/mailman/listinfo/directfb-dev
--
.------------------------------------------.
| DirectFB - Hardware accelerated graphics |
| http://www.directfb.org/ |
"------------------------------------------"
_______________________________________________
directfb-dev mailing list
directfb-dev@directfb.org
http://mail.directfb.org/cgi-bin/mailman/listinfo/directfb-dev