[libcamera-devel] [PATCH 10/10] DO NOT MERGE: Reports camera properties in cam
Jacopo Mondi
jacopo at jmondi.org
Thu Dec 5 10:41:25 CET 2019
Hi Laurent,
On Wed, Dec 04, 2019 at 06:35:16PM +0200, Laurent Pinchart wrote:
> Hi Jacopo,
>
> Thank you for the patch.
>
> On Wed, Dec 04, 2019 at 02:21:06PM +0100, Jacopo Mondi wrote:
> > Running cam -l lists the camera properties registered by the pipeline
> > handler.
> >
> > In example, for the VIMC pipelinehandler:
> >
> > Available cameras:
> > 1: Integrated Camera: Integrated C
> > 2: VIMC Sensor B
> > Rotation: 0
> > Location: 0
>
> If you want to produce a mergeable patch, I think you could simply add a
> new command line argument to print the properties. And you would need to
> handle types, as the hardcoded int32_t below wouldn't be enough.
>
Would this be something useful ? I can try to add a '-p' switch to cam
in that case.. And yes, I think it might be useful indeed...
> > Signed-off-by: Jacopo Mondi <jacopo at jmondi.org>
> > ---
> > src/cam/main.cpp | 11 +++++++++++
> > 1 file changed, 11 insertions(+)
> >
> > diff --git a/src/cam/main.cpp b/src/cam/main.cpp
> > index a38cca959aca..8d37754773af 100644
> > --- a/src/cam/main.cpp
> > +++ b/src/cam/main.cpp
> > @@ -11,6 +11,7 @@
> > #include <string.h>
> >
> > #include <libcamera/libcamera.h>
> > +#include <libcamera/property_ids.h>
> >
> > #include "capture.h"
> > #include "event_loop.h"
> > @@ -309,6 +310,16 @@ int CamApp::run()
> > for (const std::shared_ptr<Camera> &cam : cm_->cameras()) {
> > std::cout << index << ": " << cam->name() << std::endl;
> > index++;
> > +
> > + const ControlList &properties = cam->properties();
> > + for (const auto &prop : properties) {
> > + auto it = properties::properties.find(prop.first);
> > + if (it == properties::properties.end())
> > + continue;
> > +
> > + std::cout << it->second->name() << ": " <<
> > + prop.second.get<int32_t>() << "\n";
> > + }
> > }
> > }
> >
>
> --
> Regards,
>
> Laurent Pinchart
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 833 bytes
Desc: not available
URL: <https://lists.libcamera.org/pipermail/libcamera-devel/attachments/20191205/16d5b5ef/attachment.sig>
More information about the libcamera-devel
mailing list