[libcamera-devel] [PATCH] android: camera_capabilities: Ensure PixelArrayActiveAreas exists before accessing

Laurent Pinchart laurent.pinchart at ideasonboard.com
Thu Jul 15 16:35:17 CEST 2021


Hi Kieran,

On Thu, Jul 15, 2021 at 03:29:37PM +0100, Kieran Bingham wrote:
> On 15/07/2021 15:06, Laurent Pinchart wrote:
> > On Thu, Jul 15, 2021 at 03:00:11PM +0100, Kieran Bingham wrote:
> >> The VIVID pipline handler does not set this. It's likely that the
> >> UVC pipeline will not either.
> >>
> >> If not present, we must not access it.
> > 
> > Wasn't this considered as a mandatory property ?
> 
> By android - or by us?

By us.

> Can this property be identified on a UVC camera?

We can set it to the maximum resolution.

> Or should we just report the biggest frame size in the pipeline handler
> if it's not something we can otherwise determine?

There we go :-)

> I had thought mandatory properties were going to have a flag in the yaml
> - but I don't see it here (or anywhere though).

Correct, there should be a flag, but we don't have that yet.

> Do we already define mandatory properties in another location?

No. Should we start adding the flag, even if we don't do anything with
it ?

> >> Signed-off-by: Kieran Bingham <kieran.bingham at ideasonboard.com>
> >> ---
> >>  src/android/camera_capabilities.cpp | 2 +-
> >>  1 file changed, 1 insertion(+), 1 deletion(-)
> >>
> >> diff --git a/src/android/camera_capabilities.cpp b/src/android/camera_capabilities.cpp
> >> index 6b5edb66fad2..dfc961affe46 100644
> >> --- a/src/android/camera_capabilities.cpp
> >> +++ b/src/android/camera_capabilities.cpp
> >> @@ -589,7 +589,7 @@ int CameraCapabilities::initializeStaticMetadata()
> >>  					  physicalSize);
> >>  	}
> >>  
> >> -	{
> >> +	if (properties.contains(properties::PixelArrayActiveAreas)) {
> >>  		const Span<const Rectangle> &rects =
> >>  			properties.get(properties::PixelArrayActiveAreas);
> >>  		std::vector<int32_t> data{

-- 
Regards,

Laurent Pinchart


More information about the libcamera-devel mailing list