mirror of
https://repo.dec05eba.com/gpu-screen-recorder-ui
synced 2026-03-31 09:17:04 +09:00
gsr-overlay > gsr-ui
This commit is contained in:
@@ -1,17 +1,17 @@
|
|||||||
# GPU Screen Recorder Overlay
|
# GPU Screen Recorder UI
|
||||||
A fullscreen overlay UI for [GPU Screen Recorder](https://git.dec05eba.com/gpu-screen-recorder/about/), in the style of ShadowPlay.
|
A fullscreen overlay UI for [GPU Screen Recorder](https://git.dec05eba.com/gpu-screen-recorder/about/), in the style of ShadowPlay.
|
||||||
|
|
||||||
# Dependencies
|
# Dependencies
|
||||||
GPU Screen Recorder overlay uses meson build system so you need to install `meson` to build GPU Screen Recorder overlay.
|
GPU Screen Recorder UI uses meson build system so you need to install `meson` to build GPU Screen Recorder UI.
|
||||||
|
|
||||||
## Build dependencies
|
## Build dependencies
|
||||||
These are the dependencies needed to build GPU Screen Recorder overlay:
|
These are the dependencies needed to build GPU Screen Recorder UI:
|
||||||
|
|
||||||
* x11 (libx11, libxrandr, libxrender, libxfixes)
|
* x11 (libx11, libxrandr, libxrender, libxfixes)
|
||||||
* libglvnd (which provides libgl, libglx and libegl)
|
* libglvnd (which provides libgl, libglx and libegl)
|
||||||
|
|
||||||
# Installation
|
# Installation
|
||||||
Run `sudo ./install.sh`. This will install gsr-overlay to `/usr/bin/gsr-overlay`. You can run meson commands manually to install gsr-overlay to another directory.
|
Run `sudo ./install.sh`. This will install gsr-ui to `/usr/bin/gsr-ui`. You can run meson commands manually to install gsr-ui to another directory.
|
||||||
|
|
||||||
# License
|
# License
|
||||||
This software is licensed under GPL3.0-only. Files under `fonts/` directory are licensed under `SIL Open Font License`.
|
This software is licensed under GPL3.0-only. Files under `fonts/` directory are licensed under `SIL Open Font License`.
|
||||||
|
|||||||
10
TODO
10
TODO
@@ -28,8 +28,8 @@ For system startup dont allow default output/input audio, as that can change aft
|
|||||||
|
|
||||||
Make hotkeys configurable.
|
Make hotkeys configurable.
|
||||||
|
|
||||||
Move hotkey to gsr-overlay-daemon which should execute gpu-screen-recorder --info on start, write that output to /tmp/blabla (or $XDG_RUNTIME_DIR) and gsr-overlay
|
Move hotkey to gsr-ui-daemon which should execute gpu-screen-recorder --info on start, write that output to /tmp/blabla (or $XDG_RUNTIME_DIR) and gsr-ui
|
||||||
should read that tmp file. gsr-overlay should remove show/hide functions for overlay and run show on startup.
|
should read that tmp file. gsr-ui should remove show/hide functions for overlay and run show on startup.
|
||||||
|
|
||||||
Combobox shouldn't show all items if its the combobox at the bottom and scrolling is needed to show them all.
|
Combobox shouldn't show all items if its the combobox at the bottom and scrolling is needed to show them all.
|
||||||
|
|
||||||
@@ -48,4 +48,8 @@ Show warning when selecting hevc/av1 on amd because of amd driver/ffmpeg bug.
|
|||||||
Update gsr info and validate saved config when monitors update. The selected monitor/audio may no longer be available.
|
Update gsr info and validate saved config when monitors update. The selected monitor/audio may no longer be available.
|
||||||
|
|
||||||
Have different modes. Overlay, window and side menu. Overlay can be used on x11, window and side menu can be used on both x11 and wayland.
|
Have different modes. Overlay, window and side menu. Overlay can be used on x11, window and side menu can be used on both x11 and wayland.
|
||||||
Window mode should look similar to overlay.
|
Window mode should look similar to overlay.
|
||||||
|
|
||||||
|
Look at /home/dec05eba/git/global-hotkeys for hotkeys.
|
||||||
|
|
||||||
|
Show navigation breadcrumbs for settings and deeper navigation (such as selecting a directory to save videos).
|
||||||
@@ -10,4 +10,4 @@ meson setup build
|
|||||||
meson configure --prefix=/usr --buildtype=release -Dstrip=true build
|
meson configure --prefix=/usr --buildtype=release -Dstrip=true build
|
||||||
ninja -C build install
|
ninja -C build install
|
||||||
|
|
||||||
echo "Successfully installed gsr-overlay"
|
echo "Successfully installed gsr-ui"
|
||||||
|
|||||||
14
meson.build
14
meson.build
@@ -1,4 +1,4 @@
|
|||||||
project('gsr-overlay', ['c', 'cpp'], version : '1.0.0', default_options : ['warning_level=2', 'cpp_std=c++17'], subproject_dir : 'depends')
|
project('gsr-ui', ['c', 'cpp'], version : '1.0.0', default_options : ['warning_level=2', 'cpp_std=c++17'], subproject_dir : 'depends')
|
||||||
|
|
||||||
if get_option('buildtype') == 'debug'
|
if get_option('buildtype') == 'debug'
|
||||||
add_project_arguments('-g3', language : ['c', 'cpp'])
|
add_project_arguments('-g3', language : ['c', 'cpp'])
|
||||||
@@ -47,22 +47,22 @@ dep = [
|
|||||||
|
|
||||||
prefix = get_option('prefix')
|
prefix = get_option('prefix')
|
||||||
datadir = get_option('datadir')
|
datadir = get_option('datadir')
|
||||||
gsr_overlay_resources_path = join_paths(prefix, datadir, 'gsr-overlay')
|
gsr_ui_resources_path = join_paths(prefix, datadir, 'gsr-ui')
|
||||||
|
|
||||||
executable(
|
executable(
|
||||||
meson.project_name(),
|
meson.project_name(),
|
||||||
src,
|
src,
|
||||||
install : true,
|
install : true,
|
||||||
dependencies : dep,
|
dependencies : dep,
|
||||||
cpp_args : '-DGSR_OVERLAY_RESOURCES_PATH="' + gsr_overlay_resources_path + '"',
|
cpp_args : '-DGSR_UI_RESOURCES_PATH="' + gsr_ui_resources_path + '"',
|
||||||
)
|
)
|
||||||
|
|
||||||
executable(
|
executable(
|
||||||
'gsr-overlay-daemon',
|
'gsr-ui-daemon',
|
||||||
['gpu-screen-recorder-overlay-daemon/main.c'],
|
['gsr-ui-daemon/main.c'],
|
||||||
install : true,
|
install : true,
|
||||||
dependencies : [dependency('x11')],
|
dependencies : [dependency('x11')],
|
||||||
)
|
)
|
||||||
|
|
||||||
install_subdir('images', install_dir : gsr_overlay_resources_path)
|
install_subdir('images', install_dir : gsr_ui_resources_path)
|
||||||
install_subdir('fonts', install_dir : gsr_overlay_resources_path)
|
install_subdir('fonts', install_dir : gsr_ui_resources_path)
|
||||||
@@ -1,5 +1,5 @@
|
|||||||
[package]
|
[package]
|
||||||
name = "gsr-overlay"
|
name = "gsr-ui"
|
||||||
type = "executable"
|
type = "executable"
|
||||||
version = "0.1.0"
|
version = "0.1.0"
|
||||||
platforms = ["posix"]
|
platforms = ["posix"]
|
||||||
@@ -8,7 +8,7 @@ platforms = ["posix"]
|
|||||||
version = "c++17"
|
version = "c++17"
|
||||||
|
|
||||||
[config]
|
[config]
|
||||||
ignore_dirs = ["build", "gpu-screen-recorder-overlay-daemon"]
|
ignore_dirs = ["build", "gsr-ui-daemon"]
|
||||||
|
|
||||||
[dependencies]
|
[dependencies]
|
||||||
xcomposite = ">=0"
|
xcomposite = ">=0"
|
||||||
@@ -111,7 +111,7 @@ namespace gsr {
|
|||||||
std::optional<Config> read_config() {
|
std::optional<Config> read_config() {
|
||||||
std::optional<Config> config;
|
std::optional<Config> config;
|
||||||
|
|
||||||
const std::string config_path = get_config_dir() + "/overlay_config";
|
const std::string config_path = get_config_dir() + "/config_ui";
|
||||||
std::string file_content;
|
std::string file_content;
|
||||||
if(!file_get_content(config_path.c_str(), file_content)) {
|
if(!file_get_content(config_path.c_str(), file_content)) {
|
||||||
fprintf(stderr, "Warning: Failed to read config file: %s\n", config_path.c_str());
|
fprintf(stderr, "Warning: Failed to read config file: %s\n", config_path.c_str());
|
||||||
@@ -173,7 +173,7 @@ namespace gsr {
|
|||||||
void save_config(Config &config) {
|
void save_config(Config &config) {
|
||||||
config.main_config.config_file_version = CONFIG_FILE_VERSION;
|
config.main_config.config_file_version = CONFIG_FILE_VERSION;
|
||||||
|
|
||||||
const std::string config_path = get_config_dir() + "/overlay_config";
|
const std::string config_path = get_config_dir() + "/config_ui";
|
||||||
|
|
||||||
char dir_tmp[PATH_MAX];
|
char dir_tmp[PATH_MAX];
|
||||||
snprintf(dir_tmp, sizeof(dir_tmp), "%s", config_path.c_str());
|
snprintf(dir_tmp, sizeof(dir_tmp), "%s", config_path.c_str());
|
||||||
|
|||||||
@@ -553,7 +553,7 @@ namespace gsr {
|
|||||||
|
|
||||||
std::optional<std::string> status_filepath = get_gsr_runtime_dir();
|
std::optional<std::string> status_filepath = get_gsr_runtime_dir();
|
||||||
if(!status_filepath)
|
if(!status_filepath)
|
||||||
throw std::runtime_error("Failed to find/create runtime directory /run/user/.../gsr-overlay or /tmp/gsr-overlay");
|
throw std::runtime_error("Failed to find/create runtime directory /run/user/.../gsr-ui or /tmp/gsr-ui");
|
||||||
|
|
||||||
status_filepath.value() += "/status";
|
status_filepath.value() += "/status";
|
||||||
|
|
||||||
@@ -567,7 +567,7 @@ namespace gsr {
|
|||||||
void Overlay::save_program_status() {
|
void Overlay::save_program_status() {
|
||||||
std::optional<std::string> status_filepath = get_gsr_runtime_dir();
|
std::optional<std::string> status_filepath = get_gsr_runtime_dir();
|
||||||
if(!status_filepath)
|
if(!status_filepath)
|
||||||
throw std::runtime_error("Failed to find/create runtime directory /run/user/.../gsr-overlay or /tmp/gsr-overlay");
|
throw std::runtime_error("Failed to find/create runtime directory /run/user/.../gsr-ui or /tmp/gsr-ui");
|
||||||
|
|
||||||
status_filepath.value() += "/status";
|
status_filepath.value() += "/status";
|
||||||
if(!file_overwrite(status_filepath.value().c_str(), recording_status_to_string(recording_status)))
|
if(!file_overwrite(status_filepath.value().c_str(), recording_status_to_string(recording_status)))
|
||||||
@@ -579,7 +579,7 @@ namespace gsr {
|
|||||||
|
|
||||||
std::optional<std::string> status_filepath = get_gsr_runtime_dir();
|
std::optional<std::string> status_filepath = get_gsr_runtime_dir();
|
||||||
if(!status_filepath)
|
if(!status_filepath)
|
||||||
throw std::runtime_error("Failed to find/create runtime directory /run/user/.../gsr-overlay or /tmp/gsr-overlay");
|
throw std::runtime_error("Failed to find/create runtime directory /run/user/.../gsr-ui or /tmp/gsr-ui");
|
||||||
|
|
||||||
status_filepath.value() += "/pid";
|
status_filepath.value() += "/pid";
|
||||||
|
|
||||||
@@ -599,12 +599,12 @@ namespace gsr {
|
|||||||
char program_arg0[PATH_MAX];
|
char program_arg0[PATH_MAX];
|
||||||
program_arg0[0] = '\0';
|
program_arg0[0] = '\0';
|
||||||
if(!read_cmdline_arg0(cmdline_path, program_arg0)) {
|
if(!read_cmdline_arg0(cmdline_path, program_arg0)) {
|
||||||
fprintf(stderr, "Error: failed to parse arg0 from file %s. Was the gpu-screen-recorder process that was started by gsr-overlay closed by another program or the user?\n", cmdline_path);
|
fprintf(stderr, "Error: failed to parse arg0 from file %s. Was the gpu-screen-recorder process that was started by gsr-ui closed by another program or the user?\n", cmdline_path);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
if(strcmp(program_arg0, "gpu-screen-recorder") != 0) {
|
if(strcmp(program_arg0, "gpu-screen-recorder") != 0) {
|
||||||
fprintf(stderr, "Warning: process %d exists but doesn't belong to gpu-screen-recorder (is instead %s). Was the gpu-screen-recorder process that was started by gsr-overlay closed by another program or the user?\n", pid, program_arg0);
|
fprintf(stderr, "Warning: process %d exists but doesn't belong to gpu-screen-recorder (is instead %s). Was the gpu-screen-recorder process that was started by gsr-ui closed by another program or the user?\n", pid, program_arg0);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -614,7 +614,7 @@ namespace gsr {
|
|||||||
void Overlay::save_program_pid() {
|
void Overlay::save_program_pid() {
|
||||||
std::optional<std::string> status_filepath = get_gsr_runtime_dir();
|
std::optional<std::string> status_filepath = get_gsr_runtime_dir();
|
||||||
if(!status_filepath)
|
if(!status_filepath)
|
||||||
throw std::runtime_error("Failed to find/create runtime directory /run/user/.../gsr-overlay or /tmp/gsr-overlay");
|
throw std::runtime_error("Failed to find/create runtime directory /run/user/.../gsr-ui or /tmp/gsr-ui");
|
||||||
|
|
||||||
status_filepath.value() += "/pid";
|
status_filepath.value() += "/pid";
|
||||||
|
|
||||||
@@ -627,7 +627,7 @@ namespace gsr {
|
|||||||
void Overlay::recording_stopped_remove_runtime_files() {
|
void Overlay::recording_stopped_remove_runtime_files() {
|
||||||
std::optional<std::string> status_filepath = get_gsr_runtime_dir();
|
std::optional<std::string> status_filepath = get_gsr_runtime_dir();
|
||||||
if(!status_filepath) {
|
if(!status_filepath) {
|
||||||
fprintf(stderr, "Error: Failed to find/create runtime directory /run/user/.../gsr-overlay or /tmp/gsr-overlay");
|
fprintf(stderr, "Error: Failed to find/create runtime directory /run/user/.../gsr-ui or /tmp/gsr-ui");
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -11,7 +11,7 @@
|
|||||||
|
|
||||||
namespace gsr {
|
namespace gsr {
|
||||||
static void debug_print_args(const char **args) {
|
static void debug_print_args(const char **args) {
|
||||||
fprintf(stderr, "gsr-overlay info: running command:");
|
fprintf(stderr, "gsr-ui info: running command:");
|
||||||
while(*args) {
|
while(*args) {
|
||||||
fprintf(stderr, " %s", *args);
|
fprintf(stderr, " %s", *args);
|
||||||
++args;
|
++args;
|
||||||
|
|||||||
@@ -208,7 +208,7 @@ namespace gsr {
|
|||||||
if(stat(runtime_dir_path, &st) == -1 || !S_ISDIR(st.st_mode))
|
if(stat(runtime_dir_path, &st) == -1 || !S_ISDIR(st.st_mode))
|
||||||
snprintf(runtime_dir_path, sizeof(runtime_dir_path), "/tmp");
|
snprintf(runtime_dir_path, sizeof(runtime_dir_path), "/tmp");
|
||||||
|
|
||||||
strcat(runtime_dir_path, "/gsr-overlay");
|
strcat(runtime_dir_path, "/gsr-ui");
|
||||||
if(create_directory_recursive(runtime_dir_path) != 0)
|
if(create_directory_recursive(runtime_dir_path) != 0)
|
||||||
return result;
|
return result;
|
||||||
|
|
||||||
|
|||||||
@@ -138,7 +138,7 @@ namespace gsr {
|
|||||||
|
|
||||||
DIR *d = opendir(directory);
|
DIR *d = opendir(directory);
|
||||||
if(!d) {
|
if(!d) {
|
||||||
fprintf(stderr, "gsr-overlay error: failed to open directory: %s, error: %s\n", directory, strerror(errno));
|
fprintf(stderr, "gsr-ui error: failed to open directory: %s, error: %s\n", directory, strerror(errno));
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -48,8 +48,9 @@ namespace gsr {
|
|||||||
std::unique_ptr<ComboBox> SettingsPage::create_record_area_box(const GsrInfo &gsr_info) {
|
std::unique_ptr<ComboBox> SettingsPage::create_record_area_box(const GsrInfo &gsr_info) {
|
||||||
auto record_area_box = std::make_unique<ComboBox>(&get_theme().body_font);
|
auto record_area_box = std::make_unique<ComboBox>(&get_theme().body_font);
|
||||||
// TODO: Show options not supported but disable them
|
// TODO: Show options not supported but disable them
|
||||||
if(gsr_info.supported_capture_options.window)
|
// TODO: Enable this
|
||||||
record_area_box->add_item("Window", "window");
|
//if(gsr_info.supported_capture_options.window)
|
||||||
|
// record_area_box->add_item("Window", "window");
|
||||||
if(gsr_info.supported_capture_options.focused)
|
if(gsr_info.supported_capture_options.focused)
|
||||||
record_area_box->add_item("Follow focused window", "focused");
|
record_area_box->add_item("Follow focused window", "focused");
|
||||||
if(gsr_info.supported_capture_options.screen)
|
if(gsr_info.supported_capture_options.screen)
|
||||||
|
|||||||
@@ -72,10 +72,10 @@ int main(int argc, char **argv) {
|
|||||||
if(access("images/gpu_screen_recorder_logo.png", F_OK) == 0) {
|
if(access("images/gpu_screen_recorder_logo.png", F_OK) == 0) {
|
||||||
resources_path = "./";
|
resources_path = "./";
|
||||||
} else {
|
} else {
|
||||||
#ifdef GSR_OVERLAY_RESOURCES_PATH
|
#ifdef GSR_UI_RESOURCES_PATH
|
||||||
resources_path = GSR_OVERLAY_RESOURCES_PATH "/";
|
resources_path = GSR_UI_RESOURCES_PATH "/";
|
||||||
#else
|
#else
|
||||||
resources_path = "/usr/share/gsr-overlay/";
|
resources_path = "/usr/share/gsr-ui/";
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -7,5 +7,4 @@ cd "$script_dir"
|
|||||||
|
|
||||||
ninja -C build uninstall
|
ninja -C build uninstall
|
||||||
|
|
||||||
echo "Successfully uninstalled gsr-overlay"
|
echo "Successfully uninstalled gsr-ui"
|
||||||
c
|
|
||||||
Reference in New Issue
Block a user