mirror of
https://repo.dec05eba.com/gpu-screen-recorder
synced 2026-03-31 09:07:13 +09:00
Call -sc script on screenshot as well, only save screenshot if no error
This commit is contained in:
@@ -311,7 +311,7 @@ static void usage_full() {
|
||||
printf("\n");
|
||||
printf(" -df Organise replays in folders based on the current date.\n");
|
||||
printf("\n");
|
||||
printf(" -sc Run a script on the saved video file (asynchronously). The first argument to the script is the filepath to the saved video file and the second argument is the recording type (either \"regular\" or \"replay\").\n");
|
||||
printf(" -sc Run a script on the saved video file (asynchronously). The first argument to the script is the filepath to the saved video/screenshot file and the second argument is the recording type (either \"regular\", \"replay\" or \"screenshot\").\n");
|
||||
printf(" Not applicable for live streams.\n");
|
||||
printf(" Note: the script has to be executable.\n");
|
||||
printf("\n");
|
||||
|
||||
@@ -65,6 +65,7 @@ bool gsr_cuda_load(gsr_cuda *self, Display *display, bool do_overclock) {
|
||||
goto fail;
|
||||
}
|
||||
|
||||
// TODO: Use the device associated with the opengl graphics context
|
||||
CUdevice cu_dev;
|
||||
res = self->cuDeviceGet(&cu_dev, 0);
|
||||
if(res != CUDA_SUCCESS) {
|
||||
|
||||
15
src/main.cpp
15
src/main.cpp
@@ -2347,11 +2347,16 @@ static void capture_image_to_file(args_parser &arg_parser, gsr_egl *egl, gsr_ima
|
||||
}
|
||||
|
||||
gsr_egl_swap_buffers(egl);
|
||||
|
||||
const int image_quality = video_quality_to_image_quality_value(arg_parser.video_quality);
|
||||
if(!gsr_image_writer_write_to_file(&image_writer, arg_parser.filename, image_format, image_quality)) {
|
||||
fprintf(stderr, "gsr error: capture_image_to_file_wayland: failed to write opengl texture to image output file %s\n", arg_parser.filename);
|
||||
_exit(1);
|
||||
|
||||
if(!should_stop_error) {
|
||||
const int image_quality = video_quality_to_image_quality_value(arg_parser.video_quality);
|
||||
if(!gsr_image_writer_write_to_file(&image_writer, arg_parser.filename, image_format, image_quality)) {
|
||||
fprintf(stderr, "gsr error: capture_image_to_file_wayland: failed to write opengl texture to image output file %s\n", arg_parser.filename);
|
||||
_exit(1);
|
||||
}
|
||||
|
||||
if(arg_parser.recording_saved_script)
|
||||
run_recording_saved_script_async(arg_parser.recording_saved_script, arg_parser.filename, "screenshot");
|
||||
}
|
||||
|
||||
gsr_image_writer_deinit(&image_writer);
|
||||
|
||||
Reference in New Issue
Block a user