Skip to content

camera: Add videoflip for rotation support

Robert Mader requested to merge rmader/libaperture:rotation-support into main

Cameras on mobile devices are often rotated by 90 degrees. Sometimes the sensor or the ISP can handle this in libcamera, but if not, it's left to clients to do so.

Pipewires libcamera plugin and gstreamer source recently got support to the relevant APIs to communicate rotations/transforms to clients/sinks, only requiring clients to honor the image-orientation tag event, see https://gitlab.freedesktop.org/pipewire/pipewire/-/merge_requests/1455

Implement support for the later by chaining the videoflip element to camera source elements. Doing it there ensures that the rotation is applied both for the preview as well as for capturing. Note: if no rotatition is required, videoflip will go into passthrough mode, avoiding unnecessary additional copies.

Once the rest of the pipeline is fully hardware accelerated, i.e. after a GTK4 port, videoflip can be replaced with faster alternatives where appropriate.

Depends on !24

Edited by Robert Mader

Merge request reports