mirror of
https://repo.dec05eba.com/gpu-screen-recorder-ui
synced 2026-05-07 07:16:23 +09:00
Mention what is being recorded
This commit is contained in:
4
TODO
4
TODO
@@ -154,3 +154,7 @@ Use /dev/input/eventN (or /dev/hidrawN) instead of /dev/input/jsN for joystick i
|
|||||||
Verify if cursor tracker monitor name is always correct. It uses the wayland monitor name for recording, but gpu screen recorder uses a custom name created from the drm connector name.
|
Verify if cursor tracker monitor name is always correct. It uses the wayland monitor name for recording, but gpu screen recorder uses a custom name created from the drm connector name.
|
||||||
|
|
||||||
Notification with the focused monitor (with CursorTrackerWayland) assumes that the x11 monitor name is the same as the drm monitor name. Same for find_monitor_by_name.
|
Notification with the focused monitor (with CursorTrackerWayland) assumes that the x11 monitor name is the same as the drm monitor name. Same for find_monitor_by_name.
|
||||||
|
|
||||||
|
If CursorTrackerWayland fails then fallback to getting focused monitor by window creation trick. Need to take into consideration prime laptop with dGPU that controls external monitors which cant be captured (different /dev/dri/card device).
|
||||||
|
Maybe automatically switch to recording with the device that controls the monitor.
|
||||||
|
In that case also add all monitors available to capture in the capture list and automatically choose the gpu that controls the monitor.
|
||||||
|
|||||||
@@ -208,6 +208,7 @@ namespace gsr {
|
|||||||
RegionSelector region_selector;
|
RegionSelector region_selector;
|
||||||
bool start_region_capture = false;
|
bool start_region_capture = false;
|
||||||
std::function<void()> on_region_selected;
|
std::function<void()> on_region_selected;
|
||||||
|
std::string screenshot_capture_target;
|
||||||
|
|
||||||
std::unique_ptr<CursorTracker> cursor_tracker;
|
std::unique_ptr<CursorTracker> cursor_tracker;
|
||||||
mgl::Clock cursor_tracker_update_clock;
|
mgl::Clock cursor_tracker_update_clock;
|
||||||
|
|||||||
@@ -1644,7 +1644,7 @@ namespace gsr {
|
|||||||
if(config.screenshot_config.save_screenshot_in_game_folder) {
|
if(config.screenshot_config.save_screenshot_in_game_folder) {
|
||||||
save_video_in_current_game_directory(screenshot_filepath.c_str(), NotificationType::SCREENSHOT);
|
save_video_in_current_game_directory(screenshot_filepath.c_str(), NotificationType::SCREENSHOT);
|
||||||
} else {
|
} else {
|
||||||
const std::string text = "Saved screenshot to '" + filepath_get_filename(screenshot_filepath.c_str()) + "'";
|
const std::string text = "Saved screenshot of " + screenshot_capture_target + " to '" + filepath_get_filename(screenshot_filepath.c_str()) + "'";
|
||||||
show_notification(text.c_str(), notification_timeout_seconds, mgl::Color(255, 255, 255), get_color_theme().tint_color, NotificationType::SCREENSHOT);
|
show_notification(text.c_str(), notification_timeout_seconds, mgl::Color(255, 255, 255), get_color_theme().tint_color, NotificationType::SCREENSHOT);
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
@@ -2108,8 +2108,11 @@ namespace gsr {
|
|||||||
// TODO: Do not run this is a daemon. Instead get the pid and when launching another notification close the current notification
|
// TODO: Do not run this is a daemon. Instead get the pid and when launching another notification close the current notification
|
||||||
// program and start another one. This can also be used to check when the notification has finished by checking with waitpid NOWAIT
|
// program and start another one. This can also be used to check when the notification has finished by checking with waitpid NOWAIT
|
||||||
// to see when the program has exit.
|
// to see when the program has exit.
|
||||||
if(!disable_notification && config.replay_config.show_replay_started_notifications)
|
if(!disable_notification && config.replay_config.show_replay_started_notifications) {
|
||||||
show_notification("Replay has started", notification_timeout_seconds, get_color_theme().tint_color, get_color_theme().tint_color, NotificationType::REPLAY);
|
char msg[256];
|
||||||
|
snprintf(msg, sizeof(msg), "Started replay with %s as target", capture_target.c_str());
|
||||||
|
show_notification(msg, notification_timeout_seconds, get_color_theme().tint_color, get_color_theme().tint_color, NotificationType::REPLAY);
|
||||||
|
}
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
@@ -2230,8 +2233,11 @@ namespace gsr {
|
|||||||
// Starting recording in 3...
|
// Starting recording in 3...
|
||||||
// 2...
|
// 2...
|
||||||
// 1...
|
// 1...
|
||||||
if(config.record_config.show_recording_started_notifications)
|
if(config.record_config.show_recording_started_notifications) {
|
||||||
show_notification("Recording has started", notification_timeout_seconds, get_color_theme().tint_color, get_color_theme().tint_color, NotificationType::RECORD);
|
char msg[256];
|
||||||
|
snprintf(msg, sizeof(msg), "Started recording %s", capture_target.c_str());
|
||||||
|
show_notification(msg, notification_timeout_seconds, get_color_theme().tint_color, get_color_theme().tint_color, NotificationType::RECORD);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
static std::string streaming_get_url(const Config &config) {
|
static std::string streaming_get_url(const Config &config) {
|
||||||
@@ -2385,8 +2391,11 @@ namespace gsr {
|
|||||||
// TODO: Do not run this is a daemon. Instead get the pid and when launching another notification close the current notification
|
// TODO: Do not run this is a daemon. Instead get the pid and when launching another notification close the current notification
|
||||||
// program and start another one. This can also be used to check when the notification has finished by checking with waitpid NOWAIT
|
// program and start another one. This can also be used to check when the notification has finished by checking with waitpid NOWAIT
|
||||||
// to see when the program has exit.
|
// to see when the program has exit.
|
||||||
if(config.streaming_config.show_streaming_started_notifications)
|
if(config.streaming_config.show_streaming_started_notifications) {
|
||||||
show_notification("Streaming has started", notification_timeout_seconds, get_color_theme().tint_color, get_color_theme().tint_color, NotificationType::STREAM);
|
char msg[256];
|
||||||
|
snprintf(msg, sizeof(msg), "Started streaming %s", capture_target.c_str());
|
||||||
|
show_notification(msg, notification_timeout_seconds, get_color_theme().tint_color, get_color_theme().tint_color, NotificationType::STREAM);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void Overlay::on_press_take_screenshot(bool finished_region_selection, bool force_region_capture) {
|
void Overlay::on_press_take_screenshot(bool finished_region_selection, bool force_region_capture) {
|
||||||
@@ -2401,10 +2410,10 @@ namespace gsr {
|
|||||||
const bool region_capture = config.screenshot_config.record_area_option == "region" || force_region_capture;
|
const bool region_capture = config.screenshot_config.record_area_option == "region" || force_region_capture;
|
||||||
const char *record_area_option = region_capture ? "region" : config.screenshot_config.record_area_option.c_str();
|
const char *record_area_option = region_capture ? "region" : config.screenshot_config.record_area_option.c_str();
|
||||||
const SupportedCaptureOptions capture_options = get_supported_capture_options(gsr_info);
|
const SupportedCaptureOptions capture_options = get_supported_capture_options(gsr_info);
|
||||||
const std::string capture_target = get_capture_target(record_area_option, capture_options);
|
screenshot_capture_target = get_capture_target(record_area_option, capture_options);
|
||||||
if(!validate_capture_target(record_area_option, capture_options)) {
|
if(!validate_capture_target(record_area_option, capture_options)) {
|
||||||
char err_msg[256];
|
char err_msg[256];
|
||||||
snprintf(err_msg, sizeof(err_msg), "Failed to take a screenshot, capture target \"%s\" is invalid. Please change capture target in settings", capture_target.c_str());
|
snprintf(err_msg, sizeof(err_msg), "Failed to take a screenshot, capture target \"%s\" is invalid. Please change capture target in settings", screenshot_capture_target.c_str());
|
||||||
show_notification(err_msg, notification_error_timeout_seconds, mgl::Color(255, 0, 0, 0), mgl::Color(255, 0, 0, 0), NotificationType::SCREENSHOT);
|
show_notification(err_msg, notification_error_timeout_seconds, mgl::Color(255, 0, 0, 0), mgl::Color(255, 0, 0, 0), NotificationType::SCREENSHOT);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
@@ -2422,7 +2431,7 @@ namespace gsr {
|
|||||||
const std::string output_file = config.screenshot_config.save_directory + "/Screenshot_" + get_date_str() + "." + config.screenshot_config.image_format; // TODO: Validate image format
|
const std::string output_file = config.screenshot_config.save_directory + "/Screenshot_" + get_date_str() + "." + config.screenshot_config.image_format; // TODO: Validate image format
|
||||||
|
|
||||||
std::vector<const char*> args = {
|
std::vector<const char*> args = {
|
||||||
"gpu-screen-recorder", "-w", capture_target.c_str(),
|
"gpu-screen-recorder", "-w", screenshot_capture_target.c_str(),
|
||||||
"-cursor", config.screenshot_config.record_cursor ? "yes" : "no",
|
"-cursor", config.screenshot_config.record_cursor ? "yes" : "no",
|
||||||
"-v", "no",
|
"-v", "no",
|
||||||
"-q", config.screenshot_config.image_quality.c_str(),
|
"-q", config.screenshot_config.image_quality.c_str(),
|
||||||
|
|||||||
Reference in New Issue
Block a user