SDL: camera: move PipeWire camera first in list

From 55d4b444413b27cabf2c0d58e33f13a8bfcfb207 Mon Sep 17 00:00:00 2001
From: Wim Taymans <[EMAIL REDACTED]>
Date: Wed, 8 May 2024 18:13:58 +0200
Subject: [PATCH] camera: move PipeWire camera first in list

If it fails, we fall back to the next one, which is v4l2.
---
 src/camera/SDL_camera.c                   | 6 +++---
 src/camera/SDL_syscamera.h                | 2 +-
 src/camera/pipewire/SDL_camera_pipewire.c | 2 +-
 3 files changed, 5 insertions(+), 5 deletions(-)

diff --git a/src/camera/SDL_camera.c b/src/camera/SDL_camera.c
index aaa9e9b414c9e..fcc597585c683 100644
--- a/src/camera/SDL_camera.c
+++ b/src/camera/SDL_camera.c
@@ -31,12 +31,12 @@
 
 // Available camera drivers
 static const CameraBootStrap *const bootstrap[] = {
-#ifdef SDL_CAMERA_DRIVER_V4L2
-    &V4L2_bootstrap,
-#endif
 #ifdef SDL_CAMERA_DRIVER_PIPEWIRE
     &PIPEWIRECAMERA_bootstrap,
 #endif
+#ifdef SDL_CAMERA_DRIVER_V4L2
+    &V4L2_bootstrap,
+#endif
 #ifdef SDL_CAMERA_DRIVER_COREMEDIA
     &COREMEDIA_bootstrap,
 #endif
diff --git a/src/camera/SDL_syscamera.h b/src/camera/SDL_syscamera.h
index ace3a5649f231..eefbf4a46544c 100644
--- a/src/camera/SDL_syscamera.h
+++ b/src/camera/SDL_syscamera.h
@@ -204,8 +204,8 @@ typedef struct CameraBootStrap
 
 // Not all of these are available in a given build. Use #ifdefs, etc.
 extern CameraBootStrap DUMMYCAMERA_bootstrap;
-extern CameraBootStrap V4L2_bootstrap;
 extern CameraBootStrap PIPEWIRECAMERA_bootstrap;
+extern CameraBootStrap V4L2_bootstrap;
 extern CameraBootStrap COREMEDIA_bootstrap;
 extern CameraBootStrap ANDROIDCAMERA_bootstrap;
 extern CameraBootStrap EMSCRIPTENCAMERA_bootstrap;
diff --git a/src/camera/pipewire/SDL_camera_pipewire.c b/src/camera/pipewire/SDL_camera_pipewire.c
index a2855cc2c6a6b..461a27b6d4823 100644
--- a/src/camera/pipewire/SDL_camera_pipewire.c
+++ b/src/camera/pipewire/SDL_camera_pipewire.c
@@ -1129,7 +1129,7 @@ static SDL_bool PIPEWIRECAMERA_Init(SDL_CameraDriverImpl *impl)
 }
 
 CameraBootStrap PIPEWIRECAMERA_bootstrap = {
-    "pipewire", "SDL PipeWire camera driver", PIPEWIRECAMERA_Init, SDL_TRUE
+    "pipewire", "SDL PipeWire camera driver", PIPEWIRECAMERA_Init, SDL_FALSE
 };
 
 #endif  // SDL_CAMERA_DRIVER_PIPEWIRE