Fixed camera capture on iOS

My phone captured 1920x1080 images even though the highest reported format was higher resolution, so I adjusted testcamera to be able to handle different sized images than expected.

Fixes https://github.com/libsdl-org/SDL/issues/9930
This commit is contained in:
Sam Lantinga
2024-06-04 11:34:39 -07:00
parent 7e231fcd90
commit 4d392bfc67
3 changed files with 61 additions and 45 deletions

View File

@@ -852,6 +852,8 @@ SDL_bool SDL_CameraThreadIterate(SDL_CameraDevice *device)
#if DEBUG_CAMERA
SDL_Log("CAMERA: Frame is going through without conversion!");
#endif
output_surface->w = acquired->w;
output_surface->h = acquired->h;
output_surface->pixels = acquired->pixels;
output_surface->pitch = acquired->pitch;
} else { // convert/scale into a different surface.