Created
May 8, 2021 07:34
-
-
Save kofuk/b9fe6387fd73e99452bd7b4f7e6dc5f0 to your computer and use it in GitHub Desktop.
Patch to the trunk to linux-caputre.so to work with latest release.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
diff -u '--color=auto' -r obs-studio-3514f4fea5ead7aa15f1e57934a86a55b579fed0/plugins/linux-capture/linux-capture.c obs-studio/plugins/linux-capture/linux-capture.c | |
--- obs-studio-3514f4fea5ead7aa15f1e57934a86a55b579fed0/plugins/linux-capture/linux-capture.c 2021-05-07 05:58:14.000000000 +0900 | |
+++ obs-studio/plugins/linux-capture/linux-capture.c 2021-05-08 15:51:04.547014308 +0900 | |
@@ -26,11 +26,11 @@ | |
MODULE_EXPORT const char *obs_module_description(void) | |
{ | |
#ifdef ENABLE_PIPEWIRE | |
- if (obs_get_nix_platform() != OBS_NIX_PLATFORM_X11_GLX) | |
+// if (obs_get_nix_platform() != OBS_NIX_PLATFORM_X11_GLX) | |
return "PipeWire based window/screen capture for X11 and Wayland"; | |
- else | |
+// else | |
#endif | |
- return "xcomposite/xshm based window/screen capture for X11"; | |
+// return "xcomposite/xshm based window/screen capture for X11"; | |
} | |
extern struct obs_source_info xshm_input; | |
@@ -40,24 +40,24 @@ | |
bool obs_module_load(void) | |
{ | |
- if (obs_get_nix_platform() == OBS_NIX_PLATFORM_X11_GLX) { | |
- obs_register_source(&xshm_input); | |
- xcomposite_load(); | |
+// if (obs_get_nix_platform() == OBS_NIX_PLATFORM_X11_GLX) { | |
+// obs_register_source(&xshm_input); | |
+// xcomposite_load(); | |
#ifdef ENABLE_PIPEWIRE | |
- } else { | |
+// } else { | |
pipewire_capture_load(); | |
#endif | |
- } | |
+// } | |
return true; | |
} | |
void obs_module_unload(void) | |
{ | |
- if (obs_get_nix_platform() == OBS_NIX_PLATFORM_X11_GLX) | |
- xcomposite_unload(); | |
+// if (obs_get_nix_platform() == OBS_NIX_PLATFORM_X11_GLX) | |
+// xcomposite_unload(); | |
#ifdef ENABLE_PIPEWIRE | |
- else | |
+// else | |
pipewire_capture_unload(); | |
#endif | |
} | |
diff -u '--color=auto' -r obs-studio-3514f4fea5ead7aa15f1e57934a86a55b579fed0/plugins/linux-capture/pipewire-capture.c obs-studio/plugins/linux-capture/pipewire-capture.c | |
--- obs-studio-3514f4fea5ead7aa15f1e57934a86a55b579fed0/plugins/linux-capture/pipewire-capture.c 2021-05-07 05:58:14.000000000 +0900 | |
+++ obs-studio/plugins/linux-capture/pipewire-capture.c 2021-05-08 16:26:27.360434893 +0900 | |
@@ -104,6 +104,7 @@ | |
obs_pipewire_video_render(data, effect); | |
} | |
+// old struct (avoids buffer overflow detection) | |
void pipewire_capture_load(void) | |
{ | |
// Desktop capture | |
@@ -124,7 +125,8 @@ | |
.video_render = pipewire_capture_video_render, | |
.icon_type = OBS_ICON_TYPE_DESKTOP_CAPTURE, | |
}; | |
- obs_register_source(&pipewire_desktop_capture_info); | |
+ // The struct size of that in previous release was 384. | |
+ obs_register_source_s(&pipewire_desktop_capture_info, 384); | |
// Window capture | |
const struct obs_source_info pipewire_window_capture_info = { | |
@@ -144,7 +146,8 @@ | |
.video_render = pipewire_capture_video_render, | |
.icon_type = OBS_ICON_TYPE_WINDOW_CAPTURE, | |
}; | |
- obs_register_source(&pipewire_window_capture_info); | |
+ | |
+ obs_register_source_s(&pipewire_window_capture_info, 384); | |
pw_init(NULL, NULL); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment