aboutsummaryrefslogtreecommitdiff
path: root/include/utils.h
diff options
context:
space:
mode:
authordec05eba <dec05eba@protonmail.com>2023-04-07 05:31:46 +0200
committerdec05eba <dec05eba@protonmail.com>2023-04-07 05:31:46 +0200
commit75ed160122bc923731ae1d005d789608a4cdb2fb (patch)
tree97a07ea8aaeb23cc8b2f94e11da7ebf703fbc3a3 /include/utils.h
parent10d7bf93e864fc6b3c83ad7a913ea05d39256c03 (diff)
Implement kms vaapi capture
Diffstat (limited to 'include/utils.h')
-rw-r--r--include/utils.h26
1 files changed, 26 insertions, 0 deletions
diff --git a/include/utils.h b/include/utils.h
new file mode 100644
index 0000000..f4925e5
--- /dev/null
+++ b/include/utils.h
@@ -0,0 +1,26 @@
+#ifndef GSR_UTILS_H
+#define GSR_UTILS_H
+
+#include "vec2.h"
+#include <stdbool.h>
+#include <X11/extensions/Xrandr.h>
+
+typedef struct {
+ vec2i pos;
+ vec2i size;
+} gsr_monitor;
+
+typedef struct {
+ const char *name;
+ int name_len;
+ gsr_monitor *monitor;
+ bool found_monitor;
+} get_monitor_by_name_userdata;
+
+double clock_get_monotonic_seconds(void);
+
+typedef void (*active_monitor_callback)(const XRROutputInfo *output_info, const XRRCrtcInfo *crt_info, const XRRModeInfo *mode_info, void *userdata);
+void for_each_active_monitor_output(Display *display, active_monitor_callback callback, void *userdata);
+bool get_monitor_by_name(Display *display, const char *name, gsr_monitor *monitor);
+
+#endif /* GSR_UTILS_H */