Skip to content

Commit

Permalink
feat(MediaViewer): enable GraphicsOffload for videos
Browse files Browse the repository at this point in the history
In order to allow pass-through of video content to Wayland compositors,
reducing copies on the GPU and thus improving battery life and
performance.

This change should generally be safe to do, however given the higher
chances of triggering driver bugs good testing is due.
  • Loading branch information
rmader committed Apr 18, 2024
1 parent 8c945cd commit 29c486e
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions src/Views/MediaViewer.vala
Original file line number Diff line number Diff line change
Expand Up @@ -826,6 +826,9 @@ public class Tuba.Views.MediaViewer : Gtk.Widget, Gtk.Buildable, Adw.Swipeable {

if (media_type.is_video ()) {
var video = new Gtk.Video ();

video.graphics_offload = Gtk.GraphicsOffloadEnabled.ENABLED;

if (media_type == Tuba.Attachment.MediaType.GIFV) {
video.loop = true;
video.autoplay = true;
Expand Down

0 comments on commit 29c486e

Please sign in to comment.