| Message ID | 20251023144841.403689-14-stefan.klug@ideasonboard.com |
|---|---|
| State | New |
| Headers | show |
| Series |
|
| Related | show |
2025. 10. 23. 16:48 keltezéssel, Stefan Klug írta: > Getting the requested input/output format is crucial for debugging. Add > log statements for that. > > Signed-off-by: Stefan Klug <stefan.klug@ideasonboard.com> > Reviewed-by: Kieran Bingham <kieran.bingham@ideasonboard.com> > Reviewed-by: Barnabás Pőcze <barnabas.pocze@ideasonboard.com> But I feel like this should be moved in to the `V4L2VideoDevice::setFormat()` class to have it in a single place. That could also log the actual format if it was adjusted (which is probably just as important for debugging). > --- > > Changes in v2: > - Collected tag > --- > src/libcamera/converter/converter_v4l2_m2m.cpp | 2 ++ > 1 file changed, 2 insertions(+) > > diff --git a/src/libcamera/converter/converter_v4l2_m2m.cpp b/src/libcamera/converter/converter_v4l2_m2m.cpp > index 48e49f143cf1..37377ab24952 100644 > --- a/src/libcamera/converter/converter_v4l2_m2m.cpp > +++ b/src/libcamera/converter/converter_v4l2_m2m.cpp > @@ -111,6 +111,7 @@ int V4L2M2MConverter::V4L2M2MStream::configure(const StreamConfiguration &inputC > format.planesCount = 1; > format.planes[0].bpl = inputCfg.stride; > > + LOG(Converter, Debug) << "Set input format to: " << format; > int ret = m2m_->output()->setFormat(&format); > if (ret < 0) { > LOG(Converter, Error) > @@ -133,6 +134,7 @@ int V4L2M2MConverter::V4L2M2MStream::configure(const StreamConfiguration &inputC > format.fourcc = videoFormat; > format.size = outputCfg.size; > > + LOG(Converter, Debug) << "Set output format to: " << format; > ret = m2m_->capture()->setFormat(&format); > if (ret < 0) { > LOG(Converter, Error)
Quoting Stefan Klug (2025-10-23 23:48:14) > Getting the requested input/output format is crucial for debugging. Add > log statements for that. > > Signed-off-by: Stefan Klug <stefan.klug@ideasonboard.com> > Reviewed-by: Kieran Bingham <kieran.bingham@ideasonboard.com> Reviewed-by: Paul Elder <paul.elder@ideasonboard.com> > > --- > > Changes in v2: > - Collected tag > --- > src/libcamera/converter/converter_v4l2_m2m.cpp | 2 ++ > 1 file changed, 2 insertions(+) > > diff --git a/src/libcamera/converter/converter_v4l2_m2m.cpp b/src/libcamera/converter/converter_v4l2_m2m.cpp > index 48e49f143cf1..37377ab24952 100644 > --- a/src/libcamera/converter/converter_v4l2_m2m.cpp > +++ b/src/libcamera/converter/converter_v4l2_m2m.cpp > @@ -111,6 +111,7 @@ int V4L2M2MConverter::V4L2M2MStream::configure(const StreamConfiguration &inputC > format.planesCount = 1; > format.planes[0].bpl = inputCfg.stride; > > + LOG(Converter, Debug) << "Set input format to: " << format; > int ret = m2m_->output()->setFormat(&format); > if (ret < 0) { > LOG(Converter, Error) > @@ -133,6 +134,7 @@ int V4L2M2MConverter::V4L2M2MStream::configure(const StreamConfiguration &inputC > format.fourcc = videoFormat; > format.size = outputCfg.size; > > + LOG(Converter, Debug) << "Set output format to: " << format; > ret = m2m_->capture()->setFormat(&format); > if (ret < 0) { > LOG(Converter, Error) > -- > 2.48.1 >
diff --git a/src/libcamera/converter/converter_v4l2_m2m.cpp b/src/libcamera/converter/converter_v4l2_m2m.cpp index 48e49f143cf1..37377ab24952 100644 --- a/src/libcamera/converter/converter_v4l2_m2m.cpp +++ b/src/libcamera/converter/converter_v4l2_m2m.cpp @@ -111,6 +111,7 @@ int V4L2M2MConverter::V4L2M2MStream::configure(const StreamConfiguration &inputC format.planesCount = 1; format.planes[0].bpl = inputCfg.stride; + LOG(Converter, Debug) << "Set input format to: " << format; int ret = m2m_->output()->setFormat(&format); if (ret < 0) { LOG(Converter, Error) @@ -133,6 +134,7 @@ int V4L2M2MConverter::V4L2M2MStream::configure(const StreamConfiguration &inputC format.fourcc = videoFormat; format.size = outputCfg.size; + LOG(Converter, Debug) << "Set output format to: " << format; ret = m2m_->capture()->setFormat(&format); if (ret < 0) { LOG(Converter, Error)