Parcourir la source

pipewire: Don't require pw_check_library_version() with Pipewire < 0.3.75

The Debian 12 'bookworm' stable release only has 0.3.65, which is earlier
than the introduction of that symbol. Similarly, Steam Runtime 3 'sniper'
and Steam Runtime 2 'soldier' have a backport of 0.3.65 from Debian 12,
so they have the same limitation.

steamrt/tasks#686

Signed-off-by: Simon McVittie <smcv@collabora.com>
(cherry picked from commit d57aa6f7afe2ecf0f8dec9e985e40f3dfb012000)
Simon McVittie il y a 1 mois
Parent
commit
1d0ecf982f
1 fichiers modifiés avec 8 ajouts et 0 suppressions
  1. 8 0
      src/camera/pipewire/SDL_camera_pipewire.c

+ 8 - 0
src/camera/pipewire/SDL_camera_pipewire.c

@@ -58,7 +58,9 @@ static bool pipewire_initialized = false;
 
 // Pipewire entry points
 static const char *(*PIPEWIRE_pw_get_library_version)(void);
+#if PW_CHECK_VERSION(0, 3, 75)
 static bool (*PIPEWIRE_pw_check_library_version)(int major, int minor, int micro);
+#endif
 static void (*PIPEWIRE_pw_init)(int *, char ***);
 static void (*PIPEWIRE_pw_deinit)(void);
 static struct pw_main_loop *(*PIPEWIRE_pw_main_loop_new)(const struct spa_dict *loop);
@@ -151,7 +153,9 @@ static void unload_pipewire_library(void)
 static bool load_pipewire_syms(void)
 {
     SDL_PIPEWIRE_SYM(pw_get_library_version);
+#if PW_CHECK_VERSION(0, 3, 75)
     SDL_PIPEWIRE_SYM(pw_check_library_version);
+#endif
     SDL_PIPEWIRE_SYM(pw_init);
     SDL_PIPEWIRE_SYM(pw_deinit);
     SDL_PIPEWIRE_SYM(pw_main_loop_new);
@@ -1024,7 +1028,11 @@ static bool hotplug_loop_init(void)
 
     spa_list_init(&hotplug.global_list);
 
+#if PW_CHECK_VERSION(0, 3, 75)
     hotplug.have_1_0_5 = PIPEWIRE_pw_check_library_version(1,0,5);
+#else
+    hotplug.have_1_0_5 = false;
+#endif
 
     hotplug.loop = PIPEWIRE_pw_thread_loop_new("SDLPwCameraPlug", NULL);
     if (!hotplug.loop) {