From 3eb7bae12c9fe50913a57656d2b324d4da18c30a Mon Sep 17 00:00:00 2001 From: dec05eba Date: Fri, 9 Feb 2024 00:23:52 +0100 Subject: Move card path to egl struct, use egl struct for monitor enumeration --- include/capture/kms_cuda.h | 1 - include/capture/kms_vaapi.h | 1 - include/capture/xcomposite_cuda.h | 4 ---- include/capture/xcomposite_vaapi.h | 5 ----- include/egl.h | 3 ++- include/utils.h | 5 +++-- 6 files changed, 5 insertions(+), 14 deletions(-) (limited to 'include') diff --git a/include/capture/kms_cuda.h b/include/capture/kms_cuda.h index c2b2ad8..14ed333 100644 --- a/include/capture/kms_cuda.h +++ b/include/capture/kms_cuda.h @@ -11,7 +11,6 @@ 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_gpu_info gpu_inf; - const char *card_path; /* reference */ } gsr_capture_kms_cuda_params; gsr_capture* gsr_capture_kms_cuda_create(const gsr_capture_kms_cuda_params *params); diff --git a/include/capture/kms_vaapi.h b/include/capture/kms_vaapi.h index b7fbb81..b670a0d 100644 --- a/include/capture/kms_vaapi.h +++ b/include/capture/kms_vaapi.h @@ -12,7 +12,6 @@ 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_gpu_info gpu_inf; - const char *card_path; /* reference */ bool wayland; bool hdr; gsr_color_range color_range; diff --git a/include/capture/xcomposite_cuda.h b/include/capture/xcomposite_cuda.h index 2106714..53b7c0d 100644 --- a/include/capture/xcomposite_cuda.h +++ b/include/capture/xcomposite_cuda.h @@ -4,13 +4,9 @@ #include "capture.h" #include "../egl.h" #include "../vec2.h" -#include - -typedef struct _XDisplay Display; typedef struct { gsr_egl *egl; - Display *dpy; Window window; bool follow_focused; /* If this is set then |window| is ignored */ vec2i region_size; /* This is currently only used with |follow_focused| */ diff --git a/include/capture/xcomposite_vaapi.h b/include/capture/xcomposite_vaapi.h index ba234ec..c6237e3 100644 --- a/include/capture/xcomposite_vaapi.h +++ b/include/capture/xcomposite_vaapi.h @@ -5,17 +5,12 @@ #include "../egl.h" #include "../vec2.h" #include "../color_conversion.h" -#include - -typedef struct _XDisplay Display; typedef struct { gsr_egl *egl; - Display *dpy; Window window; bool follow_focused; /* If this is set then |window| is ignored */ vec2i region_size; /* This is currently only used with |follow_focused| */ - const char *card_path; /* reference */ gsr_color_range color_range; } gsr_capture_xcomposite_vaapi_params; diff --git a/include/egl.h b/include/egl.h index d8fdf97..a747bdb 100644 --- a/include/egl.h +++ b/include/egl.h @@ -146,6 +146,7 @@ typedef struct { gsr_x11 x11; gsr_wayland wayland; + char card_path[128]; int fd; uint32_t x; @@ -234,7 +235,7 @@ bool gsr_egl_load(gsr_egl *self, Display *dpy, bool wayland); void gsr_egl_unload(gsr_egl *self); /* wayland protocol capture, does not include kms capture */ -bool gsr_egl_supports_wayland_capture(gsr_egl *self); +bool gsr_egl_supports_wayland_capture(const gsr_egl *self); bool gsr_egl_start_capture(gsr_egl *self, const char *monitor_to_capture); void gsr_egl_update(gsr_egl *self); void gsr_egl_cleanup_frame(gsr_egl *self); diff --git a/include/utils.h b/include/utils.h index 392591a..26a0aed 100644 --- a/include/utils.h +++ b/include/utils.h @@ -43,8 +43,9 @@ typedef struct { double clock_get_monotonic_seconds(void); typedef void (*active_monitor_callback)(const gsr_monitor *monitor, void *userdata); -void for_each_active_monitor_output(void *connection, gsr_connection_type connection_type, active_monitor_callback callback, void *userdata); -bool get_monitor_by_name(void *connection, gsr_connection_type connection_type, const char *name, gsr_monitor *monitor); +void for_each_active_monitor_output_x11(Display *display, active_monitor_callback callback, void *userdata); +void for_each_active_monitor_output(const gsr_egl *egl, gsr_connection_type connection_type, active_monitor_callback callback, void *userdata); +bool get_monitor_by_name(const gsr_egl *egl, gsr_connection_type connection_type, const char *name, gsr_monitor *monitor); bool gl_get_gpu_info(gsr_egl *egl, gsr_gpu_info *info); -- cgit v1.2.3