Skip to content
Snippets Groups Projects
Commit df71b387 authored by François-Simon Fauteux-Chapleau's avatar François-Simon Fauteux-Chapleau
Browse files

video_input: fix build issue

Some of the Linux distributions that we currently support don't have the
pidfd_getfd system call, so we need to check whether it's available
before we try to use it.

Change-Id: I5ce5c1774e33336e5c56e0cafabec6c145f6d2eb
parent 7fb5b268
No related branches found
No related tags found
No related merge requests found
......@@ -460,6 +460,7 @@ VideoInput::initLinuxGrab(const std::string& display)
pid_t pid = std::stol(display.substr(pidPos));
int fd = std::stoi(display.substr(fdPos));
if (pid != getpid()) {
#ifdef SYS_pidfd_getfd
// We can't directly use a file descriptor that was opened in a different
// process, so we try to duplicate it in the current process.
int pidfd = syscall(SYS_pidfd_open, pid, 0);
......@@ -472,6 +473,10 @@ VideoInput::initLinuxGrab(const std::string& display)
JAMI_ERROR("Can't duplicate PipeWire fd: call to pidfd_getfd failed (errno = {})", errno);
return false;
}
#else
JAMI_ERROR("Can't duplicate PipeWire fd: pidfd_getfd syscall not available");
return false;
#endif
}
p.fd = fd;
p.node = display.substr(nodePos);
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment