diff options
author | dec05eba <dec05eba@protonmail.com> | 2024-07-18 21:37:06 +0200 |
---|---|---|
committer | dec05eba <dec05eba@protonmail.com> | 2024-07-18 21:37:06 +0200 |
commit | e2d1aa22034fd46c2c0eba047a9fdf3bb1ebacaf (patch) | |
tree | 4fb742ab52c3923e654eeb591fbbf9a11f8feace | |
parent | ae204d6e424682dadb0698b72435fee45fb323e0 (diff) |
Disable desktop portal capture option on x11 since it doesn't seem to be hardware accelerated
-rw-r--r-- | TODO | 2 | ||||
-rw-r--r-- | src/dbus.c | 4 | ||||
-rw-r--r-- | src/main.cpp | 12 |
3 files changed, 15 insertions, 3 deletions
@@ -155,3 +155,5 @@ Support hevc/av1 for software encoder and hdr support at the same time. Need sup Cleanup pipewire code and add more error checks. Detect if recording monitor on intel and plane is compressed. In that case give an error and tell the user to use -w portal instead. + +Make dbus code and pipewire setup non blocking.
\ No newline at end of file @@ -590,7 +590,7 @@ bool gsr_dbus_screencast_create_session(gsr_dbus *self, char **session_handle) { DBusMessage *response_msg = NULL; if(!gsr_dbus_call_screencast_method(self, "CreateSession", NULL, NULL, args, 2, NULL, &response_msg)) { - fprintf(stderr, "gsr error: gsr_dbus_screencast_create_session: failed to setup ScreenCast session. Make sure you have a desktop portal running with support for the ScreenCast interface (usually only available on Wayland) and that the desktop portal matches the Wayland compositor you are running.\n"); + fprintf(stderr, "gsr error: gsr_dbus_screencast_create_session: failed to setup ScreenCast session. Make sure you have a desktop portal running with support for the ScreenCast interface and that the desktop portal matches the Wayland compositor you are running.\n"); return false; } @@ -605,7 +605,7 @@ bool gsr_dbus_screencast_create_session(gsr_dbus *self, char **session_handle) { } if(!gsr_dbus_response_status_ok(&resp_args)) { - fprintf(stderr, "gsr error: gsr_dbus_screencast_create_session: failed to setup ScreenCast session. Make sure you have a desktop portal running with support for the ScreenCast interface (usually only available on Wayland) and that the desktop portal matches the Wayland compositor you are running.\n"); + fprintf(stderr, "gsr error: gsr_dbus_screencast_create_session: failed to setup ScreenCast session. Make sure you have a desktop portal running with support for the ScreenCast interface and that the desktop portal matches the Wayland compositor you are running.\n"); dbus_message_unref(response_msg); return false; } diff --git a/src/main.cpp b/src/main.cpp index 74fdaed..5cee51c 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -1014,7 +1014,7 @@ static void usage_full() { fprintf(stderr, "\n"); fprintf(stderr, "OPTIONS:\n"); fprintf(stderr, " -w Window id to record, a display (monitor name), \"screen\", \"screen-direct-force\", \"focused\" or \"portal\".\n"); - fprintf(stderr, " If this is \"portal\" then xdg desktop screencast portal with pipewire will be used. This is in general only available on Wayland.\n"); + fprintf(stderr, " If this is \"portal\" then xdg desktop screencast portal with pipewire will be used. Portal option is only available on Wayland.\n"); fprintf(stderr, " If you select to save the session (token) in the desktop portal capture popup then the session will be saved for the next time you use \"portal\",\n"); fprintf(stderr, " but the session will be ignored unless you run GPU Screen Recorder with the '-restore-portal-session yes' option.\n"); fprintf(stderr, " If this is \"screen\" or \"screen-direct-force\" then all monitors are recorded on Nvidia X11. On AMD/Intel or wayland \"screen\" will record the first monitor found.\n"); @@ -1667,6 +1667,10 @@ static void list_supported_capture_options(gsr_egl *egl, bool wayland) { } #ifdef GSR_PORTAL + // Desktop portal capture on x11 doesn't seem to be hardware accelerated + if(!wayland) + return; + gsr_dbus dbus; if(!gsr_dbus_init(&dbus, NULL)) return; @@ -1759,6 +1763,12 @@ static gsr_capture* create_capture_impl(const char *window_str, const char *scre follow_focused = true; } else if(strcmp(window_str, "portal") == 0) { #ifdef GSR_PORTAL + // Desktop portal capture on x11 doesn't seem to be hardware accelerated + if(!wayland) { + fprintf(stderr, "Error: desktop portal capture is not supported on X11\n"); + _exit(1); + } + if(video_codec_is_hdr(video_codec)) { fprintf(stderr, "Warning: portal capture option doesn't support hdr yet (pipewire doesn't support hdr)\n"); } |