mirror of
https://repo.dec05eba.com/gpu-screen-recorder
synced 2026-05-06 15:00:43 +09:00
Stop recording when pipewire target window is closed or when pressing close in the desktop environments record button
This commit is contained in:
@@ -25,9 +25,6 @@ typedef struct {
|
||||
|
||||
typedef struct {
|
||||
gsr_capture_kms_params params;
|
||||
|
||||
bool should_stop;
|
||||
bool stop_is_error;
|
||||
|
||||
gsr_kms_client kms_client;
|
||||
gsr_kms_response kms_response;
|
||||
@@ -477,13 +474,7 @@ static int gsr_capture_kms_capture(gsr_capture *cap, AVFrame *frame, gsr_color_c
|
||||
}
|
||||
|
||||
static bool gsr_capture_kms_should_stop(gsr_capture *cap, bool *err) {
|
||||
gsr_capture_kms *cap_kms = cap->priv;
|
||||
if(cap_kms->should_stop) {
|
||||
if(err)
|
||||
*err = cap_kms->stop_is_error;
|
||||
return true;
|
||||
}
|
||||
|
||||
(void)cap;
|
||||
if(err)
|
||||
*err = false;
|
||||
return false;
|
||||
|
||||
@@ -15,9 +15,6 @@
|
||||
typedef struct {
|
||||
gsr_capture_portal_params params;
|
||||
|
||||
bool should_stop;
|
||||
bool stop_is_error;
|
||||
|
||||
unsigned int input_texture_id;
|
||||
unsigned int cursor_texture_id;
|
||||
|
||||
@@ -328,16 +325,10 @@ static int gsr_capture_portal_capture(gsr_capture *cap, AVFrame *frame, gsr_colo
|
||||
}
|
||||
|
||||
static bool gsr_capture_portal_should_stop(gsr_capture *cap, bool *err) {
|
||||
gsr_capture_portal *cap_portal = cap->priv;
|
||||
if(cap_portal->should_stop) {
|
||||
if(err)
|
||||
*err = cap_portal->stop_is_error;
|
||||
return true;
|
||||
}
|
||||
|
||||
gsr_capture_portal *self = cap->priv;
|
||||
if(err)
|
||||
*err = false;
|
||||
return false;
|
||||
return gsr_pipewire_recording_stopped(&self->pipewire);
|
||||
}
|
||||
|
||||
static void gsr_capture_portal_capture_end(gsr_capture *cap, AVFrame *frame) {
|
||||
|
||||
Reference in New Issue
Block a user