obs-studio icon indicating copy to clipboard operation
obs-studio copied to clipboard

libobs/graphics: unbreak DMABUF on FreeBSD

Open jbeich opened this issue 3 years ago • 3 comments

Description

Trying to build wlrobs >= 1.1 I get the following error:

ld: error: undefined symbol: gs_texture_create_from_dmabuf
>>> referenced by dmabuf_source.c
>>>               libwlrobs.so.p/src_dmabuf_source.c.o:(ready)
cc: error: linker command failed with exit code 1 (use -v to see invocation)

despite https://github.com/obsproject/obs-studio/blob/88ea0bbb56b0a020b60c908a706cbe2403a13fd8/libobs/graphics/graphics.h#L970-L976

Motivation and Context

wlroots (Wayland) support on FreeBSD and DragonFly. wlrobs-1.0 already works fine but wlrobs-1.1 needs this change.

wlroots + wlrobs are also supported on DragonFly, so expose DMABUF API there as well.

How Has This Been Tested?

$ pkg install sway wlrobs glx-utils
$ sway
$ glxgears &
$ obs
<Sources>
<Add Source>
<Wayland output(dmabuf)>
<OK>

<Sources>
<Add Source>
<Window Capture (Xcomposite)>
<Window: glxgears>
<OK>

<Start recording>
<Stop recording>

Types of changes

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

Checklist:

  • [x] My code has been run through clang-format.
  • [x] I have read the contributing document.
  • [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.

jbeich avatar Dec 31 '22 16:12 jbeich

libobs/graphics: properly expose DMABUF API on BSDs after c50c625

Required under Wayland (wlrobs) on FreeBSD and DragonFly.

Change that by something like:

libobs/graphics: Enable DMABUF on FreeBSD and DragonFly

"BSDs" cover more than just FreeBSD and DragonFly.

tytan652 avatar Dec 31 '22 16:12 tytan652

Ping. Anything else?

jbeich avatar Jan 06 '23 08:01 jbeich

It's been holidays and we haven't caught up with all new the PR's yet that came in over the last few weeks. Please give us some time, your PR will get looked at.

gxalpha avatar Jan 06 '23 16:01 gxalpha

No regressions reported after 3 weeks of dogfooding downstream:

If you want to test yourself use real hardware or pass-through GPU. DMABUF requires DRM but virtual GPU kernel drivers haven't been ported.

jbeich avatar Jan 22 '23 04:01 jbeich