Add procedure handler based API #431
Open
tytan652 wants to merge 1 commit from
tytan652/proc_handler_api into master
pull from: tytan652/proc_handler_api
merge into: gh-obsproject:master
gh-obsproject:master
gh-obsproject:archive/20261011T065042Z-force/pull/546
gh-obsproject:archive/20261007T214921Z-force/pull/539
gh-obsproject:archive/20260923T145539Z-rescue/blastorg/fix/source_tearing
gh-obsproject:archive/20260923T145539Z-rescue/SoprachevAK/fix/browser-premultiplied-srgb-blending
gh-obsproject:archive/20260923T145539Z-rescue/Arkkis/media-access-checkbox
gh-obsproject:archive/20260923T145539Z-rescue/WizardCM/inspect-browser-source
gh-obsproject:archive/20260923T145539Z-rescue/PatTheMav/browser-focus-fix
gh-obsproject:archive/20260923T145539Z-rescue/fauxnik/source-visibility
gh-obsproject:archive/20260923T145539Z-rescue/exeldro/browser_signal
gh-obsproject:archive/20260923T145539Z-rescue/exeldro/browser_size
gh-obsproject:archive/20260923T145539Z-rescue/tytan652/proc_handler_api
gh-obsproject:2.23.x
gh-obsproject:archive/20260923T145539Z-rescue/tt2468/fix/browser-logging
gh-obsproject:archive/20260923T145539Z-rescue/alyssais/zoom
gh-obsproject:2.22.x
gh-obsproject:hack-and-a-half
gh-obsproject:on-accelerated-paint2
gh-obsproject:archive/20260923T145539Z-rescue/cg2121/browser-defaults
gh-obsproject:test
gh-obsproject:archive/20260923T145539Z-rescue/tags/20.3.8.603
gh-obsproject:archive/20260923T145539Z-rescue/tags/20.2.28.571
gh-obsproject:archive/20260923T145539Z-rescue/tags/20.2.13.559
gh-obsproject:archive/20260923T145539Z-rescue/tags/20.2.14.563
gh-obsproject:archive/20260923T145539Z-rescue/tags/20.2.3.551
gh-obsproject:archive/20260923T145539Z-rescue/tags/19.12.17.537
gh-obsproject:archive/20260923T145539Z-rescue/tags/19.10.24.511
gh-obsproject:archive/20260923T145539Z-rescue/tags/19.10.16.502
gh-obsproject:archive/20260923T145539Z-rescue/tags/19.10.14.499
gh-obsproject:archive/20260923T145539Z-rescue/tags/19.9.21.487
gh-obsproject:archive/20260923T145539Z-rescue/tags/19.9.21.483
gh-obsproject:archive/20260923T145539Z-rescue/tags/19.9.18.466
gh-obsproject:archive/20260923T145539Z-rescue/tags/19.9.8.457
gh-obsproject:archive/20260923T145539Z-rescue/tags/19.8.19.444
gh-obsproject:archive/20260923T145539Z-rescue/tags/19.7.14.421
gh-obsproject:archive/20260923T145539Z-rescue/tags/19.7.1.416
gh-obsproject:archive/20260923T145539Z-rescue/tags/19.6.17.410
gh-obsproject:archive/20260923T145539Z-rescue/tags/19.6.7.407
gh-obsproject:archive/20260923T145539Z-rescue/tags/19.6.7.401
gh-obsproject:archive/20260923T145539Z-rescue/tags/19.5.29.397
gh-obsproject:archive/20260923T145539Z-rescue/tags/19.5.29.398
gh-obsproject:archive/20260923T145539Z-rescue/tags/19.5.27.394
gh-obsproject:archive/20260923T145539Z-rescue/tags/19.5.26.390
gh-obsproject:qt-message-pump
gh-obsproject:archive/20260923T145539Z-rescue/tags/19.4.21.384
gh-obsproject:archive/20260923T145539Z-rescue/tags/19.3.17.363
gh-obsproject:archive/20260923T145539Z-rescue/tags/19.3.13.359
gh-obsproject:archive/20260923T145539Z-rescue/tags/19.3.13.356
gh-obsproject:archive/20260923T145539Z-rescue/tags/19.3.8.351
gh-obsproject:archive/20260923T145539Z-rescue/tags/19.3.6.348
gh-obsproject:archive/20260923T145539Z-rescue/StreamElements/flush_cookies_on_exit
gh-obsproject:archive/20260923T145539Z-rescue/tags/19.3.6.346
gh-obsproject:archive/20260923T145539Z-rescue/tags/19.2.26.339
gh-obsproject:archive/20260923T145539Z-rescue/tags/19.2.18.331
gh-obsproject:archive/20260923T145539Z-rescue/tags/19.2.12.327
gh-obsproject:archive/20260923T145539Z-rescue/tags/19.2.10.323
gh-obsproject:panel-update-final
gh-obsproject:panel-update
gh-obsproject:archive/20260923T145539Z-rescue/tags/19.1.28.319
gh-obsproject:audio_support
gh-obsproject:archive/20260923T145539Z-rescue/tags/19.1.8.305
gh-obsproject:archive/20260923T145539Z-rescue/tags/19.1.6.301
gh-obsproject:archive/20260923T145539Z-rescue/tags/18.12.25.297
gh-obsproject:archive/20260923T145539Z-rescue/tags/18.8.21.183
gh-obsproject:archive/20260923T145539Z-rescue/tags/18.8.8.165
gh-obsproject:archive/20260923T145539Z-rescue/tags/18.8.2.151
gh-obsproject:archive/20260923T145539Z-rescue/tags/18.7.25.133
gh-obsproject:osx
No reviewers
Labels
Clear labels
area/accessibility
Improves accessibility of the program
area/dependency
Issue is in external library or dependency, not OBS itself
Confirmed
Crash Report
Delayed
Merging has been delayed due to an issue
Design Issue
There is an issue with incorporating this pull request's design. It may take some time to finalize.
Duplicate
Feedback required
Issue does not contain enough information or is missing the template
Good first issue
New to contributing to OBS? Start here!
kind/bug
Categorizes issue or PR as related to a bug.
kind/cleanup
Non-breaking change which makes code smaller or more readable
kind/enhancement
Enhancements are not bugs or new features but can improve usability or performance.
platform/linux
platform/macos
platform/windows
priority/high
This is an important PR
Question
Request for Comments
More feedback & discussion is requested
Seeking Other Contributors
This PR needs help from any other developers who are willing to give a crack at this code
Seeking Testers
Won't Fix / By Design
No labels
area/accessibility
area/dependency
Confirmed
Crash Report
Delayed
Design Issue
Duplicate
Feedback required
Good first issue
kind/bug
kind/cleanup
kind/enhancement
platform/linux
platform/macos
platform/windows
priority/high
Question
Request for Comments
Seeking Other Contributors
Seeking Testers
Won't Fix / By Design
Milestone
Clear milestone
No items
No milestone
Assignees
Clear assignees
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".
No due date set.
Dependencies
No dependencies set
Reference
gh-obsproject/obs-browser!431
Loading…
Reference in a new issue
No description provided.
Delete branch "tytan652/proc_handler_api"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Description
Relies on:
Adds a procedure handler that enables the use of obs-browser feature (only panels now) outside of the plugin itself without having to rely on symbols search inside the plugin file.
TODO:
Motivation and Context
Inspired by how obs-websocket did its API and by the fact that implementing an browser API in the frontend-api looks more and more like a bad idea. I made a procedure handler based API for obs-browser.
Related to the wish to split service integration from the UI as plugins, but this is not strictly bond to services.
How Has This Been Tested?
--component Developmentadds the headerTypes of changes
Checklist:
I think the approach is correct and barring some concerns regarding the name (
PhQCefWidgetis a mouthful,OBSBrowserWidgetwould be more expressive, especially if this becomes a public API).As for the API - how can we make this API available as part of
obs-frontend-apiwithout also exposingobs-browserpublicly?Because plugins need to be built out-of-tree, the browser API functions need to be available via the frontend API only, so it needs to be exposed there and needs to be compiled and linked without the browser plugin present.
This design is meant to make it unrelated to
obs-frontend-api(beside obs-browser internals using it).This API does not need/depend on the frontend API.
Got it. In that case this PR cannot supersede the PRs mentioned in the OP - the goal of at least one of those is to allow external plugins to create and manage their own browser docks.
As those plugins only link with
libobsandobs-frontend-api, such functionality would need to be made available in the latter.I still think it's worthwhile to have an API for internal use that does not require internal knowledge of the
obs-browserplugin to interact with panels, but it's not solving the use case for external plugins then.Beside the native flag issue, because of the QCefWidget in a window/dock without the native flag can go wrong.
This API can be used with the dock-related front-end API to make docks with a QCefWidget.
So with this merged, a leaner frontend API can be based on it you mean?
No need for new frontend API.
obs_frontend_add_dock_by_id("test", "Test", ph_qcef_widget.qwidget())Like I said earlier, there is an because of the missing native flag but it's inside the Frontend API that the issue should be solved.
Edit: I have made this
github.com/tytan652/obs-studio@5ef1362adain the past to fix the flag issue which rely to put a custom property in the given widget which is checked by the frontend API. This flag thing is a nightmare.How can a plugin do that without access to the
PhQCefWidgetclass? A plugin needs to be able to do that without access toobs-browser. Or is that just a string identifier and the plugin needs to throw around a void pointer?The API header (with PhCef* classes) is "public", no change in CMake was made to install it for now.
That's what I was hinting at -
obs-browseris not allowed to install headers. Onlylibobsandobs-frontend-apiare. IfPhCef*needs to be made available, it needs to happen inobs-frontend-api. No other module is allowed to expose anything to plugins.The header is not part of the obs-browser CMake module, for now it's a standalone interface.
Ah my bad - that header is not part of this PR then but would be added in an associated obs-studio PR?
lib/obs-browser-api.hppis the header, it is in the PR and the API is made with procedure handler to avoid being dependent of the module. But obs-browser needs the header to have the API version macro.The API header is now installed with other OBS Studio headers and I changed the namespace of the API classes (
Ph-->OBSBrowser).Edit: Sorry I made a typo it was "now" not "not".
Update CMake part to match https://github.com/obsproject/obs-websocket/pull/1196 CMake as Pat approved it, like I said there https://github.com/obsproject/obs-websocket/pull/1196#discussion_r1468463474.
View command line instructions
Manual merge helper
Use this merge commit message when completing the merge manually.
Checkout
From your project repository, check out a new branch and test the changes.Merge
Merge the changes and update on Forgejo.Warning: The "Autodetect manual merge" setting is not enabled for this repository, you will have to mark this pull request as manually merged afterwards.