Guidance on CEF OSR in linux without x11 dependency

Having problems with building or using CEF's C/C++ APIs? This forum is here to help. Please do not post bug reports or feature requests here.

Guidance on CEF OSR in linux without x11 dependency

Postby deadbeef84 » Tue Jan 21, 2020 5:15 pm

I'm trying to make a headless (docker) build of an application (casparcg-server) that uses CEF.

I'm new to CEF, and I see that there's a lot of activity in areas that I believe are of interest to me (viz osr, shared texture support, ozone, etc), but I'm not sure what the current state is and what is possible.

I currently have an OpenGL context created using EGL. I would like CEF to do off-screen rendering (i.e. no window). I dont want to run an xserver so I need to get rid of the x11 dependency. If possible, it would be great if the osr could be hardware accelerated (perhaps through shared context/texture?).

Do I need ozone? If so, does the prebuilt binaries support ozone? What platform should I use?
Is there a minimal example to do what I'm asking? Could anyone provide some pointers where to start?
deadbeef84
Newbie
 
Posts: 3
Joined: Mon Jan 20, 2020 3:15 pm

Re: Guidance on CEF OSR in linux without x11 dependency

Postby magreenblatt » Tue Jan 21, 2020 10:46 pm

A supported WM backend (x11, wayland, etc) is required to provide basic platform functionality. I suggest running your app with xvfb and using off-screen rendering to populate a texture.
magreenblatt
Site Admin
 
Posts: 12409
Joined: Fri May 29, 2009 6:57 pm

Re: Guidance on CEF OSR in linux without x11 dependency

Postby deadbeef84 » Wed Jan 22, 2020 1:01 am

As far as I know, xvfb doesn't support hardware accelerated opengl which makes it a no-go as casparcg requires that.

I dont need any of the WM functionality (window, cursor, input, clipboard etc), from my understanding it looks like it should be possible to use --ozone-platform=headless or --ozone-platform=gbm, but maybe I'm on the wrong track?
deadbeef84
Newbie
 
Posts: 3
Joined: Mon Jan 20, 2020 3:15 pm

Re: Guidance on CEF OSR in linux without x11 dependency

Postby magreenblatt » Wed Jan 22, 2020 11:25 am

deadbeef84 wrote:As far as I know, xvfb doesn't support hardware accelerated opengl which makes it a no-go as casparcg requires that.

I dont need any of the WM functionality (window, cursor, input, clipboard etc), from my understanding it looks like it should be possible to use --ozone-platform=headless or --ozone-platform=gbm, but maybe I'm on the wrong track?

We don't currently support that in CEF but it might be possible to get it working with code changes. You can see https://bitbucket.org/chromiumembedded/cef/issues/2296 as a related example.
magreenblatt
Site Admin
 
Posts: 12409
Joined: Fri May 29, 2009 6:57 pm

Re: Guidance on CEF OSR in linux without x11 dependency

Postby deadbeef84 » Thu Mar 31, 2022 12:07 pm

Any updates here? I guess this boils down two two separate questions:

1. Can CEF run without x11? I don't quite understand the issue you linked, it looks like the merged PR-128 makes x11 dependency optional and enables ozone. What ozone platforms can be used with CEF? Does Aura/Views depend on x11?

2. Can I provide a hardware accelerated surface (OpenGL or Vulkan), for CEF to render directly to? Looks like this recently got a new issue https://bitbucket.org/chromiumembedded/cef/issues/3263/implement-off-screen-rendering-using-the, so I'm guessing still not possible but maybe not too far away.

Thank you for your help.
deadbeef84
Newbie
 
Posts: 3
Joined: Mon Jan 20, 2020 3:15 pm

Re: Guidance on CEF OSR in linux without x11 dependency

Postby magreenblatt » Thu Mar 31, 2022 12:19 pm

deadbeef84 wrote:1. Can CEF run without x11? I don't quite understand the issue you linked, it looks like the merged PR-128 makes x11 dependency optional and enables ozone. What ozone platforms can be used with CEF? Does Aura/Views depend on x11?

CEF works with ozone backends for X11 and Wayland. Aura/Views works with both, and is required with Wayland.

deadbeef84 wrote:2. Can I provide a hardware accelerated surface (OpenGL or Vulkan), for CEF to render directly to? Looks like this recently got a new issue https://bitbucket.org/chromiumembedded/cef/issues/3263/implement-off-screen-rendering-using-the, so I'm guessing still not possible but maybe not too far away.

Not currently supported. PR #285 which adds accelerated surfaces with OSR is the closest currently available.
magreenblatt
Site Admin
 
Posts: 12409
Joined: Fri May 29, 2009 6:57 pm


Return to Support Forum

Who is online

Users browsing this forum: No registered users and 42 guests