1 | initial version |
In Android, the following can be done to get the list of supported preview resolutions:
cv::VideoCapture camera(0);
camera.open(0);
union {const char* str; double res;} previewSizes;
previewSizes.res = camera.get(CV_CAP_PROP_SUPPORTED_PREVIEW_SIZES_STRING);
printf("%s",previewSizes.str);
This will yield a string as follows:
960x720,1280x720,1184x666,960x640,704x576,640x480,352x288,320x240
The string needs parsing - not that difficult. This information is extracted by following the source code and it is not documented; any platform-specific camera capture code is in fact not documented. I will try to add the proper documentation to at least the Android side with a PR in the future.