From 54f2f51f5233026e608f8235f5377b9b473918e3 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Barnab=C3=A1s=20P=C5=91cze?= <pobrn@protonmail.com>
Date: Tue, 27 Oct 2026 21:28:56 +0100
Subject: [PATCH] spa: libcamera: device: 0.8 compatibility

Index: spa/plugins/libcamera/libcamera-device.cpp
--- spa/plugins/libcamera/libcamera-device.cpp.orig
+++ spa/plugins/libcamera/libcamera-device.cpp
@@ -28,6 +28,7 @@
 
 #include <libcamera/camera.h>
 #include <libcamera/property_ids.h>
+#include <libcamera/version.h>
 
 using namespace libcamera;
 
@@ -69,12 +70,21 @@ const char *cameraLoc(const Camera& camera)
 {
 	if (auto location = camera.properties().get(properties::Location)) {
 		switch (location.value()) {
+#if LIBCAMERA_VERSION_MAJOR > 0 || (LIBCAMERA_VERSION_MAJOR == 0 && LIBCAMERA_VERSION_MINOR >= 8)
+		case properties::LocationFront:
+			return "front";
+		case properties::LocationBack:
+			return "back";
+		case properties::LocationExternal:
+			return "external";
+#else
 		case properties::CameraLocationFront:
 			return "front";
 		case properties::CameraLocationBack:
 			return "back";
 		case properties::CameraLocationExternal:
 			return "external";
+#endif
 		}
 	}
 
