소스 검색

linux-capture: Load XSHM capture on EGL/X11

Unlike Xcomposite, the XSHM plugin does not use GLX code, and thus
can be used on when EGL renderer is used. It still is X11-specific
though, and shouldn't be used on Wayland.

Rework the obs_module_load() function of linux-capture to use a
switch statement, and load XSHM both on EGL/X11 and GLX/X11.

Fixes https://github.com/obsproject/obs-studio/issues/5122
Georges Basile Stavracas Neto 4 년 전
부모
커밋
09b5290c7b
1개의 변경된 파일17개의 추가작업 그리고 2개의 파일을 삭제
  1. 17 2
      plugins/linux-capture/linux-capture.c

+ 17 - 2
plugins/linux-capture/linux-capture.c

@@ -40,12 +40,27 @@ extern void xcomposite_unload(void);
 
 bool obs_module_load(void)
 {
-	if (obs_get_nix_platform() == OBS_NIX_PLATFORM_X11_GLX) {
+	enum obs_nix_platform_type platform = obs_get_nix_platform();
+
+	switch (platform) {
+	case OBS_NIX_PLATFORM_X11_GLX:
 		obs_register_source(&xshm_input);
 		xcomposite_load();
+		break;
+
+	case OBS_NIX_PLATFORM_X11_EGL:
+		obs_register_source(&xshm_input);
+#ifdef ENABLE_PIPEWIRE
+		pipewire_capture_load();
+#endif
+		break;
+
+#ifdef ENABLE_WAYLAND
+	case OBS_NIX_PLATFORM_WAYLAND:
 #ifdef ENABLE_PIPEWIRE
-	} else {
 		pipewire_capture_load();
+#endif
+		break;
 #endif
 	}