obsproject / obs-browser

CEF-based OBS Studio browser plugin
GNU General Public License v2.0
769 stars 217 forks source link

Enable building with CEF 6261 & 6367 (Chromium 122 & 124) #434

Open WizardCM opened 5 months ago

WizardCM commented 5 months ago

Description

This allows compiling OBS Browser with Chromium 124-based CEF versions.

This also adds basic support for the new, official, shared textures API on both Windows and macOS.

Sources:

Fun note; Remote debugging now requires --remote-allow-origins=* otherwise Remote Debugging immediately disconnects - even for localhost.

Motivation and Context

At some point we'd like to upgrade to modern CEF. To do that, obs-browser needs to compile.

How Has This Been Tested?

Launch OBS with a CEF 6261 or 6367 build. Have not tested downgrading CEF to our currently supported versions.

Only tested on Windows.

Types of changes

Checklist:

jmickelonis commented 5 months ago

Slightly off-topic, but you might be interested to know. I built with 6261 (beta) on Ubuntu 23.10. Browser sources and docks do show up, but calls to ExecuteJavascript fail silently without effect. 6167 stable works fine.

PatTheMav commented 4 months ago

@WizardCM do you want to include the texture flip override for builds above 6261 in this PR as well (as discussed off-thread)?

As the texture shared with us is originally created for video encoding, it's pre-flipped already.

RytoEX commented 3 months ago

@WizardCM do you want to include the texture flip override for builds above 6261 in this PR as well (as discussed off-thread)?

As the texture shared with us is originally created for video encoding, it's pre-flipped already.

Gentle ping, @WizardCM ?

WizardCM commented 2 months ago

@RytoEX @PatTheMav Per prior discussion, this PR now makes the necessary adjustments (including flip) to correctly run shared textures with CEF 6367. I have tested it on Windows 10 with the 6367 CEF build only. I've also kept the two commits separate for easier review, and they can realistically be combined for final merge.

WizardCM commented 1 month ago

Alright, commits have been updated. Tested on macOS, and OnScheduleMessagePumpWork changed somewhere between 5563 and 5938, so our code handles that case too. Tested on Linux, and no additional changes were needed on our side (obviously without shared textures).

This now builds and runs on Windows, macOS and Linux without issue, and the first 2 with shared textures. In my opinion this seems good to merge.

For now, I've left the code to set bs->last_handle but it's not read. I'll let others confirm what we want to do there.

reitowo commented 1 month ago

Great work!

I forgot why, but is there a chance to import gbm in Linux? Seems OBS is the easiest user to make this work because it has a handy render pipeline.

jpietek commented 2 weeks ago

Great work!

I forgot why, but is there a chance to import gbm in Linux? Seems OBS is the easiest user to make this work because it has a handy render pipeline.

I tried once (obs discord long discussion), but failed on Nvidia (OK with Intel and AMD) with some old fork of yours. Would it makes sense to try again with 126 chromium? I see the api has changed not void* but some structure with the handle now.

RytoEX commented 2 weeks ago

There are still be open feedback threads. They should be resolved before this can be merged.