JIWONKIM
JIWONKIM

Reputation: 3

How to get the supported resolutions from a USB camera in Android?

I'm currently using the following code to retrieve a list of supported resolutions from a USB camera.

StreamConfigurationMap map = characteristics.get(CameraCharacteristics.SCALER_STREAM_CONFIGURATION_MAP);
//...
return map.getOutputSizes(mode);

However, based on the logs below, it seems that some of the resolutions returned by this code are not actually supported.

[email protected]: trimSupportedFormats: size (320,240) is removed due to unable to crop vertically from (2592, 1944)
[email protected]: trimSupportedFormats: size (640,480) is removed due to unable to crop vertically from (2592, 1944)
//...
[email protected]: configureStreams: request stream 640x480, format: 0x22
[email protected]: V4L configuration format:YUYV, w 2592, h 1944

Is there a way to retrieve only the resolutions that are genuinely supported by the USB camera in an Android app?

Upvotes: 0

Views: 25

Answers (0)

Related Questions