SDL: Make sure the output settings match the camera device format

From 463984ec20408eda51b0db52e8f39e07c6b571f3 Mon Sep 17 00:00:00 2001
From: Sam Lantinga <[EMAIL REDACTED]>
Date: Tue, 11 Jun 2024 20:40:21 -0700
Subject: [PATCH] Make sure the output settings match the camera device format

---
 src/camera/coremedia/SDL_camera_coremedia.m | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)

diff --git a/src/camera/coremedia/SDL_camera_coremedia.m b/src/camera/coremedia/SDL_camera_coremedia.m
index 48940f4930276..64142e04f01be 100644
--- a/src/camera/coremedia/SDL_camera_coremedia.m
+++ b/src/camera/coremedia/SDL_camera_coremedia.m
@@ -308,7 +308,11 @@ static int COREMEDIA_OpenDevice(SDL_CameraDevice *device, const SDL_CameraSpec *
         return SDL_SetError("Cannot create AVCaptureVideoDataOutput");
     }
 
-    output.videoSettings = @{};
+    output.videoSettings = @{
+        (id)kCVPixelBufferWidthKey : @(spec->width),
+        (id)kCVPixelBufferHeightKey : @(spec->height),
+        (id)kCVPixelBufferPixelFormatTypeKey : @(CMFormatDescriptionGetMediaSubType([spec_format formatDescription]))
+    };
 
     char threadname[64];
     SDL_GetCameraThreadName(device, threadname, sizeof (threadname));