-
Notifications
You must be signed in to change notification settings - Fork 8k
video: Patch SDMA & capture sample to arbitrate height and width #96986
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
85af2ed
to
91be28e
Compare
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.
Please split this into 2 commits: driver changes, sample changes.
Also, explain why the driver change is needed in the commit message.
91be28e
to
bafe2fb
Compare
Thank you, this is done. |
Ensure Image sensors using video_sdma only use the valid RGB565 format. Signed-off-by: Zacck Osiemo <[email protected]>
This board uses sdma as its video driver and that requires this size frame to be set for the sample to work Signed-off-by: Zacck Osiemo <[email protected]>
bafe2fb
to
aa93037
Compare
|
/* Verify that format is RGB565 */ | ||
if ((fmt->pixelformat != fmts[0].pixelformat) || | ||
(fmt->width != fmts[0].width_min) || | ||
(fmt->height != fmts[0].height_min)) { | ||
return -ENOTSUP; | ||
ret = video_set_format(config->sensor_dev, fmt); | ||
|
||
if (ret < 0) { | ||
LOG_ERR("Sensor device does not support RGB565"); | ||
return ret; | ||
} |
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.
The fix for this is ultimately in the capture
sample IMHO, but for the sake of a workaround that stll makes sense.
Another compromise in the meantime is to configure the default format in _init()
and make this call always return the default supported format without asking the source?
Thanks for the help!
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.
If you wanted to make sure that fmt = RGB565 320x240
, you would also need to use fmts[0]
instead of fmt
: as what you propose seems like doing this?
if (/* format is not what is expected */) {
/* use the incorrect fmt */
}
So that would need a tmp = { /* correct fmt */ }
if wanting to go that path (but +1 for simply moving that in init()
).
The video capture sample does not work when using a combination of the FRDM-MCXN236 and the OV5640 camera and this is due to the sensor and the underlying interface having different defaults. This patch sets the interface resolution to that selected by the sample which in turn is set in the CONFIG.