From cae84dfbf8b624d2a7c70b553d5b0bdb35f3ac78 Mon Sep 17 00:00:00 2001 From: fduncanh Date: Fri, 1 Oct 2021 03:12:49 -0400 Subject: [PATCH] reworked ZOOMFIX to only apply to autovideosink, xvimagesink, ximagesink --- README.md | 26 ++++++++++++-------------- renderers/video_renderer_gstreamer.c | 17 +++++------------ 2 files changed, 17 insertions(+), 26 deletions(-) diff --git a/README.md b/README.md index 8cc2cb3..6da9685 100644 --- a/README.md +++ b/README.md @@ -181,20 +181,17 @@ plugin for Intel graphics is *NOT* installed (**uninstall it** if it is installe reproduces the problem.) If you ran cmake with "-DZOOMFIX=ON", check if the problem is still there without ZOOMFIX. -ZOOMFIX does not fix the Zoom recognition issue for the OpenGL plugin glimagesink when it is running under X11, -and is specifically not used if uxplay is invoked using "-vs glimagesink". Please report, as an "issue" at -[https://github.com/FDH2/UxPlay](https://github.com/FDH2/UxPlay) , -any plugins that are broken -by ZOOMFIX, but work without it, so they can be added to the list of videosinks that don't use ZOOMFIX when it is available. +ZOOMFIX is only applied to the default videosink choice ("autovideosink") and the two X11 videosinks +"ximagesink" and "xvimagesink". ZOOMFIX is only designed for these last two, but it is possible that +autovideosink chooses a different videosink that is incompatible with ZOOMFIX. +If you are using the X11 windowing system (standard on Linux), and have trouble with screen-sharing on Zoom, use +ZOOMFIX and "-vs xvimagesink" (or "-vs ximagesink" if the previous choice doesn't work). +Other videosink choices are not affected by ZOOMFIX, and may or may not be visible to screen-sharing apps. +Windows created on Linux with "gtksink" are visible to screen-sharing aps without ZOOMFIX; windows on macOS created by +"glimagesink" (default choice) and "osximagesink" are also visible. -If your mirror window has no title showing, the "ZOOMFIX" will not work. -The window is created by GStreamer, using a videosink that the default "autovideosink" -has chosen for you. Maybe an unusual videosink was chosen. Fix: use the -vs option to make your own choice of videosink: -"-vs xvimagesink" or "-vs ximagesink" will create windows with titles on displays managed by X11. Note that ZOOMFIX is a fix for a -problem specific to X11 windows (or possibly other window types (Wayland ?) in an X11-compatibility mode). - -The "OpenGL renderer" window created by glimagesink sometimes does not close properly when its "close" button is clicked. +The "OpenGL renderer" window created on Linux by glimagesink sometimes does not close properly when its "close" button is clicked. (this is a GStreamer issue). You may need to terminate uxplay with Ctrl-C to close a "zombie" OpenGl window. # **Usage:** @@ -266,10 +263,11 @@ Also: image transforms that had been added to RPiPlay have been ported to UxPlay rotations; these are carried out after any **-f** transforms. **-vs _videosink_** chooses the GStreamer videosink, instead of letting - autovideosink pick it for you. For example, xvimagesink, vaapisink, or + autovideosink pick it for you. Some videosink choices are: ximagesink, xvimagesink, + vaapisink (for intel graphics), gtksink, glimagesink, waylandsink, osximagesink (for macOS), or fpsdisplaysink (which shows the streaming framerate in fps). Using quotes "..." might allow some parameters to be included with the videosink name. - (Some choices of videosink might not work on your system.) + (Some choices of videosink might not work on your system.) **-vs 0** suppresses display of streamed video, but plays streamed audio. (The client's screen is still mirrored at a reduced rate of 1 frame per second, but is not rendered or displayed.) diff --git a/renderers/video_renderer_gstreamer.c b/renderers/video_renderer_gstreamer.c index e2b16ad..ab229b7 100644 --- a/renderers/video_renderer_gstreamer.c +++ b/renderers/video_renderer_gstreamer.c @@ -136,12 +136,7 @@ video_renderer_t *video_renderer_init(logger_t *logger, const char *server_name, GString *launch = g_string_new("-e appsrc name=video_source stream-type=0 format=GST_FORMAT_TIME is-live=true !" "queue ! decodebin ! videoconvert ! "); append_videoflip(launch, &videoflip[0], &videoflip[1]); - /* replace "autovideosink" with "fpsdisplaysink" (from gstreamer-plugins-bad) to display framerate */ - if (videosink) { - g_string_append(launch, videosink); - } else { - g_string_append(launch, "autovideosink"); - } + g_string_append(launch, videosink); g_string_append(launch, " name=video_sink sync=false"); renderer->pipeline = gst_parse_launch(launch->str, &error); g_assert (renderer->pipeline); @@ -153,12 +148,10 @@ video_renderer_t *video_renderer_init(logger_t *logger, const char *server_name, #ifdef X_DISPLAY_FIX renderer->server_name = server_name; bool x_display_fix = true; - if (videosink) { - /* X_DISPLAY_FIX doesn't work with glimagesink*/ - /* list excluded videosinks: */ - if (strcmp(videosink,"0") == 0) x_display_fix = false; - if (strcmp(videosink,"glimagesink") == 0) x_display_fix = false; - } + x_display_fix = false; + if (strcmp(videosink,"autovideosink") == 0) x_display_fix = true; + if (strcmp(videosink,"ximagesink") == 0) x_display_fix = true; + if (strcmp(videosink,"xvimagesink") == 0) x_display_fix = true; if (x_display_fix) { renderer->gst_window = calloc(1, sizeof(X11_Window_t)); assert(renderer->gst_window);