[libcamera-devel] [PATCH 2/2] libcamera: pipeline: vivid: Print diagnostic on configuration failure
Kieran Bingham
kieran.bingham at ideasonboard.com
Tue Nov 3 16:52:56 CET 2020
Hi Laurent,
On 03/11/2020 15:37, Laurent Pinchart wrote:
> Hi Kieran,
>
> On Tue, Nov 03, 2020 at 03:32:47PM +0000, Kieran Bingham wrote:
>> On 03/11/2020 13:30, Laurent Pinchart wrote:
>>> In case the setFormat() call on the video device fails to match the
>>> configuration, print both the requested and actual configurations to
>>> ease debugging.
>>
>> Sounds like it would be helpful. Again I'll add this to the vivid branch.
>>
>> Sometime we should move that branch onto a repository at libcamera.org
>> rather than my personal external repository - but we can deal with that
>> later.
>
> We have a public tree there, so it's whenever you're ready :-) We can
> also create a specific tree for this purpose if you think that's best.
Aha - good point, I had in my head considered that tree was just for the
main branch - but of course vivid could live in there too if it's going
to live somewhere.
I'll mull it over :-)
--
Kieran
>
>> Reviewed-by: Kieran Bingham <kieran.bingham at ideasonboard.com>
>>
>>> Signed-off-by: Laurent Pinchart <laurent.pinchart at ideasonboard.com>
>>> ---
>>> src/libcamera/pipeline/vivid/vivid.cpp | 7 ++++++-
>>> 1 file changed, 6 insertions(+), 1 deletion(-)
>>>
>>> diff --git a/src/libcamera/pipeline/vivid/vivid.cpp b/src/libcamera/pipeline/vivid/vivid.cpp
>>> index bf8f82af981f..a0ccbd1e711e 100644
>>> --- a/src/libcamera/pipeline/vivid/vivid.cpp
>>> +++ b/src/libcamera/pipeline/vivid/vivid.cpp
>>> @@ -181,8 +181,13 @@ int PipelineHandlerVivid::configure(Camera *camera, CameraConfiguration *config)
>>> return ret;
>>>
>>> if (format.size != cfg.size ||
>>> - format.fourcc != data->video_->toV4L2PixelFormat(cfg.pixelFormat))
>>> + format.fourcc != data->video_->toV4L2PixelFormat(cfg.pixelFormat)) {
>>> + LOG(VIVID, Error)
>>> + << "Requested " << cfg.toString() << ", got "
>>> + << format.size.toString() << "-"
>>> + << format.fourcc.toString();
>>> return -EINVAL;
>>> + }
>>>
>>> /* Set initial controls specific to VIVID */
>>> ControlList controls(data->video_->controls());
>
--
Regards
--
Kieran
More information about the libcamera-devel
mailing list