From b0de8588f2f4a5204e9bc22218eed884fa741153 Mon Sep 17 00:00:00 2001 From: dec05eba Date: Thu, 13 Mar 2025 22:34:29 +0100 Subject: Take screenshot with XGetImage on x11 to workaround nvidia driver (nvfbc) limitation that only allows one nvfbc session at a time --- include/capture/kms.h | 4 +--- include/capture/nvfbc.h | 2 -- include/capture/portal.h | 2 -- include/capture/xcomposite.h | 2 -- include/capture/ximage.h | 18 ++++++++++++++++++ 5 files changed, 19 insertions(+), 9 deletions(-) create mode 100644 include/capture/ximage.h (limited to 'include/capture') diff --git a/include/capture/kms.h b/include/capture/kms.h index f359783..ce09817 100644 --- a/include/capture/kms.h +++ b/include/capture/kms.h @@ -5,9 +5,7 @@ typedef struct { gsr_egl *egl; - const char *display_to_capture; /* if this is "screen", then the first monitor is captured. A copy is made of this */ - gsr_color_depth color_depth; - gsr_color_range color_range; + const char *display_to_capture; /* A copy is made of this */ bool hdr; bool record_cursor; int fps; diff --git a/include/capture/nvfbc.h b/include/capture/nvfbc.h index f93fdc0..07cc42f 100644 --- a/include/capture/nvfbc.h +++ b/include/capture/nvfbc.h @@ -11,8 +11,6 @@ typedef struct { vec2i pos; vec2i size; bool direct_capture; - gsr_color_depth color_depth; - gsr_color_range color_range; bool record_cursor; vec2i output_resolution; vec2i region_size; diff --git a/include/capture/portal.h b/include/capture/portal.h index 3989b98..74cdba9 100644 --- a/include/capture/portal.h +++ b/include/capture/portal.h @@ -5,8 +5,6 @@ typedef struct { gsr_egl *egl; - gsr_color_depth color_depth; - gsr_color_range color_range; bool record_cursor; bool restore_portal_session; /* If this is set to NULL then this defaults to $XDG_CONFIG_HOME/gpu-screen-recorder/restore_token ($XDG_CONFIG_HOME defaults to $HOME/.config) */ diff --git a/include/capture/xcomposite.h b/include/capture/xcomposite.h index 45eb481..bf6532e 100644 --- a/include/capture/xcomposite.h +++ b/include/capture/xcomposite.h @@ -8,9 +8,7 @@ typedef struct { gsr_egl *egl; unsigned long window; bool follow_focused; /* If this is set then |window| is ignored */ - gsr_color_range color_range; bool record_cursor; - gsr_color_depth color_depth; vec2i output_resolution; } gsr_capture_xcomposite_params; diff --git a/include/capture/ximage.h b/include/capture/ximage.h new file mode 100644 index 0000000..e6c3607 --- /dev/null +++ b/include/capture/ximage.h @@ -0,0 +1,18 @@ +#ifndef GSR_CAPTURE_XIMAGE_H +#define GSR_CAPTURE_XIMAGE_H + +#include "capture.h" +#include "../vec2.h" + +typedef struct { + gsr_egl *egl; + const char *display_to_capture; /* A copy is made of this */ + bool record_cursor; + vec2i output_resolution; + vec2i region_size; + vec2i region_position; +} gsr_capture_ximage_params; + +gsr_capture* gsr_capture_ximage_create(const gsr_capture_ximage_params *params); + +#endif /* GSR_CAPTURE_XIMAGE_H */ -- cgit v1.2.3-70-g09d2