aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/args_parser.c
diff options
context:
space:
mode:
authordec05eba <dec05eba@protonmail.com>2026-08-02 01:11:33 +0200
committerdec05eba <dec05eba@protonmail.com>2026-08-02 01:11:53 +0200
commitd72113be395891f4289f0d86a32a37a99a4d5b38 (patch)
treec2dd74d24fe62d1020be64980b8a321e999bcc29 /src/args_parser.c
parentb38d324c8fcb61b699a16c39fc0dcdb31ad9934b (diff)
Add -ipc option to control gpu-screen-recorder over a unix domain socket
The socket accepts the same commands as the signal handlers, except that saving a replay takes an arbitrary number of seconds instead of only the fixed times that the signals provide. Requests and replies are newline terminated json objects and every request is replied to, parsed with the sj.h json library that was added to external. Requests are handled on a thread that only runs while the recorder exists, so the recorder control fields are now atomics, which they have to be now that another thread writes them.
Diffstat (limited to 'src/args_parser.c')
-rw-r--r--src/args_parser.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/src/args_parser.c b/src/args_parser.c
index 0adb5ef..d10da67 100644
--- a/src/args_parser.c
+++ b/src/args_parser.c
@@ -206,7 +206,7 @@ static void usage_header(void) {
"[-cursor yes|no] [-keyint <value>] [-restore-portal-session yes|no] [-portal-session-token-filepath filepath] [-encoder gpu|cpu] "
"[-fallback-cpu-encoding yes|no] [-o <output_file>] [-ro <output_directory>] [-ffmpeg-opts <options>] [--list-capture-options [card_path]] "
"[--list-monitors] [--list-audio-devices] [--list-application-audio] [--list-v4l2-devices] [-write-first-frame-ts yes|no] [-low-power yes|no] "
- "[-v yes|no] [-gl-debug yes|no] [-exclude-metadata yes|no] [--version] [-h|--help]\n", program_name);
+ "[-ipc <socket_path>] [-v yes|no] [-gl-debug yes|no] [-exclude-metadata yes|no] [--version] [-h|--help]\n", program_name);
fflush(stdout);
}
@@ -571,6 +571,7 @@ args_parse_result args_parser_parse(args_parser *self, int argc, char **argv, co
self->args[arg_index++] = (Arg){ .key = "-write-first-frame-ts", .optional = true, .list = false, .type = ARG_TYPE_BOOLEAN };
self->args[arg_index++] = (Arg){ .key = "-low-power", .optional = true, .list = false, .type = ARG_TYPE_BOOLEAN };
self->args[arg_index++] = (Arg){ .key = "-exclude-metadata", .optional = true, .list = false, .type = ARG_TYPE_BOOLEAN };
+ self->args[arg_index++] = (Arg){ .key = "-ipc", .optional = true, .list = false, .type = ARG_TYPE_STRING };
assert(arg_index == NUM_ARGS);
for(int i = 1; i < argc; i += 2) {