| Message ID | 20261102-kbingham-orientation-v2-2-21b1cdd0d167@ideasonboard.com |
|---|---|
| State | New |
| Headers | show |
| Series |
|
| Related | show |
2026. 11. 02. 13:11 keltezéssel, Kieran Bingham írta: > When a pipeline handler asks the CameraSensor for a format, which is not > achievable, it can be very helpful to the user to identify what size was > requested and why it could not be provided within any constrained > maximum size. > > This can make otherwise difficult to diagnose user errors visible and > quickly correctable. > > Both of the CameraSensorRaw and CameraSensorLegacy are updated > accordingly but that likely means these two classes could soon benefit > from a more common base class to share otherwise identical code. > > Reviewed-by: Jacopo Mondi <jacopo.mondi@ideasonboard.com> > Signed-off-by: Kieran Bingham <kieran.bingham@ideasonboard.com> > > --- > v2: > > - Keep log level as Debug > --- > src/libcamera/sensor/camera_sensor_legacy.cpp | 4 +++- > src/libcamera/sensor/camera_sensor_raw.cpp | 4 +++- > 2 files changed, 6 insertions(+), 2 deletions(-) > > diff --git a/src/libcamera/sensor/camera_sensor_legacy.cpp b/src/libcamera/sensor/camera_sensor_legacy.cpp > index 792e4b09d4fa..0e2085d91345 100644 > --- a/src/libcamera/sensor/camera_sensor_legacy.cpp > +++ b/src/libcamera/sensor/camera_sensor_legacy.cpp > @@ -759,7 +759,9 @@ CameraSensorLegacy::getFormat(std::span<const unsigned int> mbusCodes, > } > > if (!bestSize) { > - LOG(CameraSensor, Debug) << "No supported format or size found"; > + LOG(CameraSensor, Debug) > + << "No supported format or size found. Requested " > + << size << " with a maximum size " << maxSize; > return {}; > } > > diff --git a/src/libcamera/sensor/camera_sensor_raw.cpp b/src/libcamera/sensor/camera_sensor_raw.cpp > index 55b386cef3f3..14ab15b05ab3 100644 > --- a/src/libcamera/sensor/camera_sensor_raw.cpp > +++ b/src/libcamera/sensor/camera_sensor_raw.cpp > @@ -821,7 +821,9 @@ CameraSensorRaw::getFormat(std::span<const unsigned int> mbusCodes, > } > > if (!bestSize) { > - LOG(CameraSensor, Debug) << "No supported format or size found"; > + LOG(CameraSensor, Warning) This was not made "Debug", is that intentional? > + << "No supported format or size found. Requested " > + << size << " with a maximum size " << maxSize; > return {}; > } > >
Quoting Barnabás Pőcze (2026-11-09 13:49:51) > 2026. 11. 02. 13:11 keltezéssel, Kieran Bingham írta: > > When a pipeline handler asks the CameraSensor for a format, which is not > > achievable, it can be very helpful to the user to identify what size was > > requested and why it could not be provided within any constrained > > maximum size. > > > > This can make otherwise difficult to diagnose user errors visible and > > quickly correctable. > > > > Both of the CameraSensorRaw and CameraSensorLegacy are updated > > accordingly but that likely means these two classes could soon benefit > > from a more common base class to share otherwise identical code. > > > > Reviewed-by: Jacopo Mondi <jacopo.mondi@ideasonboard.com> > > Signed-off-by: Kieran Bingham <kieran.bingham@ideasonboard.com> > > > > --- > > v2: > > > > - Keep log level as Debug > > --- > > src/libcamera/sensor/camera_sensor_legacy.cpp | 4 +++- > > src/libcamera/sensor/camera_sensor_raw.cpp | 4 +++- > > 2 files changed, 6 insertions(+), 2 deletions(-) > > > > diff --git a/src/libcamera/sensor/camera_sensor_legacy.cpp b/src/libcamera/sensor/camera_sensor_legacy.cpp > > index 792e4b09d4fa..0e2085d91345 100644 > > --- a/src/libcamera/sensor/camera_sensor_legacy.cpp > > +++ b/src/libcamera/sensor/camera_sensor_legacy.cpp > > @@ -759,7 +759,9 @@ CameraSensorLegacy::getFormat(std::span<const unsigned int> mbusCodes, > > } > > > > if (!bestSize) { > > - LOG(CameraSensor, Debug) << "No supported format or size found"; > > + LOG(CameraSensor, Debug) > > + << "No supported format or size found. Requested " > > + << size << " with a maximum size " << maxSize; > > return {}; > > } > > > > diff --git a/src/libcamera/sensor/camera_sensor_raw.cpp b/src/libcamera/sensor/camera_sensor_raw.cpp > > index 55b386cef3f3..14ab15b05ab3 100644 > > --- a/src/libcamera/sensor/camera_sensor_raw.cpp > > +++ b/src/libcamera/sensor/camera_sensor_raw.cpp > > @@ -821,7 +821,9 @@ CameraSensorRaw::getFormat(std::span<const unsigned int> mbusCodes, > > } > > > > if (!bestSize) { > > - LOG(CameraSensor, Debug) << "No supported format or size found"; > > + LOG(CameraSensor, Warning) > > This was not made "Debug", is that intentional? Aeyyeyeee ... nope, thanks. -- Kieran > > > > + << "No supported format or size found. Requested " > > + << size << " with a maximum size " << maxSize; > > return {}; > > } > > > > >
diff --git a/src/libcamera/sensor/camera_sensor_legacy.cpp b/src/libcamera/sensor/camera_sensor_legacy.cpp index 792e4b09d4fa..0e2085d91345 100644 --- a/src/libcamera/sensor/camera_sensor_legacy.cpp +++ b/src/libcamera/sensor/camera_sensor_legacy.cpp @@ -759,7 +759,9 @@ CameraSensorLegacy::getFormat(std::span<const unsigned int> mbusCodes, } if (!bestSize) { - LOG(CameraSensor, Debug) << "No supported format or size found"; + LOG(CameraSensor, Debug) + << "No supported format or size found. Requested " + << size << " with a maximum size " << maxSize; return {}; } diff --git a/src/libcamera/sensor/camera_sensor_raw.cpp b/src/libcamera/sensor/camera_sensor_raw.cpp index 55b386cef3f3..14ab15b05ab3 100644 --- a/src/libcamera/sensor/camera_sensor_raw.cpp +++ b/src/libcamera/sensor/camera_sensor_raw.cpp @@ -821,7 +821,9 @@ CameraSensorRaw::getFormat(std::span<const unsigned int> mbusCodes, } if (!bestSize) { - LOG(CameraSensor, Debug) << "No supported format or size found"; + LOG(CameraSensor, Warning) + << "No supported format or size found. Requested " + << size << " with a maximum size " << maxSize; return {}; }