Repository navigation
obs-webrtc: OS name for the WHIP User-Agent behind whip-host.h (#861) - #1257
Merged
Merged
Conversation
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.
Closes #861.
What moved
generate_user_agent()inplugins/obs-webrtc/whip-utils.hhad an#ifdef _WIN64 / __APPLE__ / __OpenBSD__ / __FreeBSD__ / __linux__ && __LP64__chain that definedOS_NAME. Now it callswhip_host_os_name(), which is declared in the new conditional-freewhip-host.h. The pattern is the same as #1248:whip-host-windows.cpp.hpp:sizeof(void *) == 8 ? "Windows x86_64" : "Linux". 32-bit Windows keeps today's fallthrough to "Linux", and a comment says so.whip-host-macos.cpp.hpp:"Mac OS X".whip-host-posix.cpp.hpp: readsuname()sysname. It returns"OpenBSD"or"FreeBSD"for those systems, and otherwisesizeof(void *) == 8 ? "Linux x86_64" : "Linux", which matches the old__linux__ && __LP64__.build/obs-webrtc.{windows,macos,posix}+.hpp.cpp,build/obs-webrtc-<os>.pch.hpp).CMakeLists.txtpicks the group with$<PLATFORM_ID:...>. The host files are C++ so that every group in the plugin uses the same language.Baseline delta
I regenerated it with
ci/platform_ifdef_ratchet.py --update. One entry is removed:plugins/obs-webrtc/whip-utils.h: 5. No entries were added.Tests
There is a new cmocka test,
test/cmocka/test_whip_host_os_name.cpp, registered intests.d. It builds the posix host on its own. It asserts that on Linux the host returns exactly "Linux x86_64" (64-bit), and that the string matches theunamefamily.rust/tools/linux-validate/run.sh --repeat 1 --tests test_whip_host_os_nameshowstest_whip_host_os_name ***Failed(both cases), 1 failure out of 280../lintpasses (rc=0).The Windows and macOS hosts have not been compiled locally; PR CI is the first build of them.
ci/ci_scope.py origin/masteron this branch givesmacos=true windows=true tier2=true linux_targets=obs-webrtc.