views:

151

answers:

6

Assuming that I have to copy each image on the stream (I cannnot simply access that data with any mutex protection, it must be copied anyway), which method is better, pros/cons?

I would like to know also how much performance loss this implied compared to using the images in the same process.

Thanks

+2  A: 

For images, IPC through shared memory would be the best option.

vartec
+1  A: 

At least Windows' firewalls can interfere even with local TCP/IP connections. Therefore I would prefer shared memory.

Joonas Pulakka
+1  A: 

In term of performance, IPC through shared memory is the best option but IMHO, even if sockets consume a little more processing, they will give you a better result in term of evolutivity of your software.

frederic.jecker
Evolutivity ftw!
unwind
what is ftw? (I can imagine F*ck The Word, but I'm not native english...)
alvatar
(haha, ftw = "for the win")
rascher
I'm ashamed! :| Thanks! :)
alvatar
+1  A: 

Google "Memory Mapped Files"

I'm reading about it, but I can't figure out how well does the I/O of a memory mapped file perform, compared to IPC.
alvatar
Memory-mapped IO *is* a form of IPC.
rascher
+1  A: 

This might shed some light on different IPC methods: http://www.ecst.csuchico.edu/~beej/guide/ipc/

rascher
+1  A: 

I would take the VCAM example of a DirectShow capture device (available at: http://tmhare.mvps.org/downloads/vcam.zip)

This driver appears to the O/S as a video capture device and would run in the destination process. The source would use shared memory buffers to feed it frames to inject.

While more complicated than a minimal shared-memory IPC scheme, it gives an incredible advantage in that your video pipes can connect to most media player programs, capture and editing tools, etc.

I have done this several times, including features like sinks, mixers, Freeframe effect plugins, and so on. It should take a day or two to hack together.

Jamie Fenton
Do you know any multiplatform solution similar to this? Thanks!
alvatar