Auto-set default preview size and format for different cameras #410
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Current samples need to set preview size and format in samples or wrappers. That is, an UVC app using this library won't work on all cameras with different size or format.
In #175, Roger has applied usbCameraTest0 to adapt different size with least area error.
Different from his contribution, my work tries to find proper size and format with least absolute error of width and height, which is directly implemented in library instead of app.
The two commits work fine on my two cameras, one is 640x480@MJPEG and the other is 50x50@YUYV.
The PR needs to be reviewed, thanks.