Require extra info for Linux hardware accel #491

Merged
tytan652 merged 1 commit from linux_hwaccel_pr_fix into master 2025-07-09 13:24:19 -05:00
tytan652 commented 2025-07-06 09:36:54 -05:00 (Migrated from github.com)

Description

Disable hardware accel on Linux if the extra field is not provided by CEF API.

A CEF 127 build with the API backported can be used if CEF_OSR_EXTRA_INFO is defined by the build itself. (https://github.com/tytan652/cef/tree/6533-fix-stutter-and-osr-extra-info)
Otherwise CEF 133 is required to enable it without backport required.

Motivation and Context

To properly do DMA-BUF we need CEF to provide the size of the image and not rely on the source settings.

How Has This Been Tested?

It works on my machine.

Types of changes

  • Bug fix (non-breaking change which fixes an issue)

Checklist:

  • My code has been run through clang-format.
  • I have read the contributing document.
  • My code is not on the master branch.
  • The code has been tested.
  • All commit messages are properly formatted and commits squashed where appropriate.
  • I have included updates to all appropriate documentation.
<!--- Please fill out the following template, which will help other contributors review your Pull Request. --> <!--- Make sure you’ve read the contribution guidelines here: https://github.com/obsproject/obs-studio/blob/master/CONTRIBUTING.rst --> ### Description <!--- Describe your changes in detail. --> <!--- If this change includes UI elements, please include screenshots. --> Disable hardware accel on Linux if the extra field is not provided by CEF API. A CEF 127 build with the API backported can be used if `CEF_OSR_EXTRA_INFO` is defined by the build itself. (https://github.com/tytan652/cef/tree/6533-fix-stutter-and-osr-extra-info) Otherwise CEF 133 is required to enable it without backport required. ### Motivation and Context <!--- Why is this change required? What problem does it solve? --> <!--- If it fixes an open GitHub Issue, or implements feature request --> <!--- from the Ideas page, please link to the issue here. --> To properly do DMA-BUF we need CEF to provide the size of the image and not rely on the source settings. ### How Has This Been Tested? <!--- Please describe in detail how you tested your changes. --> <!--- Include details of your testing environment (hardware, OS version, etc.),--> <!--- and the tests you ran, including how it may affect other areas of code. --> It works on my machine. ### Types of changes <!--- What types of changes does your PR introduce? Uncomment all that apply --> - Bug fix (non-breaking change which fixes an issue) <!--- - New feature (non-breaking change which adds functionality) --> <!--- - Tweak (non-breaking change to improve existing functionality) --> <!--- - Performance enhancement (non-breaking change which improves efficiency) --> <!--- - Code cleanup (non-breaking change which makes code smaller or more readable) --> <!--- - Breaking change (fix or feature that would cause existing functionality to change) --> <!--- - Documentation (a change to documentation pages) --> ### Checklist: <!--- Go over all the following points, and put an `x` in all the boxes that apply. --> <!--- If you're unsure about any of these, don't hesitate to ask. We're here to help! --> - [x] My code has been run through [clang-format](https://github.com/obsproject/obs-studio/blob/master/.clang-format). - [x] I have read the [**contributing** document](https://github.com/obsproject/obs-studio/blob/master/CONTRIBUTING.rst). - [x] My code is not on the master branch. - [x] The code has been tested. - [x] All commit messages are properly formatted and commits squashed where appropriate. - [x] I have included updates to all appropriate documentation.
RytoEX (Migrated from github.com) requested changes 2025-07-08 12:44:20 -05:00
@ -456,3 +455,4 @@
offsets, modifier != DRM_FORMAT_MOD_INVALID ? modifiers : NULL);
#endif
UpdateExtraTexture();
obs_leave_graphics();
RytoEX (Migrated from github.com) commented 2025-07-08 12:28:26 -05:00

Does this work (compiles and runs) without the backported CEF changes? Or do we have to update CEF in obs-studio first and then update obs-browser? At a glance, it looks like this is behind ENABLE_BROWSER_SHARED_TEXTURE, but I want to confirm.

Does this work (compiles and runs) without the backported CEF changes? Or do we have to update CEF in obs-studio first and then update obs-browser? At a glance, it looks like this is behind `ENABLE_BROWSER_SHARED_TEXTURE`, but I want to confirm.
tytan652 (Migrated from github.com) reviewed 2025-07-08 13:28:57 -05:00
@ -456,3 +455,4 @@
offsets, modifier != DRM_FORMAT_MOD_INVALID ? modifiers : NULL);
#endif
UpdateExtraTexture();
obs_leave_graphics();
tytan652 (Migrated from github.com) commented 2025-07-08 13:28:57 -05:00

CEF_OSR_EXTRA_INFO being missing will prevent ENABLE_BROWSER_SHARED_TEXTURE to be defined on Linux.

So building with CEF build older than 133 (6943) without the backport will not enable the code (and so the feature) to be built.

This is the main reason that my backport on CEF 127 does define CEF_OSR_EXTRA_INFO, not making the backport a hard dependency.

`CEF_OSR_EXTRA_INFO` being missing will prevent `ENABLE_BROWSER_SHARED_TEXTURE` to be defined on Linux. So building with CEF build older than 133 (6943) without the backport will not enable the code (and so the feature) to be built. This is the main reason that my backport on CEF 127 does define `CEF_OSR_EXTRA_INFO`, not making the backport a hard dependency.
RytoEX (Migrated from github.com) approved these changes 2025-07-08 13:54:48 -05:00
RytoEX (Migrated from github.com) left a comment

Looks fine at a glance.

Looks fine at a glance.
Sign in to join this conversation.
No reviewers
No milestone
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
gh-obsproject/obs-browser!491
No description provided.