(core): add default resolution option in camera selector
Description
When using a camera selector in an application, it automatically proposes a resolution selection. This is an additional sep that might not be systematically required.
Proposal
Add a XML configuration option which allows to set a default behavior on the resolution selection.
There will be 4 options values:
- min (for minimal resolution)
- max (for max resolution)
- value (with a string corresponding to the resolution expected, i.e. 640x480)
- %CAMERA_RESOLUTION% (no default option is automatically chosen)
- no tag specified (mainly for compatibility purpose)
When one of the three first cases is specified in the XML, the camera resolution is thus set by the developer and can not be changed by the user. If the resolution specified in 3. is not available, a user error should be displayed with a pop-up dialog.
When the fourth case is specified in the XML, the camera resolution is searched in the preferences system with delimited_get
. If the preference is empty, then the usual pop-up dialog is shown to let the user select the resolution; we just list the resolutions as before. If the preference is not empty, the saved resolution is used. There should also be a button or a menu to allow to change the resolution later.
In the last case, the usual pop-up dialog is always shown to let the user select the resolution.