Questions to use CEF on Kodi

Do not post support requests, bug reports or feature requests. Discuss CEF here. Non-CEF related discussion goes in General Discussion!

Questions to use CEF on Kodi

Postby AlwinEsch » Sun May 19, 2019 11:33 am

Hi,

first Thanks a lot for your project, CEF is perfect and brings everything :D. I hope to bring with my stuff no problems to you.

I get it more and more stable step by step and plan to finish this year finally. Launched a few years ago, but went down again for a time.

The use of Kodi as a binary addon unfortunately required a few changes to the CEF. In Kodi, this addon is opened as a dll and not as a stand-alone app. The subprocesses, on the other hand, are then executed as EXE.

I had to make the following changes to use it as a Kodi addon on Windows and Linux:
- Oversteer the Chromium path with kodi_addon_dir_path in addition to CefSettings (worked on Linux, Windows and partly on Mac)(Mac still in todo)
- Enabling libcef to be loaded on Linux with cef_load_library (dlopen away).
- Querying Chromium whether root rights are necessary for sandbox under Linux
- Took some of the ARM processor-dependent Chromium patches from Ubuntu (but not yet fully tested)
- Forcing "libcef_dll_wrapper" to static, Kodi's addon CMake generates it otherwise as shared.

There are also a few other little things in it but try to take them more and more and keep the code the same with original.
Therefore, I also plan to bring some pull requests soon.

Here is the Kodi addon directory structure under Windows, but this must also be built on Linux and Mac and dignity downloaded as a ZIP by users:
Code: Select all
addon.xml
chrome_elf.dll
d3dcompiler_47.dll
icudtl.dat
kodichromium.exe
libcef.dll
libEGL.dll
libGLESv2.dll
natives_blob.bin
snapshot_blob.bin
v8_context_snapshot.bin
web.browser.chromium.dll
    ./resources:
        cef.pak
        cef_100_percent.pak
        cef_200_percent.pak
        cef_extensions.pak
        devtools_resources.pak
        icon.png
        settings.xml

    ./resources/locales:
        am.pak
        ...
        zh-TW.pak

    ./resources/shaders/GL/1.2:
        frag.glsl
        vert.glsl

    ./resources/shaders/GL/1.5:
        frag.glsl
        vert.glsl

    ./resources/shaders/GLES:
        frag.glsl
        vert.glsl

    ./resources/skins/skin.estuary/xml:
        BrowserDialogKeyboard.xml
        DialogCertificateError.xml
        DialogCookies.xml
        DialogDownloads.xml

    ./swiftshader:
        libEGL.dll
        libGLESv2.dll

Whether this would then work on iOS and Android, I do not know yet. The settings are stored in a Kodi user folder.

Here the used CEF:
https://github.com/kodi-web/cef (Branch kodi to your master and branch 3729-ForKodi to 3729.
Changes are still ugly but want to clean it up,

Here the used Kodi addon:
https://github.com/AlwinEsch/web.browser.chromium

Questions:
- Can this chromium path override by kodi_addon_dir_path be somehow avoided?
Saw e.g. under OS X a completely different structure is used, so I can think of no alternative.
Not complete sure that "PathService::Override" is enough, seen on some Chromium places special "#ifdefs" where other ways becomes used.
- Is it for you OK to allow dlopen way also under Linux?
- Is "libcef_dll_wrapper" in all cases static? Or somewhere as shared lib? Have forced it currently under "libcef_dll/CMakeLists.txt.in" to static.

General Question:
- Can the chromium ffmpeg stream player be somehow stopped by CEF? Goes around the time of unloading and quit, e.g. prevent the sending of the audio stream at this time.

EDIT:
Have forgot a bit viewtopic.php?f=6&t=13075, I try again now your note there.
AlwinEsch
Newbie
 
Posts: 7
Joined: Tue Jun 09, 2015 5:29 pm

Re: Questions to use CEF on Kodi

Postby AlwinEsch » Sun May 19, 2019 5:03 pm

The "PathService::Override" seems to work on Linux without changes on Chromium, now I test it on Mac and Win.
AlwinEsch
Newbie
 
Posts: 7
Joined: Tue Jun 09, 2015 5:29 pm

Re: Questions to use CEF on Kodi

Postby magreenblatt » Mon May 20, 2019 3:22 am

AlwinEsch wrote:Is it for you OK to allow dlopen way also under Linux?

It could be an option when building libcef_dll_wrapper on Linux. This was discussed briefly in https://bitbucket.org/chromiumembedded/ ... t-46963562

AlwinEsch wrote:Is "libcef_dll_wrapper" in all cases static? Or somewhere as shared lib? Have forced it currently under "libcef_dll/CMakeLists.txt.in" to static.

It should be static. What change did you make in CMake?

AlwinEsch wrote:Can the chromium ffmpeg stream player be somehow stopped by CEF? Goes around the time of unloading and quit, e.g. prevent the sending of the audio stream at this time.

Sorry, I don't understand your question. Can you explain what you're trying to do in greater detail?
magreenblatt
Site Admin
 
Posts: 12384
Joined: Fri May 29, 2009 6:57 pm

Re: Questions to use CEF on Kodi

Postby AlwinEsch » Mon May 20, 2019 10:47 am

magreenblatt wrote:
AlwinEsch wrote:Is it for you OK to allow dlopen way also under Linux?

It could be an option when building libcef_dll_wrapper on Linux. This was discussed briefly in https://bitbucket.org/chromiumembedded/ ... t-46963562

I'll check what the best way could be and send a request.

magreenblatt wrote:
AlwinEsch wrote:Is "libcef_dll_wrapper" in all cases static? Or somewhere as shared lib? Have forced it currently under "libcef_dll/CMakeLists.txt.in" to static.

It should be static. What change did you make in CMake?

Here on CEF: https://github.com/kodi-web/cef/blob/ko ... txt.in#L22
Here how CEF currently included by me: https://github.com/AlwinEsch/web.browse ... ts.txt#L55
Kodi's cmake enforces the addon build to a shared lib, so `libcef_dll_wrapper` is also built as a shared because in its generated CMakeLists.txt`add_library(${CEF_TARGET} ...`does not specify this.
Maybe if always static can be this added to your CMakeLists.txt.in.

magreenblatt wrote:
AlwinEsch wrote:Can the chromium ffmpeg stream player be somehow stopped by CEF? Goes around the time of unloading and quit, e.g. prevent the sending of the audio stream at this time.

Sorry, I don't understand your question. Can you explain what you're trying to do in greater detail?

Kodi stops and delete stupidly at the App exit, the audio output before the GUI is stopped, so a web page is still displayed and if a stream runs in it with audio, this continues to be passed on `CefAudioHandler`.

Is there a way to unload an existing webpage or stop working streams without ending the associated `CefClient` class?
Closing the `CefClient` right at the beginning does not work properly in Kodi because of a hen and egg problem.
AlwinEsch
Newbie
 
Posts: 7
Joined: Tue Jun 09, 2015 5:29 pm


Return to CEF Discussion

Who is online

Users browsing this forum: No registered users and 5 guests

cron