bazukas / obs-linuxbrowser

OBS Linux Browser Plugin
GNU General Public License v2.0
506 stars 47 forks source link

Building fails with latest version of cef #33

Closed JustEnoughDucks closed 7 years ago

JustEnoughDucks commented 7 years ago

With compiling from the download instead of the source files of obs-linux browser, this is the cmake out:

CMake Error: The source directory "/home/ben/.config/obs-studio/plugins/obs-linuxbrowser" does not appear to contain CMakeLists.txt.
Specify --help for usage, or press the help button on the CMake GUI.

If I use source and cmake from the source:

-- Configuring done
-- Generating done
-- Build files have been written to: /home/ben/.config/obs-studio/plugins/obs-linuxbrowser/build

then the make command outputs:

Scanning dependencies of target obs-linuxbrowser
[  7%] Building C object CMakeFiles/obs-linuxbrowser.dir/src/plugin/main.c.o
[ 15%] Building C object CMakeFiles/obs-linuxbrowser.dir/src/plugin/manager.c.o
[ 23%] Linking C shared module build/obs-linuxbrowser/bin/64bit/libobs-linuxbrowser.so
[ 23%] Built target obs-linuxbrowser
Scanning dependencies of target browser-subprocess
[ 30%] Building CXX object CMakeFiles/browser-subprocess.dir/src/browser/base64.cpp.o
[ 38%] Building CXX object CMakeFiles/browser-subprocess.dir/src/browser/browser-app.cpp.o
/home/ben/.config/obs-studio/plugins/obs-linuxbrowser/src/browser/browser-app.cpp: In member function ‘virtual void BrowserApp::OnContextInitialized()’:
/home/ben/.config/obs-studio/plugins/obs-linuxbrowser/src/browser/browser-app.cpp:249:7: error: ‘class CefWindowInfo’ has no member named ‘transparent_painting_enabled’
  info.transparent_painting_enabled = true;
       ^
CMakeFiles/browser-subprocess.dir/build.make:86: recipe for target 'CMakeFiles/browser-subprocess.dir/src/browser/browser-app.cpp.o' failed
make[2]: *** [CMakeFiles/browser-subprocess.dir/src/browser/browser-app.cpp.o] Error 1
CMakeFiles/Makefile2:104: recipe for target 'CMakeFiles/browser-subprocess.dir/all' failed
make[1]: *** [CMakeFiles/browser-subprocess.dir/all] Error 2
Makefile:127: recipe for target 'all' failed
make: *** [all] Error 2

I'm not sure why it is failing, but it seems like a missing member in cef build 3.3112.1659

NexAdn commented 7 years ago

So you have downloaded a binary release of obs-linuxbrowser from [1] and you are wondering why CMake doesn't work? These binary releases are not meant to be compiled. Just extract the archive as mentioned in [2]. No need to compile anything or to install CEF manually.

UPDATE: I've tried building obs-linuxbrowser myself with the common build chain [3] and cef-minimal 3.071 and also with cef-standard 3.163. I get the same errors as mentioned above.

[1] https://github.com/bazukas/obs-linuxbrowser/releases [2] https://github.com/bazukas/obs-linuxbrowser#installing [3] https://github.com/bazukas/obs-linuxbrowser#building

JustEnoughDucks commented 7 years ago

I have CEF installed all fine. The instructions in this project didn't work, but the readme on the CEF release worked. The problem is then installing the obs-linuxbrowser.

The release of obs-linuxbrowser can't be build with cmake because there is no makefile nor is there a CMakeLists.txt. It is only in the binary files that the CMakeLists exists. I can't build the release version as is because there are no files to build it with if one follows the tutorial.

NexAdn commented 7 years ago

There are CMakeLists in both obs-linuxbrowser (not the binary release – there is no need to compile anything...) and CEF binary distributions as well.

JustEnoughDucks commented 7 years ago

That's the problem, I just redownloaded obs-linuxbrowser and the source code.

Contents of the release:


.:
bin  data

./bin:
64bit

./bin/64bit:
browser             icudtl.dat  libobs-linuxbrowser.so  snapshot_blob.bin
browser-subprocess  libcef.so   natives_blob.bin

./data:
cef  locale

./data/cef:
cef_100_percent.pak  cef_extensions.pak  devtools_resources.pak
cef_200_percent.pak  cef.pak             locales

./data/cef/locales:
am.pak  de.pak      fa.pak   hr.pak  lt.pak  pl.pak     sr.pak  uk.pak
ar.pak  el.pak      fil.pak  hu.pak  lv.pak  pt-BR.pak  sv.pak  vi.pak
bg.pak  en-GB.pak   fi.pak   id.pak  ml.pak  pt-PT.pak  sw.pak  zh-CN.pak
bn.pak  en-US.pak   fr.pak   it.pak  mr.pak  ro.pak     ta.pak  zh-TW.pak
ca.pak  es-419.pak  gu.pak   ja.pak  ms.pak  ru.pak     te.pak
cs.pak  es.pak      he.pak   kn.pak  nb.pak  sk.pak     th.pak
da.pak  et.pak      hi.pak   ko.pak  nl.pak  sl.pak     tr.pak

./data/locale:
de-DE.ini  en-US.ini

Contents of binaries:


.:
CMakeLists.txt  COPYING  data  img  LICENSE  README.md  src

./data:
locale

./data/locale:
de-DE.ini  en-US.ini

./img:
obs-linuxbrowser.png

./src:
browser  plugin  shared.h

./src/browser:
base64.cpp  browser-app.cpp  browser-client.cpp  browser.cpp
base64.hpp  browser-app.hpp  browser-client.hpp  browser-subprocess.cpp

./src/plugin:
main.c  manager.c  manager.h

so it is definitely not in the release version, and it definitely is in the source binary download.

bazukas commented 7 years ago

Hello @bpgerber, I'm not really sure what kind of problem you are experiencing.

Now the compile error when building against newer versions of cef needs to be fixed. I'll get to that.

But if you're just trying to install the plugin from the binary release version - you don't need to build it

NexAdn commented 7 years ago

@bpgerber The release version IS the binary version. It has no CMakeLists.txt, because it doesn't need it. I think you are a bit confused about the meaning of binary.

Binary means, that it contains compiled and linked ELF files (i.e. the libaries, programs, etc.). This in turn means that you don't have to compile anything yourself, but instead just have to extract the contents of the archive to you obs plugins directory. That's the complete opposite of a source download, where you have to compile everything yourself.

EDIT: If you want to compile the source code for a specific release, you have to download the appropriate source tarball that can be downloaded right below the binary release downloads. Those tarballs contain CMakeLists and can be compiled.

@bazukas I've tried the compilation as I did everytime with OBS and with newer CEF Versions it didn't work – there is a need to upate obs-linuxbrowser for newer CEF releases.

JustEnoughDucks commented 7 years ago

@NexAdn I guess the question for me is why the instructions have you trying to CMake building the binary release.

mscdex commented 7 years ago

FWIW I ran into the same build error and was able to fix it by simply commenting out the offending line. This works because at least in the most recent version of libcef available, transparent backgrounds are the default and opaque backgrounds are opt-in by explicitly setting a background color.

Now if I could just get the browser instance to play Streamlabs' (ogg) audio clips...

bazukas commented 7 years ago

@mscdex Thank you for the info regarding the transparent backgrounds.

Last time I was investigating streamlabs audio, issue was that their audio system would not initialize without mp3/flash support (even if you're trying to play ogg clips). I reported the issue to them, but they don't seem to care anymore.

NexAdn commented 7 years ago

@bpgerber I have tried to build the source code release and not the binary release. But with mscdex's workaround there should be no problems anymore.

bazukas commented 7 years ago

Fixed by 78d7aa2dd30977a5c3715cec18fb3447ee521c47