RFC 45-1: Add protocol in Outputs API and check service protocol in the "UI"
Description
This PR is about the RFC 45.
- Add a "protocols" and "protocols_prefixes" fields in
obs_output_infoand add protocols to outputs meant for services. - Add the function
obs_output_get_prefix_protocolwhich return a protocol if the URL prefix is known. - Make the UI skip services where the protocol is not registered and also skip RTMPS servers for service providing RTMP and RTMPS server when the later is not registered.
Motivation and Context
Part of the implementation of the RFC 45.
How Has This Been Tested?
Artifacts from Github actions will not much help with testing this PR since it build with all protocol support.
- Build OBS without FTL support and check if "Glimesh" service is not shown.
- Build OBS without RTMPS support and check if "YouTube - RTMPS" RTMPS servers, "Facebook Live" service and "STAGE TEN" are not shown, RTMPS servers from other services are also not shown.
- Build OBS with support for both and check those three services are shown.
Types of changes
- Bug fix (non-breaking change which fixes an issue)
- Showing services that are not supported is sort of a bug
- New feature (non-breaking change which adds functionality)
- Documentation (a change to documentation pages)
Checklist:
- [x] My code has been run through clang-format.
- [x] I have read the contributing document.
- [x] My code is not on the master branch.
- [x] The code has been tested.
- [x] All commit messages are properly formatted and commits squashed where appropriate.
- [x] I have included updates to all appropriate documentation.
Since I re-written the RFC 45, this PR needed also a rewrite. So rewrite done, ~~only the doc addition is missing~~.
Rebase and fix memory leaks by using bstrdup() and return a char * rather than a const char * for obs_output_get_prefix_protocol().
Removed useless !! in if ().
Add missing changes in the JSON Schema.
~~I moved an element by accident I will push to remove this changes soon.~~
Improved obs_register_output_s changes (stop using simple NULL checks).
Remove prefix related changes as it was done in the RFC.
No longer enforce the "protocol" field in the JSON if the server URL is a RTMP(S) one.