Explicitly set pixel format type to 32BGRA #103
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
When receiving IOSurfaces from Syphon, calling
IOSurfaceGetPixelFormat
on them returns0
. This is not ideal. In fact, per the Apple documentation, 0 is returned when the IOSurfaces are invalid.This was discovered in OBS Studio when an unknown bug that treated
0
as...32BGRA
instead of invalid was accidentally fixed in a code refactor. The IOSurfaces from Syphon however were all 32BGRA, so treating them as such happened to work, until this fix that actually treats them as invalid, leading to Syphon sources no longer working. This will be un-fixed in OBS to restore previous behavior, but it would still be nice to have the IOSurfaces return their proper pixel format (so that maybe in the future, this un-fix won't be necessary anymore).I tested this by building the simple server against this patched version of the framework and receiving it in OBS Studio 31.0.1 (which rejects
0
) and confirmed that it receives the images correctly (note that 31.0.2 will likely have the patch that will make0
"work" again, so using specifically 32.0.1 (or an earlier 32.0 release or beta) to test is important).