After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 580967 - shared memory based sink and source
shared memory based sink and source
Status: RESOLVED FIXED
Product: GStreamer
Classification: Platform
Component: gst-plugins-bad
git master
Other Linux
: Normal normal
: 0.10.20
Assigned To: GStreamer Maintainers
GStreamer Maintainers
Depends on:
Blocks:
 
 
Reported: 2009-05-01 01:30 UTC by Olivier Crête
Modified: 2010-06-03 20:48 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
actual implementation of the shm sink/src (32.94 KB, patch)
2009-05-01 01:32 UTC, Olivier Crête
rejected Details | Review

Description Olivier Crête 2009-05-01 01:30:38 UTC
I've written a set of shared memory sink and source for inter-process communication between pipelines. They currently use a single shared memory segment for all communications including the caps and the actual buffer contents. Also EOS events as well as most details from the buffers are transfered. Except for the timestamp, I'm not sure how to properly transfer the timestamps, so I just made the source into a live source. Also, tags are not transfered.

I'm attaching it as a patch against gst-p-bad.
Comment 1 Olivier Crête 2009-05-01 01:32:23 UTC
Created attachment 133714 [details] [review]
actual implementation of the shm sink/src

Also, I did some testing on an OMAP3 dev board and even on that relatively slow platform, it takes very little CPU time (unlike, lets say, using gdppay->filesink->fifo->filesrc->gdpdepay).
Comment 2 Olivier Crête 2009-05-01 01:46:19 UTC
While I'm at it, a more complete version would also have multiple buffers so we can use buffer_alloc to reduce the overhead even more.
Comment 3 Sebastian Dröge (slomo) 2009-05-07 11:17:18 UTC
You should check for shmem support in configure and you could also use gst_element_class_set_details_simple() as this is more optimal :)

Apart from that, do you want to wait until you have support for multiple buffers until this can be committed or is there anything else blocking it?
Comment 4 Tim-Philipp Müller 2009-05-07 11:48:03 UTC
Haven't looked at the code, just wondering if you've considered/tried using gdp? Isn't it able to write into/read from the shared buffers directly?
Comment 5 Olivier Crête 2009-05-07 13:55:06 UTC
(In reply to comment #4)
> Haven't looked at the code, just wondering if you've considered/tried using
> gdp? Isn't it able to write into/read from the shared buffers directly?

I was under the impression that gdp is geared towards streaming, one of the problems I see with it is that the caps are sent just once. But with the current element, one could start reading at any point. But maybe it could be used (it would be useful to serialise events, etc).


(In reply to comment #3)
> Apart from that, do you want to wait until you have support for multiple
> buffers until this can be committed or is there anything else blocking it?

I'll add configure checks and add it to sys/ in gst-p-bad I guess, other improvements can come later. Although I was really careful to use only POSIX stuff, it probably wont work in win32.

Comment 6 Sebastian Dröge (slomo) 2009-07-16 19:04:37 UTC
Any news on this?
Comment 7 Olivier Crête 2009-07-16 19:10:44 UTC
not really, haven't had time to work on it
Comment 8 Olivier Crête 2009-11-03 01:18:22 UTC
Comment on attachment 133714 [details] [review]
actual implementation of the shm sink/src

I completely re-wrote the element to provide pipe-like semantics. There is also more than one buffer and the sink does pad allocation, so true inter-process zero-copy is implemented. The actual shared memory stuff has been split into separate files that have no GLib/GStreamer dependencies and can be integrated easily into other applications.
To have gdp like functionality (carrying caps and timing information), one should use gdppay/depay. 

Left to do (but possibly post-commit), is to add support for stuff like bufferlists. Also possibly use a smarter allocator for the shared memory area

The code is at:
http://git.collabora.co.uk/?p=user/tester/gst-plugins-bad.git;a=tree;f=gst/shm;hb=shm-pipe
Comment 9 Tim-Philipp Müller 2010-06-03 19:54:41 UTC
This has been committed now it seems.
Comment 10 Olivier Crête 2010-06-03 20:48:10 UTC
Oh yes it has!