-
Notifications
You must be signed in to change notification settings - Fork 7.7k
video: add more resolutions to GC2145 #91975
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
eed540f
to
145641c
Compare
video: add more resolutions to GC2145 As I mentioned in issue zephyrproject-rtos#91968, It would be great if the camera drivers would support a larger number of resolutions. For example those resolutions of the displays that they wish to display an image on. Potentially in both landscape and portrait mode. So far I have added one the works in landscape mode for ILI948x and ST7796 displays as well as a QVGA in portrait mode, which should be good for LI9341 and some ST7789 displays. If this looks like a valid approach, I will also add the GIGA Display Adapter size. Probably need to add the duplicate items to the FORMAT_CAP list for YUYV mode. Note: the other than add the items to the list, I just added code to set resolution which computes the c_ratio/r_ratio chooses the smaller of the two to use. We may also remove most if not all of the items in the switch statement and simply use the default clause code for them. Signed-off-by: Kurt Eckhardt <kurte@rockisland.com>
145641c
to
9e291b5
Compare
|
c_ratio = UXGA_HSIZE / w; | ||
r_ratio = UXGA_VSIZE / h; | ||
if (c_ratio < r_ratio) { | ||
r_ratio = c_ratio; | ||
} else { | ||
c_ratio = r_ratio; | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This looks like some convenient "catch-all" rule to configure the exact resolution one needs but there is another way to do it:
-
The role of
video_set_format()
is to configure the "effective resolution", the size after binning is appplied (the row and column ratio like you configure now). -
The role of
video_set_selection()
is to apply a cropping to the "effective/binned resolution" into an "output resolution" to give full control over what the sensor supports.
This should be merged this week so if it is possible for you to wait (or implement it!), then this would allow you to control this sensor features fully.
Thank you for the proposal!
As I mentioned in issue #91968,
It would be great if the camera drivers would support a larger number of resolutions. For example those resolutions of the displays that they wish to display an image on. Potentially in both landscape and portrait mode.
So far I have added one the works in landscape mode for ILI948x and ST7796 displays as well
as a QVGA in portrait mode, which should be good for ILI9341 and some ST7789 displays.
If this looks like a valid approach will also add in GIGA Display Adapter size, and maybe and add the duplicate items to the FORMAT_CAP list for YUYV mode.
Note: the other than add the items to the list, I just added code to set resolution which computes the c_ratio/r_ratio chooses the smaller of the two to use.
Could probably do several of the others n the switch statement.
Example: shows GC2145 image shown on an ST7796 display on an Arduino GIGA using the Arduino wrapper.