Message ID | 20200421203954.15585-3-andrey.konovalov@linaro.org |
---|---|
State | Accepted |
Headers | show |
Series |
|
Related | show |
Hi Andrey, Thank you for the patch. On Tue, Apr 21, 2020 at 11:39:54PM +0300, Andrey Konovalov wrote: > Now SimpleCameraData::setupFormats() can fail if the camera sensor > supports media bus code which some entities down the pipeline don't. > > When this happens continue with the next media bus code instead of aborting > the enumeration of the possible pipeline configurations. > > Signed-off-by: Andrey Konovalov <andrey.konovalov@linaro.org> > --- > src/libcamera/pipeline/simple/simple.cpp | 5 +++-- > 1 file changed, 3 insertions(+), 2 deletions(-) > > diff --git a/src/libcamera/pipeline/simple/simple.cpp b/src/libcamera/pipeline/simple/simple.cpp > index 8212bd9..1a31e18 100644 > --- a/src/libcamera/pipeline/simple/simple.cpp > +++ b/src/libcamera/pipeline/simple/simple.cpp > @@ -265,10 +265,11 @@ int SimpleCameraData::init() > > ret = setupFormats(&format, V4L2Subdevice::TryFormat); > if (ret < 0) { > - LOG(SimplePipeline, Error) > + LOG(SimplePipeline, Warning) > << "Failed to setup pipeline for media bus code " > << utils::hex(code, 4); Should we downgrade this to a debug message to avoid worrying the user when all goes well ? Or maybe an info message to still give a hint that something may be wrong ? And how about also making the message less scary ? << "Media bus code " << utils::hex(code, 4) << " not supported for this pipeline"; If you're fine with these changes I can fix when applying. Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> > - return ret; > + /* Try next mbus_code supported by the sensor */ > + continue; > } > > std::map<V4L2PixelFormat, std::vector<SizeRange>> videoFormats =
diff --git a/src/libcamera/pipeline/simple/simple.cpp b/src/libcamera/pipeline/simple/simple.cpp index 8212bd9..1a31e18 100644 --- a/src/libcamera/pipeline/simple/simple.cpp +++ b/src/libcamera/pipeline/simple/simple.cpp @@ -265,10 +265,11 @@ int SimpleCameraData::init() ret = setupFormats(&format, V4L2Subdevice::TryFormat); if (ret < 0) { - LOG(SimplePipeline, Error) + LOG(SimplePipeline, Warning) << "Failed to setup pipeline for media bus code " << utils::hex(code, 4); - return ret; + /* Try next mbus_code supported by the sensor */ + continue; } std::map<V4L2PixelFormat, std::vector<SizeRange>> videoFormats =
Now SimpleCameraData::setupFormats() can fail if the camera sensor supports media bus code which some entities down the pipeline don't. When this happens continue with the next media bus code instead of aborting the enumeration of the possible pipeline configurations. Signed-off-by: Andrey Konovalov <andrey.konovalov@linaro.org> --- src/libcamera/pipeline/simple/simple.cpp | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-)