Skip to content

Commit 1d0ecf9

Browse files
smcvslouken
authored andcommitted
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 <[email protected]> (cherry picked from commit d57aa6f)
1 parent 18d93d1 commit 1d0ecf9

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

src/camera/pipewire/SDL_camera_pipewire.c

+8
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,9 @@ static bool pipewire_initialized = false;
5858

5959
// Pipewire entry points
6060
static const char *(*PIPEWIRE_pw_get_library_version)(void);
61+
#if PW_CHECK_VERSION(0, 3, 75)
6162
static bool (*PIPEWIRE_pw_check_library_version)(int major, int minor, int micro);
63+
#endif
6264
static void (*PIPEWIRE_pw_init)(int *, char ***);
6365
static void (*PIPEWIRE_pw_deinit)(void);
6466
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)
151153
static bool load_pipewire_syms(void)
152154
{
153155
SDL_PIPEWIRE_SYM(pw_get_library_version);
156+
#if PW_CHECK_VERSION(0, 3, 75)
154157
SDL_PIPEWIRE_SYM(pw_check_library_version);
158+
#endif
155159
SDL_PIPEWIRE_SYM(pw_init);
156160
SDL_PIPEWIRE_SYM(pw_deinit);
157161
SDL_PIPEWIRE_SYM(pw_main_loop_new);
@@ -1024,7 +1028,11 @@ static bool hotplug_loop_init(void)
10241028

10251029
spa_list_init(&hotplug.global_list);
10261030

1031+
#if PW_CHECK_VERSION(0, 3, 75)
10271032
hotplug.have_1_0_5 = PIPEWIRE_pw_check_library_version(1,0,5);
1033+
#else
1034+
hotplug.have_1_0_5 = false;
1035+
#endif
10281036

10291037
hotplug.loop = PIPEWIRE_pw_thread_loop_new("SDLPwCameraPlug", NULL);
10301038
if (!hotplug.loop) {

0 commit comments

Comments
 (0)