Remove Hard Requirement for Pulse Audio by Loading It Dynamically #229
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.
I am trying to use this library in a docker scenario for which I do not require audio or video features. This makes the hard requirement for pulse audio a bit of a pain. See #153 for example.
Disabling audio as described in the docs does not help (https://jrtc.dev/guide/audio/audio-devices#disabling-audio) still leads to a
java.lang.UnsatisfiedLinkError. This is because the static block inAudioDeviceModuleBasethat loads all nativeshttps://github.com/devopvoid/webrtc-java/blob/main/webrtc/src/main/java/dev/onvoid/webrtc/media/audio/AudioDeviceModuleBase.java#L44-L51 immediately requires pulse due to the hard link in https://github.com/devopvoid/webrtc-java/blob/main/webrtc-jni/src/main/cpp/CMakeLists.txt#L113.
This PR removes the hard link to pulse and dynamically loads all its functions. This allows use of, e.g. kDummyAudio. I fully understand this could be seen as a hacky solution, so I would be happy to work on any suggestions you might have for an alternate approach.
I also updated the actions to:
devopvoid/webrtc-javaso that the action does not fail on forks