fix: load libudev and libdbus at runtime instead of linking them - #271
Merged
devopvoid merged 3 commits intoSep 7, 2026
Merged
Conversation
The Linux natives linked libudev, so they failed to load on any host without it, although only the V4L2 device manager uses it. The manager now opens libudev.so.1 on construction and binds the symbols it needs, the same way the PulseAudio device manager handles libpulse. A host without libudev gets an exception when it enumerates cameras instead of a load failure.
Only the Linux power management uses libdbus, to ask the screen saver not to start during desktop capture. It now opens libdbus-1.so.3 on first use and binds the symbols it needs. A host without libdbus logs a warning and skips the inhibition instead of failing to load the natives. The dbus headers are still required at build time.
The test runners no longer install the two libraries, so the lanes verify that the natives load without them.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
After #267,
libudevandlibdbuswere the last libraries the Linux natives linked for this library's own code, so they still failed to load on any host without them, although only the V4L2 device manager uses libudev and only the power management uses libdbus. Both now open their library on first use and bind the symbols they need, the same way the PulseAudio device manager handles libpulse. A host without libudev gets an exception when it enumerates cameras, and a host without libdbus logs a warning and skips the screen saver inhibition. Every remaining link-time dependency of the Linux natives now comes from libwebrtc's desktop capturers. The test runners no longer install the two packages, so the lanes verify the natives load without them.