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

Add support for MJPEG on UVC #1668

Merged
merged 8 commits into from Oct 19, 2022
Merged

Conversation

kkitayam
Copy link
Collaborator

@kkitayam kkitayam commented Oct 9, 2022

Describe the PR
Add support for MJPEG on UVC.

It is tested with video_capture example on frdm_kl25z and raspberry pi pico

Additional context
video_capture uses MJPG video instead of uncompressed video when it builds with CFG_EXAMPLE_VIDEO_READONLY defined.

If a MCU has not enough SRAM for frame buffers, CFG_EXAMPLE_VIDEO_READONLY is already defined in board.mk at hw/bsp/<board>. For example, frdm_kl25z and so on. Any other MCU which has enough SRAM for frame buffers use uncompressed video in default. To force the use of MJPG video, add the FORCE_READONLY argument to make or cmake.
For example:

make FORCE_READONLY=1 BOARD=frdm_kl25z
cmake -B build_rp2040 -G Ninja -DFAMILY=rp2040 -DPICO_SDK_PATH=c:\pico_sdk -DFORCE_READONLY=1

@kkitayam
Copy link
Collaborator Author

kkitayam commented Oct 9, 2022

@me-no-dev

Would you see if this PR is useful or not for your application which indicated #1118 (comment) ?

Copy link
Contributor

@tswan-quasi tswan-quasi left a comment

Choose a reason for hiding this comment

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

I only checked the descriptors and class files as that is what I used in my setup. Some type consistency changes that also affect the functionality. Regardless, it runs fine on my setup, tested on LPC55S69 (using #1676).

examples/device/video_capture/src/usb_descriptors.h Outdated Show resolved Hide resolved
examples/device/video_capture/src/usb_descriptors.h Outdated Show resolved Hide resolved
src/class/video/video_device.c Show resolved Hide resolved
src/class/video/video_device.c Outdated Show resolved Hide resolved
@kkitayam kkitayam changed the title Add support for MJPG on UVC Add support for MJPEG on UVC Oct 12, 2022
@kkitayam
Copy link
Collaborator Author

@tswan-quasi
Thank you for your helpful comments. I feel that your comments helped improve this PR.

Copy link
Owner

@hathach hathach left a comment

Choose a reason for hiding this comment

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

superb! Thank you very much for yet another great PR. And thank @tswan-quasi for helping with reviewing. To be honest, I am still not catching up with UVC

@hathach hathach merged commit e79325a into hathach:master Oct 19, 2022
@kkitayam kkitayam deleted the add_support_for_mjpeg branch October 20, 2022 11:28
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants