This replaces the manual check for "true" and some (inconsistent) return value
of atoi. All those instances now require either "true" or "1" to parse as
true, any other value (including NULL) is boolean false.
Easier to use than strcmp() since their return value matches expectations. And
they do what is expected with NULL strings, two NULL pointers are equal, one
NULL pointer is not equal.
udev's ID_MODEL_ID and ID_VENDOR_ID are inconsistent: always 4-digit hex but
sound devices are prefixed with 0x, v4l devices are not. Depending on the
actual ID, the value will look like decimal (1234) or hex (a234).
pw-dump will then print those as either decimal integers (i.e. 0x1234 becomes
decimal 1234) or double (i.e. a234 becomes 41524.00).
Make this consistent by converting the string from hex do decimal where we
get it.
Most of the time when we convert a string to an integer we only care about
success. Let's wrap this with a helper function that sets the value to the
result and returns true on success.
Install the config file in $PREFIX/share/pipewire so that a factory
reset can be done by wiping /etc and /home.
Add this new directory to the search path.
System wide config can still be done in /etc, user config in
$HOME/.config/pipewire/ by copying files from $PREFIX/share/pipewire
Fixes#1191
Make a signal in media-session to signal dbus disconnect.
Get the DBusConnection when we need it in alsa and access-portal.
Remove device reservation if dbus disconnects and try again later
when needed.
See #1099
This way we can reset the dbus connection when we got a disconnect
and signal the event. This can then be used by the client to
do a new connection_get().
Handle the error from rd_device_reserve and when something is wrong,
disable device reservation and pretend we got the device.
This should work around the problem of the dbus connection being
closed and the device reservation callback never being called.
See #1099
av_codec_next() was deprecated on 2018-02-06,
in lavc 58.10.100 (36c85d6e77). It was then later
removed on 2021-04-27 (4b2be3f8d). `av_codec_iterate()`
was added in lavc 58.10.100, so use that when available.
Fixes#1138.
`av_register_all()` is the only thing used from libavformat,
but that doesn't seem to be needed for codec enumeration,
so remove it, and call `avcodec_register_all()` instead
when libavcodec < 58.10.100.
ffmpeg.c had 'Spa V4l2 Support' in it, fix that to say
FFmpeg. Furthermore, change 'FFMpeg' to 'FFmpeg' in
ffmpeg-{enc,dec}.c as that is how it's referred to
in official texts.
Make the config parser return the amount of parsed items.
Fail to create a context when parsing the config fails.
Log the number of items parsed from the config.