pipewire/spa/plugins
Barnabás Pőcze 8614fc45f8 spa: libcamera: manager: keep libcamera::CameraManager
At the moment, the camera manager shared pointer is released when the last
listener is removed, and recreated when the first listener is added. This
is the same behaviour that the alsa and v4l2 monitors implement with their
respective udev, inotify monitors.

However, for `libcamera::CameraManager`, this is likely not the best way
for multiple reasons:

  (a) it is a complex object with significant construction and starting cost,
      which includes starting threads and usually loading shared libraries;
  (b) usually one listener is added right after creating, and it is removed
      right before destruction, in which there are real no advantages;
  (c) the camera manager, being a shared resource, might very well be kept
      alive by some other component, in which case there is again not much
      real benefit.

So simplify the code by getting a camera manager reference at the beginning
and keeping it until the libcamera monitor is destroyed.

This also fixes a race condition where a hot-plugged camera might not have
been detected if the libcamera event was emitted between these two:

  collect_existing_devices(impl);
  start_monitor(impl);
2025-08-01 15:54:10 +00:00
..
aec spa: aec: webrtc: Expose echo canceller mobile_mode 2025-07-09 13:02:18 -04:00
alsa spa: don't free the mix_list ports 2025-07-31 10:20:59 +02:00
audioconvert resample: keep fractional part of in_rate when interpolating 2025-07-30 07:59:52 +00:00
audiomixer spa: don't free the mix_list ports 2025-07-31 10:20:59 +02:00
audiotestsrc spa: use safe IO_Control parsing 2025-07-31 11:23:30 +02:00
avb *: don't include standard C headers inside of extern "C" 2025-05-30 09:48:28 +01:00
bluez5 bluez5: use BT_PKT_SEQNUM for ISO packet sequence numbers 2025-08-01 15:39:45 +00:00
control spa: don't free the mix_list ports 2025-07-31 10:20:59 +02:00
ffmpeg spa: use log topics everywhere 2024-03-11 18:45:21 +02:00
filter-graph filter-graph: fix index off by one in dsp_delay_c 2025-07-22 15:44:08 +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: keep libcamera::CameraManager 2025-08-01 15:54:10 +00:00
support node-driver: Make sure the discont clock flag does not remain set forever 2025-07-18 10:52:13 +02:00
test spa: make the wave, pattern and ditherType Int 2025-06-13 10:06:09 +02:00
v4l2 spa: use safe IO_Control parsing 2025-07-31 11:23:30 +02:00
videoconvert pod: check that choices are not empty 2025-07-15 10:13:18 +02: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