Skip to content
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

samples: drivers: video: add capture to lvgl sample #71463

Merged
merged 1 commit into from
Sep 26, 2024

Conversation

@zephyrbot zephyrbot added the area: Samples Samples label Apr 13, 2024
@CharlesDias CharlesDias marked this pull request as draft April 13, 2024 15:07
@CharlesDias
Copy link
Contributor Author

CharlesDias commented Apr 13, 2024

Dear @kartben and @nashif.

This sample has been tested on the mini_stm32h743 target with the OV2640 camera model. It depends on the PR #71462.

Should I move this sample to board-specific samples folder?

west build -p -b mini_stm32h743 samples/subsys/video/capture_to_lvgl/ -- -DCONFIG_BOOT_DELAY=2000

This version works with "VIDEO_SW_GENERATOR"

west build -p -b mini_stm32h743 samples/drivers/video/capture_to_lvgl/ -- -DCONFIG_BOOT_DELAY=2000

and with shield #77949.

west build -p -b mini_stm32h743 samples/drivers/video/capture_to_lvgl/ --shield weact_ov2640_cam_module -- -DCONFIG_BOOT_DELAY=2000

Thanks!

document_4958923842157282345.mp4

@CharlesDias
Copy link
Contributor Author

Fix compliance check errors.

The error "Found references to undefined Kconfig symbols" happened because this PR depend on the PR #71462

@CharlesDias
Copy link
Contributor Author

Fix image alignment

document_4972170831263171749.mp4

@CharlesDias
Copy link
Contributor Author

git rebase

@CharlesDias
Copy link
Contributor Author

Add the clock rate control property. This property depend on #71962

@CharlesDias
Copy link
Contributor Author

Remove shell device, increase main stack size, and change the video buffer array from 1 to 2.

@CharlesDias CharlesDias force-pushed the video_capture_to_lcd branch 2 times, most recently from 82464f5 to aebab04 Compare April 27, 2024 20:53
@CharlesDias CharlesDias marked this pull request as ready for review April 27, 2024 20:56
@josuah
Copy link
Collaborator

josuah commented May 4, 2024

As I understand it, with the LVGL addition, this makes it closer to a demo (showing most of the capabilities of a system) than a sample code (minimal code to implement a single feature).

Is LVGL required for the video to display flow to work?
Maybe splitting/moving it to a separate sample inside samples/module/lvgl since it requires the LVGL module?

@josuah
Copy link
Collaborator

josuah commented Sep 17, 2024

Well, actually the shield is merged now! :)
So while moving the config to the shield is a good thing to do, you can now do this in this PR.
Doing so will also trigger a new CI cycle.

@CharlesDias
Copy link
Contributor Author

Well, actually the shield is merged now! :)

Unfortunately, no! The shield PR is still open. I just removed it from the PR dependency list above.

@CharlesDias
Copy link
Contributor Author

CharlesDias commented Sep 17, 2024

git commit --amend to force CI to run.

@CharlesDias
Copy link
Contributor Author

The CI passed now! Thanks for the tip, @josuah! :-)

josuah
josuah previously approved these changes Sep 17, 2024
Copy link
Collaborator

@josuah josuah left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There is one last reference to something that is just about to be merged :shield: weact_ministm32h7xx_ov2640.
The rest all looks like being ready.

Some config like CONFIG_VIDEO_HFLIP or DT_HAS_CHOSEN(zephyr_camera) are not used by this example, but were still tested against a custom shield (being submitted), so are known to work, and can be used by anyone integrating their own shield in the future.

This currently works with the test pattern generator.

@CharlesDias
Copy link
Contributor Author

Rebase.

@CharlesDias
Copy link
Contributor Author

Update the samples.yaml by adding the integration_platforms; removed the pll and rcc configuration from mini_stm32h743.overlay; changed the default video width and height to the 320x240 resolution because display on native_sim/native/64 has the 320x240 size resolution.

josuah
josuah previously approved these changes Sep 24, 2024
Copy link
Collaborator

@josuah josuah left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This looks very minimal now. Easy to use as a starting point for graphics + video.

Comment on lines 5 to 6
This sample application demonstrates how to use the video API to retrieve video
frames from a capture device and display them on an LCD via the LVGL library.
Copy link
Collaborator

@kartben kartben Sep 17, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This should be much shorter and written as id completing the sentence "this sample shows how to..."

Suggested change
This sample application demonstrates how to use the video API to retrieve video
frames from a capture device and display them on an LCD via the LVGL library.
Capture video frames and display them on an LCD using LVGL.

Will be much more consistent with other samples, too: https://builds.zephyrproject.io/zephyr/pr/71463/docs/samples/drivers/video/video.html

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done. Thanks!

a video capture device, writes a frame count message to the console, and then sends
the frame to an LCD display.
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
a video capture device, writes a frame count message to the console, and then sends
the frame to an LCD display.
a video capture device, write a frame count message to the console, and then send
the frame to an LCD display.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done.

Add sample application to capture an image frame from a camera
and send it for display on LCD via the LVGL library.

Signed-off-by: Charles Dias <charlesdias.cd@outlook.com>
@CharlesDias
Copy link
Contributor Author

Implemented @kartben suggestions.

@nashif nashif merged commit 57a8a7c into zephyrproject-rtos:main Sep 26, 2024
17 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area: LVGL Light and Versatile Graphics Library Support area: Samples Samples area: Video Video subsystem
Projects
None yet
Development

Successfully merging this pull request may close these issues.

7 participants