Skip to content

Commit

Permalink
vo_dmabuf_wayland: support 90 degree rotations
Browse files Browse the repository at this point in the history
All we have to do is set VO_CAP_ROTATE90 and then use buffer transform.
Maybe ideally we would rotate with vavpp instead if possible, but this
would be a convoluted mess that I'm not really interested in dealing
with right now.
  • Loading branch information
Dudemanguy committed Sep 18, 2023
1 parent c6cef1b commit ed5c744
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions video/out/vo_dmabuf_wayland.c
Original file line number Diff line number Diff line change
Expand Up @@ -672,6 +672,8 @@ static int reconfig(struct vo *vo, struct mp_image *img)
if (!vo_wayland_reconfig(vo))
return VO_ERROR;

wl_surface_set_buffer_transform(vo->wl->video_surface, img->params.rotate / 90);

// Immediately destroy all buffers if params change.
destroy_buffers(vo);
return 0;
Expand Down Expand Up @@ -831,6 +833,7 @@ static int preinit(struct vo *vo)
const struct vo_driver video_out_dmabuf_wayland = {
.description = "Wayland dmabuf video output",
.name = "dmabuf-wayland",
.caps = VO_CAP_ROTATE90,
.preinit = preinit,
.query_format = query_format,
.reconfig2 = reconfig,
Expand Down

0 comments on commit ed5c744

Please sign in to comment.