Open tytan652 opened 6 months ago
I think the approach is correct and barring some concerns regarding the name (PhQCefWidget
is a mouthful, OBSBrowserWidget
would 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-api
without also exposing obs-browser
publicly?
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.
As for the API - how can we make this API available as part of
obs-frontend-api
without also exposingobs-browser
publicly?
This design is meant to make it unrelated to obs-frontend-api
(beside obs-browser internals using it).
…the browser API functions need to be available via the frontend API only…
This API does not need/depend on the frontend API.
As for the API - how can we make this API available as part of
obs-frontend-api
without also exposingobs-browser
publicly?This design is meant to make it unrelated to
obs-frontend-api
(beside obs-browser internal using it).…the browser API functions need to be available via the frontend API only…
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 libobs
and obs-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-browser
plugin to interact with panels, but it's not solving the use case for external plugins then.
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.
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.
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.
Beside the native flag issue. 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?
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 https://github.com/tytan652/obs-studio/commit/5ef1362ada511f6ed62e3a4aa5c6dd0b663e58f1 in 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.
So with this merged, a leaner frontend API can be based on it you mean?
No need for new frontend API.
- Plugins creates everything to have a PhQCefWidget instance
- Use
obs_frontend_add_dock_by_id("test", "Test", ph_qcef_widget.qwidget())
- A dock with browser widget is created
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.
How can a plugin do that without access to the PhQCefWidget
class? A plugin needs to be able to do that without access to obs-browser
. Or is that just a string identifier and the plugin needs to throw around a void pointer?
How can a plugin do that without access to the
PhQCefWidget
class? 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.
How can a plugin do that without access to the
PhQCefWidget
class? 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 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-browser
is not allowed to install headers. Only libobs
and obs-frontend-api
are. If PhCef*
needs to be made available, it needs to happen in obs-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.
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?
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.hpp
is 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.
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 Development
adds the headerTypes of changes
Checklist: