[Bug 737316] New: Add support for sending file-descriptors over Unix domain sockets

GStreamer (bugzilla.gnome.org) bugzilla at gnome.org
Wed Sep 24 19:01:02 PDT 2014


https://bugzilla.gnome.org/show_bug.cgi?id=737316
  GStreamer | gstreamer (core) | git

           Summary: Add support for sending file-descriptors over Unix
                    domain sockets
    Classification: Platform
           Product: GStreamer
           Version: git
        OS/Version: Linux
            Status: UNCONFIRMED
          Severity: normal
          Priority: Normal
         Component: gstreamer (core)
        AssignedTo: gstreamer-bugs at lists.freedesktop.org
        ReportedBy: gnome at williammanley.net
         QAContact: gstreamer-bugs at lists.freedesktop.org
     GNOME version: ---


Created an attachment (id=287029)
 View: https://bugzilla.gnome.org/attachment.cgi?id=287029
 Review: https://bugzilla.gnome.org/review?bug=737316&attachment=287029

patch: gstreamer: Add GstUnixFDMeta

libs: Add GstUnixFdMeta for attaching file descriptors to buffers

Unix domain sockets allow passing file descriptors over them to other
processes.  They are passed as "ancillary data" and send out-of-band when
with some data written to a socket (see man cmsg).  These patches add a
new type of GstMeta which models attaching ancillary data to some data
sent across a socket as attaching a GstMeta to a buffer.

This will allow a (or many) payloader(s) to be written allowing seamless
sending of dmabuf or memfd `GstMemory`s between processes.  I've got a
work-in-progress one which uses (unlinked) files on a tmpfs as the backing
memory.  It essentially operates as a more reliable version of shmsrc/
shmsink (although with similar trust issues).  The goal is that in the
future you could also write payloaders/allocators targeting memfds and
new FD-capable sinks using DBus signals or kdbus as a transport.

These patches are not ready to go in but I'm publishing them here in the
hope of starting a conversation about this topic.  My personal motivation
is that I want to be able to write a system service that will distribute
the video captured from a video capture device to different containers
running on the same machine, but I know @wtay and David King are
interested in solving some of the similar kinds of problems for the
desktop, light-heartedly referred to as "PulseVideo".

This implementation patches gstreamer-core because that's where fdsrc and
fdsink live.  I also have a patch to gst-plugins-base adding support to 
multisocketsink.  I chose this route, rather than writing specific src/
sink elements for fd-passing as fdsrc, fdsink and multisocketsink already
know how to talk to unix domain sockets, this just allows them to make
use of one more feature that sockets provide.  The alternative would have
been to copy these elements wholesale, renaming them into gst-plugins-bad
which seemed particularly icky.  The other pleasant side-effect is that
it makes it easier to experiment with FD payloaders/depayloaders.

The next steps I'm going to make are building out my example payloader/
depayloader in gst-plugins-bad and using that with rtpvrawpay/rtpvrawdepay
for zero-copy broadcast round my PC.  This should help further prove the
concept.

-- 
Configure bugmail: https://bugzilla.gnome.org/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the QA contact for the bug.
You are the assignee for the bug.


More information about the gstreamer-bugs mailing list