diff options
-rw-r--r-- | README.md | 3 | ||||
-rw-r--r-- | include/Overlay.hpp | 1 | ||||
-rw-r--r-- | src/Overlay.cpp | 17 | ||||
-rw-r--r-- | src/main.cpp | 10 | ||||
-rw-r--r-- | tools/gsr-ui-cli/main.c | 6 |
5 files changed, 31 insertions, 6 deletions
@@ -27,8 +27,7 @@ These are the dependencies needed to build GPU Screen Recorder UI: * linux-api-headers * libpulse (libpulse-simple) * libdrm -* wayland-client -* wayland-scanner +* wayland (wayland-client, wayland-egl, wayland-scanner) ## Runtime dependencies There are also additional dependencies needed at runtime: diff --git a/include/Overlay.hpp b/include/Overlay.hpp index 8dd246a..c7b069b 100644 --- a/include/Overlay.hpp +++ b/include/Overlay.hpp @@ -209,6 +209,7 @@ namespace gsr { bool replay_save_show_notification = false; ReplayStartupMode replay_startup_mode = ReplayStartupMode::TURN_ON_AT_SYSTEM_STARTUP; bool try_replay_startup = true; + bool replay_recording = false; AudioPlayer audio_player; RegionSelector region_selector; diff --git a/src/Overlay.cpp b/src/Overlay.cpp index a6f8a69..1f67c10 100644 --- a/src/Overlay.cpp +++ b/src/Overlay.cpp @@ -1912,6 +1912,7 @@ namespace gsr { show_notification("Failed to start/save recording. Verify if settings are correct", notification_timeout_seconds, mgl::Color(255, 0, 0), mgl::Color(255, 0, 0), NotificationType::RECORD); } update_ui_recording_stopped(); + replay_recording = false; } void Overlay::update_ui_recording_paused() { @@ -2321,26 +2322,34 @@ namespace gsr { case RecordingStatus::RECORD: break; case RecordingStatus::REPLAY: { + if(gpu_screen_recorder_process <= 0) + return; + if(gsr_info.system_info.gsr_version >= GsrVersion{5, 4, 0}) { - if(gpu_screen_recorder_process > 0) { + if(!replay_recording) { if(config.record_config.show_recording_started_notifications) show_notification("Started recording in the replay session", notification_timeout_seconds, get_color_theme().tint_color, get_color_theme().tint_color, NotificationType::RECORD); update_ui_recording_started(); - kill(gpu_screen_recorder_process, SIGRTMIN); } + replay_recording = true; + kill(gpu_screen_recorder_process, SIGRTMIN); } else { show_notification("Unable to start recording when replay is turned on.\nTurn off replay before starting recording.", notification_error_timeout_seconds, mgl::Color(255, 0, 0), get_color_theme().tint_color, NotificationType::REPLAY); } return; } case RecordingStatus::STREAM: { + if(gpu_screen_recorder_process <= 0) + return; + if(gsr_info.system_info.gsr_version >= GsrVersion{5, 4, 0}) { - if(gpu_screen_recorder_process > 0) { + if(!replay_recording) { if(config.record_config.show_recording_started_notifications) show_notification("Started recording in the streaming session", notification_timeout_seconds, get_color_theme().tint_color, get_color_theme().tint_color, NotificationType::RECORD); update_ui_recording_started(); - kill(gpu_screen_recorder_process, SIGRTMIN); } + replay_recording = true; + kill(gpu_screen_recorder_process, SIGRTMIN); } else { show_notification("Unable to start recording when streaming.\nStop streaming before starting recording.", notification_error_timeout_seconds, mgl::Color(255, 0, 0), get_color_theme().tint_color, NotificationType::STREAM); } diff --git a/src/main.cpp b/src/main.cpp index fefa832..7729aeb 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -78,6 +78,16 @@ static void rpc_add_commands(gsr::Rpc *rpc, gsr::Overlay *overlay) { overlay->save_replay(); }); + rpc->add_handler("replay-save-1-min", [overlay](const std::string &name) { + fprintf(stderr, "rpc command executed: %s\n", name.c_str()); + overlay->save_replay_1_min(); + }); + + rpc->add_handler("replay-save-10-min", [overlay](const std::string &name) { + fprintf(stderr, "rpc command executed: %s\n", name.c_str()); + overlay->save_replay_10_min(); + }); + rpc->add_handler("take-screenshot", [overlay](const std::string &name) { fprintf(stderr, "rpc command executed: %s\n", name.c_str()); overlay->take_screenshot(); diff --git a/tools/gsr-ui-cli/main.c b/tools/gsr-ui-cli/main.c index c34888c..feb5247 100644 --- a/tools/gsr-ui-cli/main.c +++ b/tools/gsr-ui-cli/main.c @@ -56,6 +56,10 @@ static void usage(void) { printf(" Start/stop replay.\n"); printf(" replay-save\n"); printf(" Save replay.\n"); + printf(" replay-save-1-min\n"); + printf(" Save 1 minute replay.\n"); + printf(" replay-save-10-min\n"); + printf(" Save 10 minute replay.\n"); printf(" take-screenshot\n"); printf(" Take a screenshot.\n"); printf(" take-screenshot-region\n"); @@ -75,6 +79,8 @@ static bool is_valid_command(const char *command) { "toggle-stream", "toggle-replay", "replay-save", + "replay-save-1-min", + "replay-save-10-min", "take-screenshot", "take-screenshot-region", NULL |