gmbeard / shadow-cast

GPU accelerated screen and audio recording for Linux
GNU General Public License v2.0
39 stars 0 forks source link

feat(capture) Adds DRM capture for Wayland support #11

Closed gmbeard closed 1 year ago

gmbeard commented 1 year ago

This PR adds support for Wayland.

Wayland capture doesn't support NvFBC, so instead accesses the framebuffer via KMS/DRM.

A separate child process is spawned, which exports the framebuffer dma-buf over a unix domain socket to the parent process. The dma-buf is loaded into GPU texture memory and copied into the libav H/W context using CUDA. Exporting the dma-buf objects requires the calling process to have cap_sys_admin capabilities, so delegating this operation to a separate binary feels more appropriate.