devicemonitor: Only fail start() if no provider at all could be started
authorSebastian Dröge <sebastian@centricular.com>
Tue, 19 Oct 2021 10:39:55 +0000 (13:39 +0300)
committerGStreamer Marge Bot <gitlab-merge-bot@gstreamer-foundation.org>
Mon, 25 Oct 2021 10:13:27 +0000 (10:13 +0000)
commit1912bcbcc42e8ee2c4948511619219f5722631d2
treea174a94b2688fa1ea35324093e57f21fc64190da
parent139bfc8aeba9a8c2f3ddc8db1d1aad6f4fd3d7e6
devicemonitor: Only fail start() if no provider at all could be started

Also refactor various internals of the monitor code:
  - Don't allow starting twice but just return directly when starting a
    second time.
  - Don't end up in an inconsistent state if call start() a second time
    while the monitor is starting up.
  - Remove complicated cookie code: it was not possible to add/remove
    filters while the monitor was started anyway so this was only useful
    in the very small time-window while starting the monitor or while
    getting the devices. Instead disallow adding/removing filters while
    the monitor is starting, and when getting devices work on a snapshot
    of providers/filters.

Fixes https://gitlab.freedesktop.org/gstreamer/gstreamer/-/issues/667

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/1189>
subprojects/gstreamer/gst/gstdevicemonitor.c