[libcamera-devel,0/2] gstreamer: src: Add transform property
mbox series

Message ID 20230613103519.91370-1-robert.mader@collabora.com
Headers show
Series
  • gstreamer: src: Add transform property
Related show

Message

Robert Mader June 13, 2023, 10:34 a.m. UTC
This allows users to request a transform using the Gstreamer
equivalent. If the combined transform of the requested one and a
possible rotation from the camera properties is not fully supported by
the sensor, the remaining transform will be passed down to downstream
elements as tag.

The later is common for 90/270 degree rotations. Thus, a side effect of
this feature is that libcamerasrc now behaves similar to pipewiresrc in
regards to rotated cameras in e.g. phones, allowing apps to compensate
accordingly.

To test the transform property:
gst-launch-1.0 libcamerasrc transform=90r ! videoconvert ! videoflip video-direction=auto ! gtksink

To test cameras with rotation not supported by sensor, such as the ones of the Pinephone Pro,
compare the out put of the following:
gst-launch-1.0 libcamerasrc ! videoconvert ! videoflip video-direction=auto ! gtksink
gst-launch-1.0 pipewiresrc ! videoconvert ! videoflip video-direction=auto ! gtksink

Robert Mader (2):
  gstreamer: src: Style change
  gstreamer: src: Add transform property

 src/gstreamer/gstlibcamera-utils.cpp | 72 ++++++++++++++++++++++++++++
 src/gstreamer/gstlibcamera-utils.h   |  5 ++
 src/gstreamer/gstlibcamerasrc.cpp    | 56 ++++++++++++++++++----
 3 files changed, 125 insertions(+), 8 deletions(-)