pipewire/spa/plugins
Barnabás Pőcze 2c2808fab1 spa: libcamera: manager: fix id allocation
There is an issue in the id allocation mechanism which can result
in the different devices having the same id. Specifically, consider
the scenario where there are only two cameras, which have just been
added. In this case `impl::devices` looks like this:

   (0, camA) | (1, camB) | (?, nullptr) | ...

Now assume that `camA` is removed, after which the array appears
as follows:

  (1, camB) | (1, nullptr) | (?, nullptr) | ...

Then assume that a new camera appears. When `get_free_id()` runs,
when `i == 1`, it will observe that `devices[i].camera == nullptr`,
so it selects `1` as the id. Leading to the following:

  (1, camB) | (1, camC) | (?, nullptr) | ...

This is of course incorrect. The set of ids must be unique. When
wireplumber is faced with this situation it destroys the device
object for `camB` when `camC` is emitted.

Fix this by simply not moving elements in the `devices` array,
leaving everything where it is. In which case the array looks
like this:

  (nullptr) | (camB) | (nullptr) | ... // after `camA` removal
  (camC) | (camB) | (nullptr) | ... // after `camC` appearance

Note that `device::id` is removed, and the id is now derived from
the position in `impl::devices`.
2025-07-15 08:12:54 +00:00
..
aec spa: aec: webrtc: Expose echo canceller mobile_mode 2025-07-09 13:02:18 -04:00
alsa alsa-pcm: add support for api.alsa.dll-bandwidth-max 2025-07-07 10:40:11 +00:00
audioconvert *: Avoid macros that use casts where possible 2025-07-10 14:02:55 +00:00
audiomixer loop: add method to run a function with the lock 2025-05-29 10:17:16 +02:00
audiotestsrc loop: add method to run a function with the lock 2025-05-29 10:17:16 +02:00
avb *: don't include standard C headers inside of extern "C" 2025-05-30 09:48:28 +01:00
bluez5 bluez5: fix decode-buffer buffering threshold 2025-07-12 19:59:33 +00:00
control loop: add method to run a function with the lock 2025-05-29 10:17:16 +02:00
ffmpeg spa: use log topics everywhere 2024-03-11 18:45:21 +02:00
filter-graph filter-graph: don't pass NULL label around 2025-07-10 18:10:51 +02:00
jack *: don't include standard C headers inside of extern "C" 2025-05-30 09:48:28 +01:00
libcamera spa: libcamera: manager: fix id allocation 2025-07-15 08:12:54 +00:00
support loop: fix use after free case 2025-06-30 12:44:15 +02:00
test spa: make the wave, pattern and ditherType Int 2025-06-13 10:06:09 +02:00
v4l2 *: Avoid macros that use casts where possible 2025-07-10 14:02:55 +00:00
videoconvert *: Avoid macros that use casts where possible 2025-07-10 14:02:55 +00:00
videotestsrc loop: spa_loop_invoke -> spa_loop_locked where possible 2025-05-30 11:59:35 +02:00
volume spa: fix volume plugin compilation 2024-06-18 15:44:26 +02:00
vulkan spa: vulkan: map VK_INCOMPLETE to ENOSPC 2025-07-12 19:54:14 +00:00
meson.build filter-chain: move the filter-graph to plugins 2024-11-13 11:12:06 +01:00