[WIP,RFC,09/26] libcamera: camera_sensor_raw: Enumerate formats using sink pads
diff mbox series

Message ID 20261023-b4-raw-model-v1-9-eadb9948901b@ideasonboard.com
State New
Headers show
Series
  • Support the new common raw sensor model
Related show

Commit Message

Jai Luthra Oct. 23, 2026, 10:58 a.m. UTC
The sensor may enumerate multiple formats when queried for a source
pad/stream, as it can pad or sometimes truncate the data before putting
it on the bus. But it is guaranteed to enumerate a single format (native
size) on the internal pad.

Use that to figure out the identify the type of a stream, as it is
cleaner.

Signed-off-by: Jai Luthra <jai.luthra@ideasonboard.com>
---
 src/libcamera/sensor/camera_sensor_raw.cpp | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

Patch
diff mbox series

diff --git a/src/libcamera/sensor/camera_sensor_raw.cpp b/src/libcamera/sensor/camera_sensor_raw.cpp
index b7ac9d90f523..29ea9406ad0d 100644
--- a/src/libcamera/sensor/camera_sensor_raw.cpp
+++ b/src/libcamera/sensor/camera_sensor_raw.cpp
@@ -276,7 +276,7 @@  std::optional<int> CameraSensorRaw::init()
 		}
 
 		/* Identify the stream type based on the supported formats. */
-		V4L2Subdevice::Formats formats = subdev_->formats(route.source);
+		V4L2Subdevice::Formats formats = subdev_->formats(route.sink);
 
 		std::optional<MediaBusFormatInfo::Type> type;
 
@@ -291,7 +291,7 @@  std::optional<int> CameraSensorRaw::init()
 
 		if (!type) {
 			LOG(CameraSensor, Warning)
-				<< "No known format on pad " << route.source;
+				<< "No known format on pad " << route.sink;
 			continue;
 		}