Skip to content

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 3 times, most recently from d61c5a2 to 1faa495 Compare November 11, 2025 07:07
@fduncanh fduncanh force-pushed the master branch 11 times, most recently from a78f870 to 9e3887a Compare December 1, 2025 05:01
@fduncanh fduncanh force-pushed the master branch 8 times, most recently from 1ed1944 to 382b782 Compare December 18, 2025 18:26
@fduncanh fduncanh force-pushed the master branch 7 times, most recently from 8c4cdbd to 6d6b080 Compare December 28, 2025 16:57
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