The wp_viewport source rectangle is applied in surface-local coordinates after buffer_transform and buffer_scale. Therefore we need to swap width and height for 90/270 deg. rotations. This fixes playback of rotated videos such as portrait videos from mobile devices. See also: https://wayland.app/protocols/viewporter#wp_viewport Fixes: 0b648f9a2d ("waylandsink: Crop surfaces to their display width height") Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/7136>