diff options
| author | dec05eba <dec05eba@protonmail.com> | 2026-08-02 01:11:33 +0200 |
|---|---|---|
| committer | dec05eba <dec05eba@protonmail.com> | 2026-08-02 01:11:53 +0200 |
| commit | d72113be395891f4289f0d86a32a37a99a4d5b38 (patch) | |
| tree | c2dd74d24fe62d1020be64980b8a321e999bcc29 /include/recorder/audio_capture.h | |
| parent | b38d324c8fcb61b699a16c39fc0dcdb31ad9934b (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 'include/recorder/audio_capture.h')
| -rw-r--r-- | include/recorder/audio_capture.h | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/include/recorder/audio_capture.h b/include/recorder/audio_capture.h index 68390aa..4f757c9 100644 --- a/include/recorder/audio_capture.h +++ b/include/recorder/audio_capture.h @@ -3,7 +3,7 @@ #include <stdbool.h> #include <stddef.h> -#include <signal.h> +#include <stdatomic.h> #include <pthread.h> #include "../sound.h" #include "recording_clock.h" @@ -64,11 +64,11 @@ struct gsr_audio_capture { gsr_encoder *encoder; gsr_recording_clock *clock; - const volatile sig_atomic_t *running; + const atomic_int *running; }; /* Returns a |gsr_error| value */ -int gsr_audio_capture_init(gsr_audio_capture *self, gsr_encoder *encoder, gsr_recording_clock *clock, const volatile sig_atomic_t *running); +int gsr_audio_capture_init(gsr_audio_capture *self, gsr_encoder *encoder, gsr_recording_clock *clock, const atomic_int *running); void gsr_audio_capture_deinit(gsr_audio_capture *self); bool gsr_audio_capture_add_track(gsr_audio_capture *self, const gsr_audio_track *track); |
