Files
Sebastian Beckmann 2d5ba21204 libobs-opengl: Treat pixel format 0 in IOSurface as 32BGRA
Per the Apple documentation, when 0 is returned from
IOSurfaceGetPixelFormat, the IOSurface is invalid. Prior to [1] however,
any invalid surfaces were (likely accidentally) treated as 32BGRA.
And as it turns out, any IOSurface received from Syphon does not have
the pixel format set, thus returning 0. Because the pixel format happens
to always be 32BGRA, this was never caught. [1] then slightly refactored
the code, fixing the bug not realizing it ever existed. This lead to
Syphon no longer working.

Treating 0 as 32BGRA appears to be the only way to fix this situation
for now and restore prior behavior. Ideally in the future Syphon
provides valid IOSurfaces. An upstream fix to Syphon-Framework is
already submitted, however even if merged, servers would need to update
to that fixed version before things work again. Therefore, this
workaround is needed on the OBS side.

However, the plan for now is for the Metal renderer to not get this
relaxation. It never had it (so Syphon never worked there, making this
not a regression) and it's marked as experimental. Hopefully, by the
time it's stable and/or default, Syphon will be fixed and servers have
been updated.

[1]: 53ad05db9f
2025-10-23 08:35:52 -04:00
..
2025-02-05 16:20:15 -05:00
2025-02-05 16:20:15 -05:00