Description
Description
On macOS, when using scrcpy, if the Android device screen is rotated (e.g., portrait to landscape) or the scrcpy window is resized/redrawn, the displayed video suffers from color distortion (reduced color gamut, washed-out colors, incorrect contrast).
This issue seems related to how SDL handles YV12 textures after SDL_CreateTexture()
is called multiple times (especially after screen rotation). The first texture renders correctly, but subsequent textures (after rotation) have incorrect colors.
SDL Version
SDL 2.32.8 (from scrcpy -v
output)
Platform
macOS 15 (also occurs on 26)
Steps to Reproduce
- Start scrcpy (
scrcpy
command). - Observe that the video initially renders correctly.
- Rotate the Android device screen.
- The video's color gamut / color distortion reduced
- Rotate again and the video keeps low color gamut.
- Compare with the initial video effect (left):
Expected Behavior
All textures (including those created after rotation/redraw) should render with correct colors and full color gamut.
Actual Behavior
Subsequent textures (after rotation) have incorrect colors, as if the YV12 texture is not being handled correctly by SDL on macOS.
Related Code
The issue may be related to this code in scrcpy:
https://github.com/Genymobile/scrcpy/blob/0ba9d35/app/src/display.c#L130-L132
SDL_Texture *texture = SDL_CreateTexture(renderer, SDL_PIXELFORMAT_YV12,
SDL_TEXTUREACCESS_STREAMING,
size.width, size.height);