obs-studio/plugins/linux-v4l2
Georges Basile Stavracas Neto 7a87777225 linux-v4l2: Use flatpak-spawn when inside a Flatpak sandbox
It is not possible to run host system executables like modinfo, pkexec,
and modprobe inside a Flatpak sandbox. However, Flatpak provides a way
to run command on the host system: the flatpak-spawn executable.

flatpak-spawn is a tiny helper that, when executed with the '--host'
parameter, talks to the org.freedesktop.Flatpak D-Bus interface to run
and retrieve the return value of the executable. This provides OBS Studio
a way to escape this sandbox limitation without opening large holes in
the sandbox.

Make v4l2's implementation of VirtualCam run system commands using
flatpak-spawn when inside a Flatpak sandbox. The detection of the sandbox
is done by checking the existence of the /.flatpak-info file, which is
created by Flatpak itself, and only exists inside the sandbox. If OBS
Studio is not running inside a Flatpak sandbox, run the exact same command
it used to run before this commit.

Add the permission to talk to the org.freedesktop.Flatpak D-Bus interface
to the Flatpak manifest, so we can run flatpak-spawn with the '--host'
parameter.

Notice that the same constraints apply with and without Flatpak: the host
system needs to have the v4l2loopback kernel module available for the v4l2
implementation of VirtualCam to work.
2021-04-18 17:27:33 -07:00
..
data/locale linux-v4l2: Add auto reset on timeout option 2021-01-20 16:45:05 -08:00
CMakeLists.txt linux-v4l2: Add virtual camera output 2020-10-30 02:00:14 -07:00
linux-v4l2.c linux-v4l2: Improve module detection 2021-01-25 04:14:29 -08:00
v4l2-controls.c linux-v4l2: Fix boolean and menu control types 2020-09-14 21:31:30 -07:00
v4l2-controls.h linux-v4l2: Add support for controls 2019-12-18 09:22:05 -08:00
v4l2-helpers.c linux-v4l2: Add auto reset on timeout option 2021-01-20 16:45:05 -08:00
v4l2-helpers.h linux-v4l2: Add auto reset on timeout option 2021-01-20 16:45:05 -08:00
v4l2-input.c libobs, linux-v4l2: Set thread names 2021-01-25 04:13:24 -08:00
v4l2-output.c linux-v4l2: Use flatpak-spawn when inside a Flatpak sandbox 2021-04-18 17:27:33 -07:00
v4l2-udev.c clang-format: Apply formatting 2019-06-23 23:49:10 -07:00
v4l2-udev.h linux-v4l2: Replace custom udev callbacks 2015-04-23 21:50:36 +02:00