Android support for camera zoom

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Android support for camera zoom

1,044 Views
dennis3
Contributor V

Testing Android 11 2.2.0 and 2.6.0 on imx8m plus.  I need to support a legacy application on Android that uses the Camera1 api.  The HAL imx layer reports the number 4 for digital zoom.

CameraMetadata.cpp 

This is resulting in the Android API legacy camera parameters isZoomSupported() returning true and getMaxZoom() returning 99.  if I then call setZoom on the camera parameters, the output image is not changed.  It appears as near as I can tell that digital zoom is ignored.  It's unclear why the number 4 is used in the HAL and whether or not zoom is actually supposed to be supported or not.

If I change the metadata to report 1 instead of 4 for the zoom.  The api reports false for isZoomSupported.

If zoom is supposed to be supported what do I need to change or implement in my camera?  It seems the imx8m plus has IPU capability of zooming the image but that the HAL is not honoring the zoom parameters.

0 Kudos
4 Replies

997 Views
chrispeterson
Contributor IV

@dennis3 

I had the same findings.  

I also found the following section that explains that '4' in the zoom:

chrispeterson_0-1656431650027.png

 

This is located in the https://www.nxp.com/docs/en/user-guide/iMX8MP_CAMERA_DISPLAY_GUIDE.pdf

@nxp 

This also defines the interface to control through an IOCTL call.

Is this API to get the ISP to do the scaling?  Does this happen in the GPU? In Software?

I searched through the i.MX 8M Plus Application Processor Reference manual and I didn't find any reference in the ISP of DEWARP section that  upscale / zoom is a feature.  Those sections do mention downscaling though.

Is the ISP capably of upscaling / zooming digitally?

-Chris

990 Views
dennis3
Contributor V

We are also not using the ISP.  I haven't searched the code to figure out if this is ISP specific or not. 

0 Kudos

1,019 Views
chrispeterson
Contributor IV

Hello @dennis3 ,

I am having the same issue.  Did you ever figure out how to get the ISP to zoom while in Android?

I am currently using Android 11 2.6.0.

Thank you,

Chris

0 Kudos

1,005 Views
dennis3
Contributor V

I'm afraid no, there has been no activity on this. 

In the mean time, I've simply changed the HAL layer to report 1 for zoom and then the Camera API parameters report false for isZoomSupported.  It's an OK workaround unless you need zoom.

Near as I can tell, there is just no support for zoom in the HAL layer.  The only references to it are in the metadata and there isn't any code that calls those functions anyway.  So unless I missed something the zoom parameters are simply is ignored.

0 Kudos