obsproject / obs-browser

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

Change product_version to user_agent_product #297

Closed deviant closed 3 years ago

deviant commented 3 years ago

Description

Fixes compilation against CEF 91.1.0 and later. The product_version setting has been renamed to user_agent_product.

(Note: only merge this once you update the officially supported CEF to 91.1.0 (Chromium 91.0.4472.19) or later)

Motivation and Context

Fixes a compilation failure. Here's the CEF commit that caused this.

How Has This Been Tested?

Built as part of OBS 27.0 using CEF 90.6.7 on NixOS (see https://github.com/NixOS/nixpkgs/pull/126505).

OBS starts up and displays the chosen web page when a Browser source is configured.

Types of changes

Checklist:

RytoEX commented 3 years ago

This looks like a breaking change that isn't ifdef'd, and for a version of CEF we don't officially support.

deviant commented 3 years ago

I'm aware of both, hence you should consider this WIP until you bump the supported version.

deviant commented 3 years ago

(I'm happy to stick it behind an ifdef if you can give me a pointer to the right place to define this, FWIW)

WizardCM commented 3 years ago

Yep, please stick this behind compile conditional as there is no guarantee on when each platform will have the relevant CEF build configured.

#if CHROME_VERSION_BUILD >= 4472
    CefString(&settings.user_agent_product) = prod_ver.str();
#else
    CefString(&settings.product_version) = prod_ver.str();
#endif