Skip to content

Use waylandsink in Wayland sessions for GStreamer 1.16+#425

Open
Integral-Tech wants to merge 3 commits intoFDH2:masterfrom
Integral-Tech:use-waylandsink-on-wayland
Open

Use waylandsink in Wayland sessions for GStreamer 1.16+#425
Integral-Tech wants to merge 3 commits intoFDH2:masterfrom
Integral-Tech:use-waylandsink-on-wayland

Conversation

@Integral-Tech
Copy link

Use waylandsink instead of xvimagesink/ximagesink in Wayland sessions.

@fduncanh
Copy link
Collaborator

Thanks, we will look into this. Does autovideosink fail to choose waylandsink when appropriate?

@Integral-Tech
Copy link
Author

@fduncanh Yes, XWayland is used by default in Wayland sessions.

@fduncanh
Copy link
Collaborator

fduncanh commented Jul 4, 2025

Has waylandsink been improving with time? Would it be appropriate to only make waylandsink the default choice if gstreamer version is sufficiently new?

@Integral-Tech Integral-Tech force-pushed the use-waylandsink-on-wayland branch 3 times, most recently from bd28e3b to 0d80c3a Compare July 5, 2025 03:18
Use waylandsink instead of xvimagesink/ximagesink in Wayland sessions
for GStreamer 1.16+.
@Integral-Tech Integral-Tech force-pushed the use-waylandsink-on-wayland branch from 0d80c3a to 6381af2 Compare July 5, 2025 03:31
@Integral-Tech Integral-Tech changed the title Use waylandsink in Wayland sessions Use waylandsink in Wayland sessions for GStreamer 1.16+ Jul 5, 2025
@Integral-Tech
Copy link
Author

@fduncanh Now waylandsink is selected by default for GStreamer 1.16+ :)

@fduncanh
Copy link
Collaborator

fduncanh commented Aug 7, 2025

@Integral-Tech

Now waylandsink is selected by default for GStreamer 1.16+ :)

does this mean the fix is not actually needed?

If needed, this code below should be done in renderers/video_renderer.c (video_renderer_init) and renderers/x_display_fix.h

   guint major, minor, micro, nano;


    gst_version (&major, &minor, &micro, &nano);


    if (major >= 1 && minor >= 16) {


    	const char *xdg_session_type = getenv("XDG_SESSION_TYPE");


    	if (xdg_session_type && strcmp(xdg_session_type, "wayland") == 0) {


            videosink = "waylandsink";


    	}


    }

@Integral-Tech
Copy link
Author

does this mean the fix is not actually needed?

@fduncanh No, I mean in my fix waylandsink is only selected for GStreamer 1.16+ on Wayland sessions.

@fduncanh
Copy link
Collaborator

fduncanh commented Aug 7, 2025

OK

so the issue is with autovideosink on a system with X11 support that chooses xvimagesink or ximagesink when wayland is active, on gstreamer >= 1.16.

XDG_SESSION_TYPE will only be set on a system with X11 so it can be tested for inside #ifdef X11_DISPLAY_FIX ... #endif

where does the gstreamer > =1.16 come from? is this when gstreamer started to have waylandsink?

@fduncanh
Copy link
Collaborator

fduncanh commented Aug 7, 2025

This is really a gstreamer autovideosink issue, though... maybe there is a gstreamer fix?
it could also be handled with a warning message suggesting the user uses -vs waylandsink ? (instead of overriding autovideosink)

this would test for Wayland when x[v]imagesink is selected and issue a terminal message if wayland is being used.

@fduncanh fduncanh force-pushed the master branch 12 times, most recently from 99017a7 to e0a2097 Compare August 8, 2025 16:16
@fduncanh fduncanh force-pushed the master branch 13 times, most recently from 7da91e4 to 9d28d27 Compare August 12, 2025 20:08
@fduncanh fduncanh force-pushed the master branch 11 times, most recently from a8ea903 to 738866a Compare August 31, 2025 14:51
@fduncanh fduncanh force-pushed the master branch 6 times, most recently from d8ce1d8 to a2592eb Compare September 8, 2025 16:36
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants