[v4,0/3] gstreamer: Report camera properties as device properties
mbox series

Message ID 20250724133343.353044-1-uajain@igalia.com
Headers show
Series
  • gstreamer: Report camera properties as device properties
Related show

Message

Umang Jain July 24, 2025, 1:33 p.m. UTC
This series aims to report camera properties from libcamera
to device properties in gstreamer device provider.

Patch 1/3 splits the Rectangle GValue helper into two:
Point and Size.


Patch 2/3 moves all three 3 GValue helpers(Rectangle, Size, Point)
from gstlibcamera-controls.cpp.in to libcamera-utils.cpp. This
enables code sharing when we report properties which are
Rectangle, Size, Points types.

Patch 3/3 is the integration patch. It maps all ControlType
from libcamera to corresponding GType. If the ControlValue::isArray()
is true, GST_VALUE_ARRAY is preferred to report all array values,
with corresponding type GType.

Output on RPi3:
==============
uajain1@uajain:~$ cam -c1 -p
...
Property: SystemDevices = [ 20749, 20739, 20740, 20741 ]
Property: ScalerCropMaximum = (0, 0)/0x0
Property: PixelArrayActiveAreas = [ (8, 8)/3280x2464 ]
Property: PixelArraySize = 3280x2464
Property: Rotation = 180
Property: Location = 2 (CameraLocationExternal)
Property: ColorFilterArrangement = 0 (RGGB)
Property: UnitCellSize = 1120x1120
Property: Model = imx219


uajain1@uajain:~$ gst-device-monitor-1.0 
....
	properties:
		api.libcamera.SystemDevices = < (gint64)20749, (gint64)20739, (gint64)20740, (gint64)20741 >
		api.libcamera.ScalerCropMaximum = < (int)0, (int)0, (int)0, (int)0 >
		api.libcamera.PixelArrayActiveAreas = < (int)8, (int)8, (int)3280, (int)2464 >
		api.libcamera.PixelArraySize = < (int)3280, (int)2464 >
		api.libcamera.Rotation = 180
		api.libcamera.Location = CameraLocationExternal
		api.libcamera.ColorFilterArrangement = RGGB
		api.libcamera.UnitCellSize = < (int)1120, (int)1120 >
		api.libcamera.Model = imx219
	gst-launch-1.0 libcamerasrc camera-name="/base/soc/i2c0mux/i2c\@1/imx219\@10" ! ...

Changes in v3:
- Extensively reworked to map ControlType<>GType for ControlValues

Umang Jain (3):
  gstreamer: Split value_set_rectangle() GValue helper
  gstreamer: Move existing GValue helpers to gstreamer-utils
  gstreamer: Report camera properties as device properties

 src/gstreamer/gstlibcamera-controls.cpp.in |  50 +----
 src/gstreamer/gstlibcamera-utils.cpp       | 246 +++++++++++++++++++++
 src/gstreamer/gstlibcamera-utils.h         |   7 +
 src/gstreamer/gstlibcameraprovider.cpp     |  16 ++
 4 files changed, 274 insertions(+), 45 deletions(-)