mirror of
https://gitlab.freedesktop.org/pipewire/pipewire.git
synced 2025-10-29 05:40:27 -04:00
spa: use a separate logind dependency separate from systemd
non-systemd systems also have logind, in the form of elogind, which works to resolve the v4l2 video source race just as well. permit finding elogind, by using a separate dep object.
This commit is contained in:
parent
bdd4d3a8fc
commit
2d071d658f
4 changed files with 20 additions and 7 deletions
|
|
@ -273,6 +273,10 @@ summary({'systemd conf data': systemd.found()}, bool_yn: true)
|
||||||
summary({'libsystemd': systemd_dep.found()}, bool_yn: true)
|
summary({'libsystemd': systemd_dep.found()}, bool_yn: true)
|
||||||
cdata.set('HAVE_SYSTEMD', systemd.found() and systemd_dep.found())
|
cdata.set('HAVE_SYSTEMD', systemd.found() and systemd_dep.found())
|
||||||
|
|
||||||
|
logind_dep = dependency(get_option('logind-provider'), required: get_option('logind'))
|
||||||
|
summary({'logind': logind_dep.found()}, bool_yn: true)
|
||||||
|
cdata.set('HAVE_LOGIND', logind_dep.found())
|
||||||
|
|
||||||
selinux_dep = dependency('libselinux', required: get_option('selinux'))
|
selinux_dep = dependency('libselinux', required: get_option('selinux'))
|
||||||
summary({'libselinux': selinux_dep.found()}, bool_yn: true)
|
summary({'libselinux': selinux_dep.found()}, bool_yn: true)
|
||||||
cdata.set('HAVE_SELINUX', selinux_dep.found())
|
cdata.set('HAVE_SELINUX', selinux_dep.found())
|
||||||
|
|
|
||||||
|
|
@ -34,6 +34,15 @@ option('systemd',
|
||||||
description: 'Enable systemd integration',
|
description: 'Enable systemd integration',
|
||||||
type: 'feature',
|
type: 'feature',
|
||||||
value: 'auto')
|
value: 'auto')
|
||||||
|
option('logind',
|
||||||
|
description: 'Enable logind integration',
|
||||||
|
type: 'feature',
|
||||||
|
value: 'auto')
|
||||||
|
option('logind-provider',
|
||||||
|
description: 'Provider for logind integration',
|
||||||
|
type: 'combo',
|
||||||
|
choices: ['libelogind', 'libsystemd'],
|
||||||
|
value: 'libsystemd')
|
||||||
option('systemd-system-service',
|
option('systemd-system-service',
|
||||||
description: 'Install systemd system service file',
|
description: 'Install systemd system service file',
|
||||||
type: 'feature',
|
type: 'feature',
|
||||||
|
|
|
||||||
|
|
@ -6,8 +6,8 @@ v4l2_dependencies = [ spa_dep, libinotify_dep ]
|
||||||
if libudev_dep.found()
|
if libudev_dep.found()
|
||||||
v4l2_sources += [ 'v4l2-udev.c' ]
|
v4l2_sources += [ 'v4l2-udev.c' ]
|
||||||
v4l2_dependencies += [ libudev_dep ]
|
v4l2_dependencies += [ libudev_dep ]
|
||||||
if systemd_dep.found()
|
if logind_dep.found()
|
||||||
v4l2_dependencies += [ systemd_dep ]
|
v4l2_dependencies += [ logind_dep ]
|
||||||
endif
|
endif
|
||||||
endif
|
endif
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -27,7 +27,7 @@
|
||||||
#include "config.h"
|
#include "config.h"
|
||||||
#include "v4l2.h"
|
#include "v4l2.h"
|
||||||
|
|
||||||
#ifdef HAVE_SYSTEMD
|
#ifdef HAVE_LOGIND
|
||||||
#include <systemd/sd-login.h>
|
#include <systemd/sd-login.h>
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
|
@ -66,7 +66,7 @@ struct impl {
|
||||||
|
|
||||||
struct spa_source source;
|
struct spa_source source;
|
||||||
struct spa_source notify;
|
struct spa_source notify;
|
||||||
#ifdef HAVE_SYSTEMD
|
#ifdef HAVE_LOGIND
|
||||||
struct spa_source logind;
|
struct spa_source logind;
|
||||||
sd_login_monitor *logind_monitor;
|
sd_login_monitor *logind_monitor;
|
||||||
#endif
|
#endif
|
||||||
|
|
@ -472,7 +472,7 @@ static int start_inotify(struct impl *this)
|
||||||
{
|
{
|
||||||
int notify_fd;
|
int notify_fd;
|
||||||
|
|
||||||
#ifdef HAVE_SYSTEMD
|
#ifdef HAVE_LOGIND
|
||||||
/* Do not use inotify when using logind session monitoring */
|
/* Do not use inotify when using logind session monitoring */
|
||||||
if (this->logind_monitor)
|
if (this->logind_monitor)
|
||||||
return 0;
|
return 0;
|
||||||
|
|
@ -495,7 +495,7 @@ static int start_inotify(struct impl *this)
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
#ifdef HAVE_SYSTEMD
|
#ifdef HAVE_LOGIND
|
||||||
static void impl_on_logind_events(struct spa_source *source)
|
static void impl_on_logind_events(struct spa_source *source)
|
||||||
{
|
{
|
||||||
struct impl *this = source->data;
|
struct impl *this = source->data;
|
||||||
|
|
@ -769,7 +769,7 @@ impl_init(const struct spa_handle_factory *factory,
|
||||||
|
|
||||||
this = (struct impl *) handle;
|
this = (struct impl *) handle;
|
||||||
this->notify.fd = -1;
|
this->notify.fd = -1;
|
||||||
#ifdef HAVE_SYSTEMD
|
#ifdef HAVE_LOGIND
|
||||||
this->logind_monitor = NULL;
|
this->logind_monitor = NULL;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue