[libcamera-devel] [PATCH v2 4/6] android: camera_capabilities: Fix the type of the capability vector

paul.elder at ideasonboard.com paul.elder at ideasonboard.com
Tue Dec 21 17:17:19 CET 2021


Hello,

On Tue, Dec 21, 2021 at 01:46:09PM +0100, Jacopo Mondi wrote:
> Hi again
> 
> On Tue, Dec 21, 2021 at 11:55:18AM +0000, Kieran Bingham wrote:
> > Quoting Jacopo Mondi (2021-12-21 10:42:43)
> > > Hi Paul,
> > >
> > > On Mon, Dec 20, 2021 at 05:26:27PM -0600, Paul Elder wrote:
> > > > The type of elements of the capability vector that is set in the static
> > > > metadata must be uint8_t. The enum will not suffice, as it is int32_t.
> > > > Fix this.
> > > >
> > > > Signed-off-by: Paul Elder <paul.elder at ideasonboard.com>
> > > > Reviewed-by: Kieran Bingham <kieran.bingham at ideasonboard.com>
> > > > ---
> > > >  src/android/camera_capabilities.cpp | 3 ++-
> > > >  1 file changed, 2 insertions(+), 1 deletion(-)
> > > >
> > > > diff --git a/src/android/camera_capabilities.cpp b/src/android/camera_capabilities.cpp
> > > > index 6d383486..ea2aaf58 100644
> > > > --- a/src/android/camera_capabilities.cpp
> > > > +++ b/src/android/camera_capabilities.cpp
> > > > @@ -1389,7 +1389,8 @@ int CameraCapabilities::initializeStaticMetadata()
> > > >
> > > >       /* Check capabilities */
> > > >       capabilities_ = computeCapabilities();
> > > > -     std::vector<camera_metadata_enum_android_request_available_capabilities>
> > > > +     /* This *must* uint8_t. */
> >
> > Still missing the 'be' that I highlighted in a previous version though
> > ;-)

Oh, that's what you were highlighting; I missed it :/

> 
> Do we need the comment at all ?

imo yes, otherwise I'd rather use the enum type because it's more
specific.


Paul

> 
> >
> > --
> > Kieran
> >
> >
> > > > +     std::vector<uint8_t>
> > > >               capsVec(capabilities_.begin(), capabilities_.end());
> > >
> > > android.request.availableCapabilities is indeed documented as [byte x n]
> > >
> > > Reviewed-by: Jacopo Mondi <jacopo at jmondi.org>
> > >
> > > Thanks
> > >   j
> > >
> > > >       staticMetadata_->addEntry(ANDROID_REQUEST_AVAILABLE_CAPABILITIES, capsVec);
> > > >
> > > > --
> > > > 2.27.0
> > > >


More information about the libcamera-devel mailing list