Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feature request: Consider adding support for GtkGraphicsOffload / zero-copy playback on Wayland #927

Open
rmader opened this issue Feb 13, 2024 · 3 comments

Comments

@rmader
Copy link

rmader commented Feb 13, 2024

This is probably low-prio for now, however: GTK4 4.14 got a new feature allowing graphics offloading to the Wayland compositor (possibly in the future also for other platforms). See also https://blog.gtk.org/2023/11/15/introducing-graphics-offload/

Doing so allows using hardware features of modern GPUs / display controllers for YCbCr to RGB conversion and scaling, which in many cases can reduce power usage significantly - and in case for low-end hardware like embedded SoCs avoid frame skips.

I'm not very familiar with the mpv code, however it already has a native backend for Wayland offloading which could serve as inspiration (--vo=dmabuf-wayland). It's likely that this will only work in combination with hardware decoding (VA-API / V4L2 / Vulkan).

I personally have been involved with making the Gstreamer demo client use it (gtk4-demo --run=video_player, and also did a MR for another simple Gstreamer based client (https://gitlab.gnome.org/guidog/livi/-/merge_requests/35). In case you consider working on this, please feel free to contact me for questions/reviews etc.


See also: https://codeberg.org/avery42/delfin/issues/69

@gnome-mpv
Copy link
Collaborator

That'd be nice to have, but I don't think you can implement it with libmpv right now. There's no way to get dmabuf fd from mpv AFAIK.

@benjamin-otte
Copy link

Is that tracked in MPV somewhere? mpv-player/mpv#11031 ?

@gnome-mpv
Copy link
Collaborator

Is that tracked in MPV somewhere? mpv-player/mpv#11031 ?

Yeah, that looks right.

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

No branches or pull requests

3 participants