Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

libobs, plugins: Remove unnecessary output implementation calls #10652

Open
wants to merge 4 commits into
base: master
Choose a base branch
from

Conversation

tt2468
Copy link
Member

@tt2468 tt2468 commented May 8, 2024

Description

Moves the initial calling of two output methods to libobs, and deprecates them:

  • obs_output_can_begin_data_capture()
  • obs_output_initialize_encoders()

Motivation and Context

After noticing that every output does effectively the same thing regarding these two functions, I determined that they could actually be moved to libobs entirely without any change in behavior. This cleans up a good amount of code and opens the door for further refactors of the outputs code later down the line.

How Has This Been Tested?

Ubuntu 22.04

Tested with every combination of:

  • Starting/stopping stream
  • RTMP, WHIP
  • Enabling/disabling stream delay
    • Stopping both forcefully and gracefully
  • Streaming to services which deny the incoming connection, causing output failure

Types of changes

  • Code cleanup (non-breaking change which makes code smaller or more readable)
  • 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.

tt2468 added 4 commits May 7, 2024 23:12
It's not referenced anywhere, and not exported.
This performs two output start steps internal to libobs:
- `obs_output_can_begin_data_capture()`
- `obs_output_initialize_encoders()`

Both functions are implemented at the beginning of the `.start`
callback in every output except for mpegts (where this does not affect
behavior anyway).

As such, it is not useful to make outputs call these functions, so
let's just call them ourselves.

Calling these functions multiple times is safe, for outputs which
still have the old calls implemented.
Deprecates the following unnecessary functions:
- `obs_output_can_begin_data_capture()`
- `obs_output_initialize_encoders()`

Both were made unnecessary to be called externally by prior commits,
so we can now deprecate these functions.
@tt2468 tt2468 added Code Cleanup Non-breaking change which makes code smaller or more readable Documentation labels May 8, 2024
@WizardCM WizardCM added the Seeking Testers Build artifacts on CI label May 11, 2024
@Lain-B Lain-B self-assigned this May 19, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Code Cleanup Non-breaking change which makes code smaller or more readable Documentation Seeking Testers Build artifacts on CI
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants