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

obs-frontend-api: Add event for video reset #11685

Closed
wants to merge 3 commits into from

Conversation

walker-WSH
Copy link
Contributor

@walker-WSH walker-WSH commented Dec 31, 2024

Description

If obs_reset_video is called in OBS, for 3rd plugins, they should re-create the obs_output or video_output hold in their code. Otherwise, 3rd plugins will easily crash since their video_output and obs_output::video_t have been deleted in obs_reset_video.

Motivation and Context

if a 3rd plugin hold their obs_output or video_output, crash will easily happen after below operation:

install ndi plugin
open settings of OBS, to video page
modify resolution
click OK
Tool menu of OBS, select NDI, start its output, crash
the reason can be found in DistroAV/DistroAV#1096

Except NDI plugin, I also found this kind of crash on other plugin, such as vertical-canvas, source-record.
If OBS provide this new front event, 3rd plugin has the chance to reset their obs_output or video_output.

How Has This Been Tested?

settings -> video -> modify resolution -> click OK -> check if this event can be sent

Types of changes

New feature (non-breaking change which adds functionality)

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.

For 3rd plugins, they should re-create the obs_output or video_output hold in their code.
Otherwise, 3rd plugins will easily crash after calling obs_reset_video in OBS.
@tt2468
Copy link
Member

tt2468 commented Dec 31, 2024

This should be implemented as a core OBS signal, not as a frontend event. Resets can happen outside of the frontend, in which case this event would not be fired.

For 3rd plugins, they should re-create the obs_output or video_output hold in their code.
Otherwise, 3rd plugins will easily crash after calling obs_reset_video in OBS.
@walker-WSH
Copy link
Contributor Author

hi @tt2468
I commit another PR to add new signals in libobs, please review it, thanks~
#11686

so I close this PR

@walker-WSH walker-WSH closed this Jan 1, 2025
@WizardCM WizardCM added the New Feature New feature or plugin label Jan 4, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
New Feature New feature or plugin
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants