Question / Help Browser plugin

Discussion in 'Linux Support' started by Manite, Oct 16, 2014.

  1. ubuntuaddicted Well-Known Member

    i got the cef binary downloaded and extracted from 7zip. i had to install libgtkglext1-dev and libgtk2.0-dev and I've hit a wall and not sure what to do next. Any help would be appreciated. :)

    Here's the terminal output from running ./build.sh Release
    Code
    cefsimple.target.mk:8: warning: overriding commands for target `out/Release/cef.pak'
    cefclient.target.mk:68: warning: ignoring old commands for target `out/Release/cef.pak'
    cefsimple.target.mk:13: warning: overriding commands for target `out/Release/devtools_resources.pak'
    cefclient.target.mk:73: warning: ignoring old commands for target `out/Release/devtools_resources.pak'
    cefsimple.target.mk:18: warning: overriding commands for target `out/Release/locales'
    cefclient.target.mk:78: warning: ignoring old commands for target `out/Release/locales'
    cefsimple.target.mk:23: warning: overriding commands for target `out/Release/chrome-sandbox'
    cefclient.target.mk:83: warning: ignoring old commands for target `out/Release/chrome-sandbox'
    cefsimple.target.mk:28: warning: overriding commands for target `out/Release/libcef.so'
    cefclient.target.mk:88: warning: ignoring old commands for target `out/Release/libcef.so'
    cefsimple.target.mk:33: warning: overriding commands for target `out/Release/libffmpegsumo.so'
    cefclient.target.mk:93: warning: ignoring old commands for target `out/Release/libffmpegsumo.so'
      CXX(target) out/Release/obj.target/cefclient/cefclient/cefclient.o
      CXX(target) out/Release/obj.target/cefclient/cefclient/binding_test.o
      CXX(target) out/Release/obj.target/cefclient/cefclient/client_app.o
      CXX(target) out/Release/obj.target/cefclient/cefclient/client_app_delegates.o
      CXX(target) out/Release/obj.target/cefclient/cefclient/client_handler.o
      CXX(target) out/Release/obj.target/cefclient/cefclient/client_renderer.o
      CXX(target) out/Release/obj.target/cefclient/cefclient/client_switches.o
      CXX(target) out/Release/obj.target/cefclient/cefclient/dialog_test.o
      CXX(target) out/Release/obj.target/cefclient/cefclient/dom_test.o
      CXX(target) out/Release/obj.target/cefclient/cefclient/osrenderer.o
      CXX(target) out/Release/obj.target/cefclient/cefclient/performance_test.o
      CXX(target) out/Release/obj.target/cefclient/cefclient/performance_test_tests.o
      CXX(target) out/Release/obj.target/cefclient/cefclient/scheme_test.o
      CXX(target) out/Release/obj.target/cefclient/cefclient/string_util.o
      CXX(target) out/Release/obj.target/cefclient/cefclient/window_test.o
      CXX(target) out/Release/obj.target/cefclient/cefclient/cefclient_gtk.o
      CXX(target) out/Release/obj.target/cefclient/cefclient/cefclient_osr_widget_gtk.o
      CXX(target) out/Release/obj.target/cefclient/cefclient/client_handler_gtk.o
      CXX(target) out/Release/obj.target/cefclient/cefclient/resource_util_linux.o
      CXX(target) out/Release/obj.target/cefclient/cefclient/resource_util_posix.o
      CXX(target) out/Release/obj.target/cefclient/cefclient/window_test_gtk.o
      CXX(target) out/Release/obj.target/cefsimple/cefsimple/simple_app.o
      CXX(target) out/Release/obj.target/cefsimple/cefsimple/simple_handler.o
      CXX(target) out/Release/obj.target/cefsimple/cefsimple/cefsimple_gtk.o
      CXX(target) out/Release/obj.target/cefsimple/cefsimple/simple_handler_gtk.o
      LINK(target) out/Release/cefclient
      LINK(target) out/Release/cefsimple
    /usr/bin/ld: warning: libudev.so.0, needed by Release/libcef.so, not found (try using -rpath or -rpath-link)
    Release/libcef.so: undefined reference to `udev_monitor_unref'
    Release/libcef.so: undefined reference to `udev_enumerate_scan_devices'
    Release/libcef.so: undefined reference to `udev_new'
    Release/libcef.so: undefined reference to `udev_list_entry_get_name'
    Release/libcef.so: undefined reference to `udev_enumerate_get_list_entry'
    Release/libcef.so: undefined reference to `udev_list_entry_get_next'
    Release/libcef.so: undefined reference to `udev_device_new_from_syspath'
    Release/libcef.so: undefined reference to `udev_monitor_receive_device'
    Release/libcef.so: undefined reference to `udev_device_get_property_value'
    Release/libcef.so: undefined reference to `udev_unref'
    Release/libcef.so: undefined reference to `udev_monitor_enable_receiving'
    Release/libcef.so: undefined reference to `udev_monitor_filter_add_match_subsystem_devtype'
    Release/libcef.so: undefined reference to `udev_monitor_get_fd'
    Release/libcef.so: undefined reference to `udev_device_get_devnode'
    Release/libcef.so: undefined reference to `udev_device_get_subsystem'
    Release/libcef.so: undefined reference to `udev_enumerate_unref'
    Release/libcef.so: undefined reference to `udev_enumerate_new'
    Release/libcef.so: undefined reference to `udev_device_get_parent_with_subsystem_devtype'
    Release/libcef.so: undefined reference to `udev_monitor_new_from_netlink'
    Release/libcef.so: undefined reference to `udev_device_unref'
    Release/libcef.so: undefined reference to `udev_device_get_sysattr_value'
    Release/libcef.so: undefined reference to `udev_enumerate_add_match_subsystem'
    collect2: error: ld returned 1 exit status
    make: *** [out/Release/cefclient] Error 1
    make: *** Waiting for unfinished jobs....
    /usr/bin/ld: warning: libudev.so.0, needed by Release/libcef.so, not found (try using -rpath or -rpath-link)
    Release/libcef.so: undefined reference to `udev_monitor_unref'
    Release/libcef.so: undefined reference to `udev_enumerate_scan_devices'
    Release/libcef.so: undefined reference to `udev_new'
    Release/libcef.so: undefined reference to `udev_list_entry_get_name'
    Release/libcef.so: undefined reference to `udev_enumerate_get_list_entry'
    Release/libcef.so: undefined reference to `udev_list_entry_get_next'
    Release/libcef.so: undefined reference to `udev_device_new_from_syspath'
    Release/libcef.so: undefined reference to `udev_monitor_receive_device'
    Release/libcef.so: undefined reference to `udev_device_get_property_value'
    Release/libcef.so: undefined reference to `udev_unref'
    Release/libcef.so: undefined reference to `udev_monitor_enable_receiving'
    Release/libcef.so: undefined reference to `udev_monitor_filter_add_match_subsystem_devtype'
    Release/libcef.so: undefined reference to `udev_monitor_get_fd'
    Release/libcef.so: undefined reference to `udev_device_get_devnode'
    Release/libcef.so: undefined reference to `udev_device_get_subsystem'
    Release/libcef.so: undefined reference to `udev_enumerate_unref'
    Release/libcef.so: undefined reference to `udev_enumerate_new'
    Release/libcef.so: undefined reference to `udev_device_get_parent_with_subsystem_devtype'
    Release/libcef.so: undefined reference to `udev_monitor_new_from_netlink'
    Release/libcef.so: undefined reference to `udev_device_unref'
    Release/libcef.so: undefined reference to `udev_device_get_sysattr_value'
    Release/libcef.so: undefined reference to `udev_enumerate_add_match_subsystem'
    collect2: error: ld returned 1 exit status
    make: *** [out/Release/cefsimple] Error 1
    I ensured I had libudev1 and libudev1:i386 installed already and I did. well it turns out I found libudev.so.0 within /opt/google/chrome/ so not sure if this was ok to do but I just created a symlink to it using
    Code
    sudo ln -sf /opt/google/chrome/libudev.so.0 /lib/x86_64-linux-gnu/libudev.so.0
    but now i definitely don't know the next step because you instruction of set CEF_ROOT_DIR when running cmake doesn't mean anything to someone like me as I am not used to compiling things. So any help here would be much appreciated. Thanks
    Last edited: Nov 22, 2014
  2. Manite Member

    Well, it's been a couple weeks since there was any activity on this thread.

    Any news on this Devs?
  3. ubuntuaddicted Well-Known Member

    sadly we're at the mercy of the developer or someone who can answer my question. :(
  4. Manite Member

    I was hoping for a Christmas miracle from Jim and the devs.
  5. ubuntuaddicted Well-Known Member

    you have to understand that the dev's are busy working on 3 different versions of obs with this rewrite and refactoring of the code. they're working as hard as they can
  6. Manite Member

    I totally understand that and I don't mean to come off as impatient. I'm very happy with the current state of OBS and am merely anxious for updates. I want more OBS goodness.
  7. ubuntuaddicted Well-Known Member

    i can relate. ;)
  8. BobDev Well-Known Member

    Question, how did you implement browser support, did you use Qt webkit for this or it was to performance heavy for streaming?
  9. Osiris

    Moderator

    The browser is the Chromium Embedded Framework.
  10. BobDev Well-Known Member

    Interesting, do you know the reason behind it, since they use QT I would assume it would be easier to just go with the existing part of QT, especially since it is platform independent?
  11. Jim

    Jim Developer

    ubuntuaddicted likes this.
  12. ubuntuaddicted Well-Known Member

    thanks for sharing your reasoning behind this Jim. not many dev's would take the time to explain this to their users.
  13. sgrunt New Member

    Hi folks - running a Linux box here and I've gotten the browser plugin into a mostly usable state. I'll provide a few notes on how I managed to get that far:

    1) CEF appears to be looking for an old version of libudev.so. I found that if I went to /usr/lib64 or /usr/lib or wherever libudev.so.1.x.y is hiding and made a symlink of that to libudev.so.0 that CEF was mollified and would build and run happily.

    2) cmake had issues finding libcef_dll_wrapper.a, because in the version of CEF I had it ends up as libcef_dll/libcef_dll_wrapper.a, which is in neither of the paths FindCEF.cmake is looking for. Adding ${CEF_ROOT_DIR}/libcef_dll to FindCef.cmake:14 is sufficient.

    3) This might be specific to my compilation environment, but os_utf8_to_wcs_ptr indicates that it expects a wchar_t** (possibly Linux-specific), and thus won't take a char16** in the call on browser-manager-base.cpp:244 - characters needs to be a wchar_t* to compile here.

    4) Thanks to CEF being silly about where it wants to find its support data, to get it to try to run at all, most of the contents of ${CEF_ROOT_DIR}/cefclient/Release (excluding cefclient and the files subdirectory) need to be present in the same location as both the obs binary itself and in the obs-plugins directory. (Yes, two copies.) chrome-sandbox probably will need its permissions reset as well (it expects suid root, in particular root:root 4755).

    5) Trying to run CefRunMessageLoop() from the browser manager thread blocks. Instead, I pulled the content of the PushEvent block from browser-manager-base.cpp:339-350 directly into the thread (there's no point in pushing something to a thread from that same thread), removed the unnecessary CefExecuteProcess() call and the offending CefRunMessageLoop() call, and added an instance of CefDoMessageLoopWork() to the head of the dispatch loop below.

    6) At this point, the plugin initialised properly... and crashed immediately upon trying to do anything with it. Some debugging indicated that the crash relates to Qt and glib - so setting QT_NO_GLIB=1 in the environment before running obs makes the problem go away, and, indeed, gets the plugin into a mostly working state. (I suspect glib threading isn't being initialised properly somewhere along the way, but I haven't delved too deeply into it.)

    The main issues I have left at this point: trying to change the settings or close obs causes a crash, the exact nature of which I haven't figured out yet (I suspect multiple threads are trying to destroy the browser instances).

    I hope this is of use to other people who are trying to get this to work locally.
  14. bazukas

    Developer

    Leeo97one, shaolin and Manite like this.
  15. JohanAR New Member

    bazukas you're a genious! obs-qtwebkit was a breeze to compile and install. I even submitted a pull request on github to make the plugin transparent (only for pages that don't specify a background color).

    Is there some easy way to reload the page? Maybe it could automatically detect changes in case of a local file.
  16. Manite Member

    I'm getting a bit frustrated getting bazukas solution working. When I go to compile I get
    Code
    Package Qt5WebKitWidgets was not found in the pkg-config search path.
    Perhaps you should add the directory containing `Qt5WebKitWidgets.pc'
    to the PKG_CONFIG_PATH environment variable
    No package 'Qt5WebKitWidgets' found
    g++ -c -std=c++11 -Wall -g -fPIC -I/usr/include/obs -I./src  src/qtwebkit-renderer.cpp -o build/qtwebkit-renderer.o
    src/qtwebkit-renderer.cpp:24:24: fatal error: QApplication: No such file or directory
    #include <QApplication>
                            ^
    compilation terminated.
    make: *** [build/qtwebkit-renderer.o] Error 1
    
    I installed qt5 from https://wiki.qt.io/Install_Qt_5_on_Ubuntu and can locate the `Qt5WebKitWidgets.pc' but I'm not a programmer and don't know where I would do the pkg_config_path.

    I'm on ubuntu 14.04, any suggestions would be appreciated.
  17. JohanAR New Member

    I think you should install QT from the Ubuntu repositories rather than bothering with binary installers and guides. Try installing libqt5webkit5-dev, here's how if you're uncertain:

    > sudo apt-get install libq5webkit5-dev
  18. Manite Member

    I get unable to locate package libq5webkit5-dev

    I have all ubuntu software sources enabled.

    Is there a ppa I can add?
  19. bazukas

    Developer

    The package is libqt5webkit5-dev

    Thanks. I can add a button in properties to refresh the page, not sure about detecting changes in local files yet.
  20. Manite Member

    I actually just caught the typo in the command and got the following instead.
    Code
    Reading package lists... Done
    Building dependency tree    
    Reading state information... Done
    Some packages could not be installed. This may mean that you have
    requested an impossible situation or if you are using the unstable
    distribution that some required packages have not yet been created
    or been moved out of Incoming.
    The following information may help to resolve the situation:
    
    The following packages have unmet dependencies:
    gnome-control-center : Depends: libcheese-gtk23 (>= 3.4.0) but it is not going to be installed
                            Depends: libcheese7 (>= 3.0.1) but it is not going to be installed
    unity-control-center : Depends: libcheese-gtk23 (>= 3.4.0) but it is not going to be installed
                            Depends: libcheese7 (>= 3.0.1) but it is not going to be installed
    E: Error, pkgProblemResolver::Resolve generated breaks, this may be caused by held packages.
    
    the control centers are installed tho. I also have the cheese installed, so I'm not sure what my sys is going on about.
    Last edited: May 19, 2015