mirror of
https://repo.dec05eba.com/gpu-screen-recorder-ui
synced 2026-04-20 00:45:51 +09:00
Compare commits
5 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
609a3e54fd | ||
|
|
4e62d12e8c | ||
|
|
b4e003c8f7 | ||
|
|
9efe9d3c91 | ||
|
|
ef4a0fe7cb |
5
TODO
5
TODO
@@ -206,3 +206,8 @@ Support localization.
|
|||||||
Add option to not capture cursor in screenshot when doing region/window capture.
|
Add option to not capture cursor in screenshot when doing region/window capture.
|
||||||
|
|
||||||
Window selection doesn't work when a window is fullscreen on x11.
|
Window selection doesn't work when a window is fullscreen on x11.
|
||||||
|
|
||||||
|
Make it possible to change replay duration of the "save 1 min" and "save 10 min" by adding them to the replay settings as options.
|
||||||
|
|
||||||
|
If replay duration is set below the "save 1 min" or "save 10 min" then gray them out and when hovering over those buttons
|
||||||
|
show a tooltip that says that those buttons cant be used because the replay duration in replay settings is set to a lower value than that (and display the replay duration there).
|
||||||
Submodule depends/mglpp updated: 8489234dcb...6e720fe411
@@ -19,7 +19,9 @@ namespace gsr {
|
|||||||
void draw(mgl::Window &window, mgl::vec2f offset) override;
|
void draw(mgl::Window &window, mgl::vec2f offset) override;
|
||||||
|
|
||||||
void add_item(const std::string &text, const std::string &id);
|
void add_item(const std::string &text, const std::string &id);
|
||||||
|
// The item can only be selected if it's enabled
|
||||||
void set_selected_item(const std::string &id, bool trigger_event = true, bool trigger_event_even_if_selection_not_changed = true);
|
void set_selected_item(const std::string &id, bool trigger_event = true, bool trigger_event_even_if_selection_not_changed = true);
|
||||||
|
void set_item_enabled(const std::string &id, bool enabled);
|
||||||
const std::string& get_selected_id() const;
|
const std::string& get_selected_id() const;
|
||||||
|
|
||||||
mgl::vec2f get_size() override;
|
mgl::vec2f get_size() override;
|
||||||
@@ -36,6 +38,7 @@ namespace gsr {
|
|||||||
mgl::Text text;
|
mgl::Text text;
|
||||||
std::string id;
|
std::string id;
|
||||||
mgl::vec2f position;
|
mgl::vec2f position;
|
||||||
|
bool enabled = true;
|
||||||
};
|
};
|
||||||
|
|
||||||
mgl::vec2f max_size;
|
mgl::vec2f max_size;
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
project('gsr-ui', ['c', 'cpp'], version : '1.7.4', default_options : ['warning_level=2', 'cpp_std=c++17'], subproject_dir : 'depends')
|
project('gsr-ui', ['c', 'cpp'], version : '1.7.5', default_options : ['warning_level=2', 'cpp_std=c++17'], subproject_dir : 'depends')
|
||||||
|
|
||||||
add_project_arguments('-D_FILE_OFFSET_BITS=64', language : ['c', 'cpp'])
|
add_project_arguments('-D_FILE_OFFSET_BITS=64', language : ['c', 'cpp'])
|
||||||
|
|
||||||
@@ -65,7 +65,7 @@ datadir = get_option('datadir')
|
|||||||
gsr_ui_resources_path = join_paths(prefix, datadir, 'gsr-ui')
|
gsr_ui_resources_path = join_paths(prefix, datadir, 'gsr-ui')
|
||||||
|
|
||||||
add_project_arguments('-DGSR_UI_VERSION="' + meson.project_version() + '"', language: ['c', 'cpp'])
|
add_project_arguments('-DGSR_UI_VERSION="' + meson.project_version() + '"', language: ['c', 'cpp'])
|
||||||
add_project_arguments('-DGSR_FLATPAK_VERSION="5.7.6"', language: ['c', 'cpp'])
|
add_project_arguments('-DGSR_FLATPAK_VERSION="5.7.8"', language: ['c', 'cpp'])
|
||||||
|
|
||||||
executable(
|
executable(
|
||||||
meson.project_name(),
|
meson.project_name(),
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
[package]
|
[package]
|
||||||
name = "gsr-ui"
|
name = "gsr-ui"
|
||||||
type = "executable"
|
type = "executable"
|
||||||
version = "1.7.4"
|
version = "1.7.5"
|
||||||
platforms = ["posix"]
|
platforms = ["posix"]
|
||||||
|
|
||||||
[lang.cpp]
|
[lang.cpp]
|
||||||
|
|||||||
@@ -2560,6 +2560,14 @@ namespace gsr {
|
|||||||
*container = change_container_if_codec_not_supported(*video_codec, *container);
|
*container = change_container_if_codec_not_supported(*video_codec, *container);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static std::string get_framerate_mode_validate(const RecordOptions &record_options, const GsrInfo &gsr_info) {
|
||||||
|
(void)gsr_info;
|
||||||
|
std::string framerate_mode = record_options.framerate_mode;
|
||||||
|
if(framerate_mode == "auto")
|
||||||
|
framerate_mode = "vfr";
|
||||||
|
return framerate_mode;
|
||||||
|
}
|
||||||
|
|
||||||
bool Overlay::on_press_start_replay(bool disable_notification, bool finished_selection) {
|
bool Overlay::on_press_start_replay(bool disable_notification, bool finished_selection) {
|
||||||
if(region_selector.is_started() || window_selector.is_started())
|
if(region_selector.is_started() || window_selector.is_started())
|
||||||
return false;
|
return false;
|
||||||
@@ -2632,7 +2640,7 @@ namespace gsr {
|
|||||||
const std::string video_bitrate = std::to_string(config.replay_config.record_options.video_bitrate);
|
const std::string video_bitrate = std::to_string(config.replay_config.record_options.video_bitrate);
|
||||||
const std::string output_directory = config.replay_config.save_directory;
|
const std::string output_directory = config.replay_config.save_directory;
|
||||||
const std::vector<std::string> audio_tracks = create_audio_tracks_cli_args(config.replay_config.record_options.audio_tracks_list, gsr_info);
|
const std::vector<std::string> audio_tracks = create_audio_tracks_cli_args(config.replay_config.record_options.audio_tracks_list, gsr_info);
|
||||||
const std::string framerate_mode = config.replay_config.record_options.framerate_mode == "auto" ? "vfr" : config.replay_config.record_options.framerate_mode;
|
const std::string framerate_mode = get_framerate_mode_validate(config.replay_config.record_options, gsr_info);
|
||||||
const std::string replay_time = std::to_string(config.replay_config.replay_time);
|
const std::string replay_time = std::to_string(config.replay_config.replay_time);
|
||||||
const char *container = config.replay_config.container.c_str();
|
const char *container = config.replay_config.container.c_str();
|
||||||
const char *video_codec = config.replay_config.record_options.video_codec.c_str();
|
const char *video_codec = config.replay_config.record_options.video_codec.c_str();
|
||||||
@@ -2829,7 +2837,7 @@ namespace gsr {
|
|||||||
const std::string video_bitrate = std::to_string(config.record_config.record_options.video_bitrate);
|
const std::string video_bitrate = std::to_string(config.record_config.record_options.video_bitrate);
|
||||||
const std::string output_file = config.record_config.save_directory + "/Video_" + get_date_str() + "." + container_to_file_extension(config.record_config.container.c_str());
|
const std::string output_file = config.record_config.save_directory + "/Video_" + get_date_str() + "." + container_to_file_extension(config.record_config.container.c_str());
|
||||||
const std::vector<std::string> audio_tracks = create_audio_tracks_cli_args(config.record_config.record_options.audio_tracks_list, gsr_info);
|
const std::vector<std::string> audio_tracks = create_audio_tracks_cli_args(config.record_config.record_options.audio_tracks_list, gsr_info);
|
||||||
const std::string framerate_mode = config.record_config.record_options.framerate_mode == "auto" ? "vfr" : config.record_config.record_options.framerate_mode;
|
const std::string framerate_mode = get_framerate_mode_validate(config.record_config.record_options, gsr_info);
|
||||||
const char *container = config.record_config.container.c_str();
|
const char *container = config.record_config.container.c_str();
|
||||||
const char *video_codec = config.record_config.record_options.video_codec.c_str();
|
const char *video_codec = config.record_config.record_options.video_codec.c_str();
|
||||||
const char *encoder = "gpu";
|
const char *encoder = "gpu";
|
||||||
@@ -3005,7 +3013,7 @@ namespace gsr {
|
|||||||
// But we check it anyways as streaming on some sites can fail if there is more than one audio track
|
// But we check it anyways as streaming on some sites can fail if there is more than one audio track
|
||||||
if(audio_tracks.size() > 1)
|
if(audio_tracks.size() > 1)
|
||||||
audio_tracks.resize(1);
|
audio_tracks.resize(1);
|
||||||
const std::string framerate_mode = config.streaming_config.record_options.framerate_mode == "auto" ? "vfr" : config.streaming_config.record_options.framerate_mode;
|
const std::string framerate_mode = get_framerate_mode_validate(config.streaming_config.record_options, gsr_info);
|
||||||
const char *container = "flv";
|
const char *container = "flv";
|
||||||
if(config.streaming_config.streaming_service == "custom")
|
if(config.streaming_config.streaming_service == "custom")
|
||||||
container = config.streaming_config.custom.container.c_str();
|
container = config.streaming_config.custom.container.c_str();
|
||||||
|
|||||||
@@ -36,7 +36,7 @@ namespace gsr {
|
|||||||
for(size_t i = 0; i < items.size(); ++i) {
|
for(size_t i = 0; i < items.size(); ++i) {
|
||||||
Item &item = items[i];
|
Item &item = items[i];
|
||||||
item_size.y = padding_top + item.text.get_bounds().size.y + padding_bottom;
|
item_size.y = padding_top + item.text.get_bounds().size.y + padding_bottom;
|
||||||
if(mgl::FloatRect(item.position, item_size).contains(mouse_pos)) {
|
if(mgl::FloatRect(item.position, item_size).contains(mouse_pos) && item.enabled) {
|
||||||
const size_t prev_selected_item = selected_item;
|
const size_t prev_selected_item = selected_item;
|
||||||
selected_item = i;
|
selected_item = i;
|
||||||
show_dropdown = false;
|
show_dropdown = false;
|
||||||
@@ -93,7 +93,7 @@ namespace gsr {
|
|||||||
void ComboBox::set_selected_item(const std::string &id, bool trigger_event, bool trigger_event_even_if_selection_not_changed) {
|
void ComboBox::set_selected_item(const std::string &id, bool trigger_event, bool trigger_event_even_if_selection_not_changed) {
|
||||||
for(size_t i = 0; i < items.size(); ++i) {
|
for(size_t i = 0; i < items.size(); ++i) {
|
||||||
auto &item = items[i];
|
auto &item = items[i];
|
||||||
if(item.id == id) {
|
if(item.id == id && item.enabled) {
|
||||||
const size_t prev_selected_item = selected_item;
|
const size_t prev_selected_item = selected_item;
|
||||||
selected_item = i;
|
selected_item = i;
|
||||||
dirty = true;
|
dirty = true;
|
||||||
@@ -106,6 +106,22 @@ namespace gsr {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void ComboBox::set_item_enabled(const std::string &id, bool enabled) {
|
||||||
|
for(size_t i = 0; i < items.size(); ++i) {
|
||||||
|
auto &item = items[i];
|
||||||
|
if(item.id == id) {
|
||||||
|
item.enabled = enabled;
|
||||||
|
item.text.set_color(item.enabled ? mgl::Color(255, 255, 255, 255) : mgl::Color(255, 255, 255, 80));
|
||||||
|
if(selected_item == i) {
|
||||||
|
selected_item = 0;
|
||||||
|
show_dropdown = false;
|
||||||
|
dirty = true;
|
||||||
|
}
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
const std::string& ComboBox::get_selected_id() const {
|
const std::string& ComboBox::get_selected_id() const {
|
||||||
if(items.empty()) {
|
if(items.empty()) {
|
||||||
static std::string dummy;
|
static std::string dummy;
|
||||||
@@ -150,7 +166,7 @@ namespace gsr {
|
|||||||
Item &item = items[i];
|
Item &item = items[i];
|
||||||
item_size.y = padding_top + item.text.get_bounds().size.y + padding_bottom;
|
item_size.y = padding_top + item.text.get_bounds().size.y + padding_bottom;
|
||||||
|
|
||||||
if(!cursor_inside) {
|
if(!cursor_inside && item.enabled) {
|
||||||
cursor_inside = mgl::FloatRect(items_draw_pos, item_size).contains(mouse_pos);
|
cursor_inside = mgl::FloatRect(items_draw_pos, item_size).contains(mouse_pos);
|
||||||
if(cursor_inside) {
|
if(cursor_inside) {
|
||||||
mgl::Rectangle item_background(items_draw_pos.floor(), item_size.floor());
|
mgl::Rectangle item_background(items_draw_pos.floor(), item_size.floor());
|
||||||
|
|||||||
@@ -568,6 +568,10 @@ namespace gsr {
|
|||||||
framerate_mode_box->add_item("Auto (Recommended)", "auto");
|
framerate_mode_box->add_item("Auto (Recommended)", "auto");
|
||||||
framerate_mode_box->add_item("Constant", "cfr");
|
framerate_mode_box->add_item("Constant", "cfr");
|
||||||
framerate_mode_box->add_item("Variable", "vfr");
|
framerate_mode_box->add_item("Variable", "vfr");
|
||||||
|
if(gsr_info->system_info.display_server == DisplayServer::X11)
|
||||||
|
framerate_mode_box->add_item("Sync to content", "content");
|
||||||
|
else
|
||||||
|
framerate_mode_box->add_item("Sync to content (Only X11 or desktop portal capture)", "content");
|
||||||
framerate_mode_box_ptr = framerate_mode_box.get();
|
framerate_mode_box_ptr = framerate_mode_box.get();
|
||||||
return framerate_mode_box;
|
return framerate_mode_box;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -195,7 +195,9 @@ enum class LaunchAction {
|
|||||||
|
|
||||||
int main(int argc, char **argv) {
|
int main(int argc, char **argv) {
|
||||||
setlocale(LC_ALL, "C"); // Sigh... stupid C
|
setlocale(LC_ALL, "C"); // Sigh... stupid C
|
||||||
|
#ifdef __GLIBC__
|
||||||
mallopt(M_MMAP_THRESHOLD, 65536);
|
mallopt(M_MMAP_THRESHOLD, 65536);
|
||||||
|
#endif
|
||||||
|
|
||||||
if(geteuid() == 0) {
|
if(geteuid() == 0) {
|
||||||
fprintf(stderr, "Error: don't run gsr-ui as the root user\n");
|
fprintf(stderr, "Error: don't run gsr-ui as the root user\n");
|
||||||
|
|||||||
Reference in New Issue
Block a user