diff options
| author | dec05eba <dec05eba@protonmail.com> | 2026-08-01 23:08:48 +0200 |
|---|---|---|
| committer | dec05eba <dec05eba@protonmail.com> | 2026-08-01 23:08:48 +0200 |
| commit | 9dda64c39d0fdd6409305faff33c217dcf161e60 (patch) | |
| tree | b66b522a0af8d0730bef7852cbe9e3b78835fa86 /include/recorder | |
| parent | 40b6a13d14680cfacb3cdb59f04224540b80d9e4 (diff) | |
Move screenshot capture and CLI commands from main.cpp into separate modules
The list commands return exit codes through args_parser instead of exiting.
Diffstat (limited to 'include/recorder')
| -rw-r--r-- | include/recorder/screenshot.h | 36 |
1 files changed, 36 insertions, 0 deletions
diff --git a/include/recorder/screenshot.h b/include/recorder/screenshot.h new file mode 100644 index 0000000..057383c --- /dev/null +++ b/include/recorder/screenshot.h @@ -0,0 +1,36 @@ +#ifndef GSR_RECORDER_SCREENSHOT_H +#define GSR_RECORDER_SCREENSHOT_H + +#include <stdbool.h> +#include <signal.h> +#include "../egl.h" +#include "../image_writer.h" +#include "../plugins.h" +#include "capture_source.h" +#include "capture_setup.h" +#include "settings.h" + +typedef struct { + const gsr_recorder_settings *settings; + gsr_egl *egl; + gsr_window *window; + gsr_capture_deps *capture_deps; + gsr_capture_sources *capture_sources; + gsr_image_format image_format; + const char **plugin_filepaths; + int num_plugin_filepaths; + const volatile sig_atomic_t *running; + void (*screenshot_saved)(const char *filepath, void *userdata); + void *userdata; +} gsr_screenshot_params; + +bool get_image_format_from_filename(const char *filename, gsr_image_format *image_format); +gsr_color_range image_format_to_color_range(gsr_image_format image_format, int image_quality); +int video_quality_to_image_quality_value(gsr_video_quality video_quality); + +/* Returns a |gsr_error| value. Captures one frame and writes it to |settings->filename| */ +int gsr_screenshot_take(const gsr_screenshot_params *params); + +int gsr_load_plugins(gsr_plugins *plugins, const char **plugin_filepaths, int num_plugin_filepaths, const gsr_recorder_settings *settings, gsr_egl *egl, vec2i video_size); + +#endif /* GSR_RECORDER_SCREENSHOT_H */ |
