Importing Read-Only FD from Pipewire to compositor fails
Submitted by Nicolas Dufresne
Assigned to Nicolas Dufresne
As of current implementation, libwayland-server will always mmap RW the passed FD. As I was doing yet another round of maintaince to GStreamer waylandsink, I wanted to test passing FD from the new media server Pipewire (as shipped in Fedora 27) to Weston. I quickly found out that it failed because the libwayland-server tries to map Rread/Write these FD (see shm_create_pool()).
For the context, one of the reason Pipewire exists is to multi-plex camera output to multiple clients. The server is a real time process and cannot afford copying the buffer for every client, hence the FD being read/only. We need a way to pass this information to the compositor so it knows what this SHM "pool" can or cannot be used for.