bazukas/obs-linuxbrowser

Problem building the plugin

lebarjack opened this issue · 8 comments

Hi,
I wasn't able to build the plugin.
Here are the build log for CEF & the plugin.
obs-linuxbrowser-build-output.log

In file included from /home/lebarjack/Projects/obs-linuxbrowser/src/browser/browser-app.cpp:29:
/home/lebarjack/Projects/obs-linuxbrowser/src/browser/browser-app.hpp:76:15: error: ‘virtual bool BrowserApp::OnProcessMessageReceived(CefRefPtr<CefBrowser>, CefProcessId, CefRefPtr<CefProcessMessage>)’ marked ‘override’, but does not override
   76 |  virtual bool OnProcessMessageReceived(CefRefPtr<CefBrowser> browser,
      |               ^~~~~~~~~~~~~~~~~~~~~~~~
/home/lebarjack/Projects/obs-linuxbrowser/src/browser/browser-app.cpp: In member function ‘virtual void BrowserApp::OnContextInitialized()’:
/home/lebarjack/Projects/obs-linuxbrowser/src/browser/browser-app.cpp:316:91: error: no matching function for call to ‘CefBrowserHost::CreateBrowserSync(CefWindowInfo&, BrowserClient*, const char [45], CefBrowserSettings&, std::nullptr_t)’
  316 |      info, client.get(), "https://github.com/bazukas/obs-linuxbrowser/", settings, nullptr);
      |                                                                                           ^
In file included from /home/lebarjack/Projects/cef_binary_78.3.9+gc7345f2+chromium-78.0.3904.108_linux64_minimal/include/../include/cef_print_handler.h:42,
                 from /home/lebarjack/Projects/cef_binary_78.3.9+gc7345f2+chromium-78.0.3904.108_linux64_minimal/include/../include/cef_browser_process_handler.h:43,
                 from /home/lebarjack/Projects/cef_binary_78.3.9+gc7345f2+chromium-78.0.3904.108_linux64_minimal/include/cef_app.h:42,
                 from /home/lebarjack/Projects/obs-linuxbrowser/src/browser/browser-app.hpp:23,
                 from /home/lebarjack/Projects/obs-linuxbrowser/src/browser/browser-app.cpp:29:
/home/lebarjack/Projects/cef_binary_78.3.9+gc7345f2+chromium-78.0.3904.108_linux64_minimal/include/../include/cef_browser.h:305:32: note: candidate: ‘static CefRefPtr<CefBrowser> CefBrowserHost::CreateBrowserSync(const CefWindowInfo&, CefRefPtr<CefClient>, const CefString&, const CefBrowserSettings&, CefRefPtr<CefDictionaryValue>, CefRefPtr<CefRequestContext>)’
  305 |   static CefRefPtr<CefBrowser> CreateBrowserSync(
      |                                ^~~~~~~~~~~~~~~~~
/home/lebarjack/Projects/cef_binary_78.3.9+gc7345f2+chromium-78.0.3904.108_linux64_minimal/include/../include/cef_browser.h:305:32: note:   candidate expects 6 arguments, 5 provided
/home/lebarjack/Projects/obs-linuxbrowser/src/browser/browser-app.cpp: In member function ‘void BrowserApp::UpdateActiveStateJS(bool)’:
/home/lebarjack/Projects/obs-linuxbrowser/src/browser/browser-app.cpp:387:17: error: ‘class CefBrowser’ has no member named ‘SendProcessMessage’
  387 |  this->browser->SendProcessMessage(PID_BROWSER, msg);
      |                 ^~~~~~~~~~~~~~~~~~
/home/lebarjack/Projects/obs-linuxbrowser/src/browser/browser-app.cpp: In member function ‘void BrowserApp::UpdateVisibilityStateJS(bool)’:
/home/lebarjack/Projects/obs-linuxbrowser/src/browser/browser-app.cpp:395:17: error: ‘class CefBrowser’ has no member named ‘SendProcessMessage’
  395 |  this->browser->SendProcessMessage(PID_BROWSER, msg);
      |                 ^~~~~~~~~~~~~~~~~~
make[2]: *** [CMakeFiles/browser_shared.dir/build.make:76: CMakeFiles/browser_shared.dir/src/browser/browser-app.cpp.o] Error 1
make[1]: *** [CMakeFiles/Makefile2:73: CMakeFiles/browser_shared.dir/all] Error 2

It seems that CreateBrowserSync::CreateBrowserSync(...) takes one more argument with recent versions of CEF.
I bisected the commit, if it can help...
https://bitbucket.org/chromiumembedded/cef/src/473c29a70dca6b89f824ca403497dc29309dacb3/libcef/browser/browser_host_impl.cc?at=master

I'll try to build with your branch to see if it works for me.
I finally had success in building the plugin against cef_binary_74.1.19+gb62bacf+chromium-74.0.3729.157_linux64_minimal on master branch.
I yet have to test it in obs, though.

I've just built successfully the plugin using cef_binary_78.3.9+gc7345f2+chromium-78.0.3904.108_linux64_minimal (latest version of CEF) and the fix-new-cef-api-108-110 branch.

The plugin seems to work ok:
I had success in showing a google page and the obs-studio homepage in two different sources.
I have no fancy overlay to push the test further, though...

Here are my logs:

info: User Removed source 'Linux Browser test2' (linuxbrowser-source) from scene 'Attente'
info: User added source 'Linux Browser test2' (linuxbrowser-source) to scene 'Attente'

It complains about ICU in your log. Is unicode correctly installed on your system?
I have this one:

[I] dev-libs/icu
     Available versions:  64.2(0/64.2) ~65.1(0/65.1) {debug doc examples static-libs ABI_MIPS="n32 n64 o32" ABI_RISCV="lp64 lp64d" ABI_S390="32 64" ABI_X86="32 64 x32"}
     Installed versions:  64.2(0/64.2)(12:09:02 PM 10/20/2019)(-debug -doc -examples -static-libs ABI_MIPS="-n32 -n64 -o32" ABI_RISCV="-lp64 -lp64d" ABI_S390="-32 -64" ABI_X86="64 -32 -x32")
     Homepage:            http://www.icu-project.org/
     Description:         International Components for Unicode

And my Qtcore depends on it.

I have ICU installed on my system as well, but the version is 65.1-2. Maybe there are some incompatibilities with more recent versions of ICU on CEF's side.

I just got it working with CEF 77.1.12, but I had to uninstall CEF after installing the files to the plugin directory to make it work. And I have no idea why that might be. Upon installing the plugin CEF's files are being copied to the plugin directory. The plugin binaries should contain no reference to the CEF files other than the position of libcef.so, which is of course exactly the same as the libcef.so in the plugin's bin directory that is being used if no CEF installation is present at runtime. Also, I just checked the libcef.so and I couln't find a reference to ICU.