Skip to content

RFC 45-1: Add protocol in Outputs API and check service protocol in the "UI"#5104

Closed
tytan652 wants to merge 3 commits intoobsproject:masterfrom
tytan652:rfcs_phase_1
Closed

RFC 45-1: Add protocol in Outputs API and check service protocol in the "UI"#5104
tytan652 wants to merge 3 commits intoobsproject:masterfrom
tytan652:rfcs_phase_1

Conversation

@tytan652
Copy link
Collaborator

@tytan652 tytan652 commented Aug 9, 2021

Description

This PR is about the RFC 45.

  • Add a "protocols" and "protocols_prefixes" fields in obs_output_info and add protocols to outputs meant for serv
  • 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:

  • My code has been run through clang-format.
  • I have read the contributing document.
  • My code is not on the master branch.
  • The code has been tested.
  • All commit messages are properly formatted and commits squashed where appropriate.
  • I have included updates to all appropriate documentation.

@WizardCM WizardCM added the Enhancement Improvement to existing functionality label Aug 9, 2021
@tytan652 tytan652 marked this pull request as ready for review August 9, 2021 12:26
@tytan652 tytan652 marked this pull request as draft August 9, 2021 12:30
@tytan652 tytan652 changed the title Add Protocol API basics and protocol check in rtmp-services Add protocol in Outputs API and protocol check in rtmp-services Aug 21, 2021
@tytan652
Copy link
Collaborator Author

tytan652 commented Aug 21, 2021

Since I re-written the RFC 45, this PR needed also a rewrite. So rewrite done, only the doc addition is missing.

@tytan652 tytan652 force-pushed the rfcs_phase_1 branch 5 times, most recently from 9ae4dec to dc60332 Compare September 25, 2021 12:37
@tytan652 tytan652 force-pushed the rfcs_phase_1 branch 5 times, most recently from 83dd342 to d375551 Compare October 27, 2021 16:30
@tytan652 tytan652 changed the title Add protocol in Outputs API and protocol check in rtmp-services RFC 45: Add protocol in Outputs API and protocol check in rtmp-services Oct 27, 2021
@tytan652 tytan652 changed the title RFC 45: Add protocol in Outputs API and protocol check in rtmp-services RFC 45 part 1: Add protocol in Outputs API and protocol check in rtmp-services Oct 27, 2021
@tytan652 tytan652 changed the title RFC 45 part 1: Add protocol in Outputs API and protocol check in rtmp-services RFC 45 : Add protocol in Outputs API and protocol check in rtmp-services Oct 29, 2021
@tytan652 tytan652 changed the title RFC 45 : Add protocol in Outputs API and protocol check in rtmp-services RFC 45, PR N°1: Add protocol in Outputs API and protocol check in rtmp-services Oct 29, 2021
@tytan652 tytan652 force-pushed the rfcs_phase_1 branch 3 times, most recently from b49ae81 to f7e1611 Compare October 30, 2021 13:27
@tytan652 tytan652 marked this pull request as ready for review October 30, 2021 17:45
@tytan652 tytan652 force-pushed the rfcs_phase_1 branch 2 times, most recently from 382aeff to 99a625c Compare July 20, 2022 18:23
@tytan652 tytan652 force-pushed the rfcs_phase_1 branch 2 times, most recently from 1ecf4a9 to 2c69776 Compare August 8, 2022 08:32
@tytan652 tytan652 changed the title RFC 45: Add protocol in Outputs API and check service protocol in the UI RFC 45: Add protocol in Outputs API and check service protocol in the "UI" Aug 17, 2022
@tytan652 tytan652 force-pushed the rfcs_phase_1 branch 2 times, most recently from 877a7ea to 4a38200 Compare August 17, 2022 15:51
Copy link
Member

@pkviet pkviet left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just read quickly the pr. Haven't tested it. I just have these comments.

@tytan652 tytan652 force-pushed the rfcs_phase_1 branch 2 times, most recently from e1fc5c1 to d99e585 Compare August 19, 2022 12:45
@tytan652 tytan652 marked this pull request as ready for review September 5, 2022 10:38
@tytan652
Copy link
Collaborator Author

tytan652 commented Sep 13, 2022

Rebase and fix memory leaks by using bstrdup() and return a char * rather than a const char * for obs_output_get_prefix_protocol().

@tytan652
Copy link
Collaborator Author

tytan652 commented Oct 7, 2022

Removed useless !! in if ().

@tytan652
Copy link
Collaborator Author

tytan652 commented Jan 27, 2023

Add missing changes in the JSON Schema.

I moved an element by accident I will push to remove this changes soon.

@tytan652
Copy link
Collaborator Author

Improved obs_register_output_s changes (stop using simple NULL checks).

@tytan652
Copy link
Collaborator Author

tytan652 commented Mar 11, 2023

Remove prefix related changes as it was done in the RFC.

@tytan652
Copy link
Collaborator Author

tytan652 commented Mar 13, 2023

No longer enforce the "protocol" field in the JSON if the server URL is a RTMP(S) one.

.id = "ffmpeg_hls_muxer",
.flags = OBS_OUTPUT_AV | OBS_OUTPUT_ENCODED | OBS_OUTPUT_MULTI_TRACK |
OBS_OUTPUT_SERVICE,
.protocols = "HLS",
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

As described in voice discussions, I personally believe that using uppercase for these values does not align with common lowercase OBS implementations like the .encoded_video_codecs field. While I understand the desire to use the strings from this value directly in the UI, I personally believe that it would be better to uppercase convert these values in the UI and use a hash table if we someday get a protocol which has mixed case.

As of this comment, I'm not aware of any protocols which we officially support which use mixed case: RTMP, RTMPS, SRT, RIST, FTL, HLS, WHIP

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I personally believe that using uppercase for these values does not align with common lowercase OBS implementations like the .encoded_video_codecs field.

If you check #8090, you will see that the whole lowercase/uppercase situation on codecs is not aligned.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I was drawing a parallel to codecs in regards to them being all lowercase, even though when presented to the user they are given in their correctly-capitalized form. I was not using it as an example of the uppercase-convert suggestion.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

even though when presented to the user they are given in their correctly-capitalized form

Technically we don't, we expose to the user encoders names or presets names.

If the server URL is not an RTMP(S) URL, the protocol field becomes
required.

The output field becomes required on non-RTMP(S) services to keep
backward compatibility.

Also skip service if the protocol is not available.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Enhancement Improvement to existing functionality

Projects

None yet

Development

Successfully merging this pull request may close these issues.

8 participants